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

Method testEye

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

Test of eye method, of class Matrix.

()

Source from the content-addressed store, hash-verified

109 * Test of eye method, of class Matrix.
110 */
111 @Test
112 public void testEye()
113 {
114 System.out.println("eye");
115
116 for(int k = 1; k < 10; k++)
117 {
118 Matrix I = Matrix.eye(k);
119 for(int i = 0; i < I.rows(); i++)
120 for(int j = 0; j < I.cols(); j++)
121 if(i == j)
122 assertEquals(1.0, I.get(i, j), 0.0);
123 else
124 assertEquals(0.0, I.get(i, j), 0.0);
125 }
126 }
127
128 /**
129 * Test of random method, of class Matrix.

Callers

nothing calls this directly

Calls 4

eyeMethod · 0.95
rowsMethod · 0.95
colsMethod · 0.95
getMethod · 0.95

Tested by

no test coverage detected