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

Method testIncrement

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

Test of increment method, of class SparseMatrix.

()

Source from the content-addressed store, hash-verified

969 * Test of increment method, of class SparseMatrix.
970 */
971 @Test
972 public void testIncrement()
973 {
974 System.out.println("increment");
975
976 A.increment(0, 4, -1.0);
977 A.increment(3, 0, -2.0);
978
979 assertEquals(9, A.nnz());
980 assertEquals(1.0, A.get(0, 0), 1e-20);
981 assertEquals(3.0, A.get(0, 4), 1e-20);
982
983 assertEquals(-2.0, A.get(3, 0), 1e-20);
984 assertEquals(1.0, A.get(3, 1), 1e-20);
985 }
986
987 /**
988 * Test of rows method, of class SparseMatrix.

Callers

nothing calls this directly

Calls 3

incrementMethod · 0.45
nnzMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected