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

Method testPascal

JSAT/test/jsat/linear/MatrixTest.java:270–287  ·  view source on GitHub ↗

Test of pascal method, of class Matrix.

()

Source from the content-addressed store, hash-verified

268 * Test of pascal method, of class Matrix.
269 */
270 @Test
271 public void testPascal()
272 {
273 System.out.println("pascal");
274
275 Matrix P = Matrix.pascal(6);
276
277 for(int i = 0; i < P.rows(); i++)
278 {
279 assertEquals(1.0, P.get(i, 0), 0.0);
280 assertEquals(1.0, P.get(0, i), 0.0);
281 }
282
283 for(int i = 1; i < P.rows(); i++)
284 for(int j = 1; j < P.cols(); j++)
285 assertEquals(P.get(i-1, j)+P.get(i, j-1), P.get(i, j), 0.0);
286
287 }
288
289}

Callers

nothing calls this directly

Calls 4

pascalMethod · 0.95
rowsMethod · 0.95
getMethod · 0.95
colsMethod · 0.95

Tested by

no test coverage detected