MCPcopy Create free account
hub / github.com/EdwardRaff/JSAT / testSet

Method testSet

JSAT/test/jsat/linear/SparseMatrixTest.java:951–966  ·  view source on GitHub ↗

Test of set method, of class SparseMatrix.

()

Source from the content-addressed store, hash-verified

949 * Test of set method, of class SparseMatrix.
950 */
951 @Test
952 public void testSet()
953 {
954 System.out.println("set");
955
956 A.set(0, 0, 0.0);
957 A.set(0, 4, -1.0);
958 A.set(3, 0, -2.0);
959
960 assertEquals(8, A.nnz());
961 assertEquals(0.0, A.get(0, 0), 1e-20);
962 assertEquals(-1.0, A.get(0, 4), 1e-20);
963
964 assertEquals(-2.0, A.get(3, 0), 1e-20);
965 assertEquals(1.0, A.get(3, 1), 1e-20);
966 }
967
968 /**
969 * Test of increment method, of class SparseMatrix.

Callers

nothing calls this directly

Calls 3

setMethod · 0.45
nnzMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected