Test of eye method, of class Matrix.
()
| 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. |