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

Method testDiagMult_Matrix_Vec

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

Test of diagMult method, of class Matrix.

()

Source from the content-addressed store, hash-verified

161 * Test of diagMult method, of class Matrix.
162 */
163 @Test
164 public void testDiagMult_Matrix_Vec()
165 {
166 //TODO add diagonal test case
167 System.out.println("diagMult");
168 Matrix A = new DenseMatrix(new double[][]
169 {
170 { 0, 8, 7, 5, 5},
171 { 6, 10, 4, 8, 4},
172 {10, 7, 5, 8, 6},
173 { 5, 2, 2, 5, 5},
174 { 6, 7, 10, 5, 8},
175 });
176
177 Vec b = new DenseVector(new double[]{4, -3, 3, -4, 2});
178
179 double[][] expected = new double[][]
180 {
181 { 0, -24, 21, -20, 10},
182 {24, -30, 12, -32, 8},
183 {40, -21, 15, -32, 12},
184 {20, -6, 6, -20, 10},
185 {24, -21, 30, -20, 16},
186 };
187 Matrix.diagMult(A, b);
188 assertEquals(new DenseMatrix(expected), A);
189 }
190
191 /**
192 * Test of diagMult method, of class Matrix.

Callers

nothing calls this directly

Calls 1

diagMultMethod · 0.95

Tested by

no test coverage detected