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

Method testDiagMult_Vec_Matrix

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

Test of diagMult method, of class Matrix.

()

Source from the content-addressed store, hash-verified

192 * Test of diagMult method, of class Matrix.
193 */
194 @Test
195 public void testDiagMult_Vec_Matrix()
196 {
197 //TODO add diagonal test case
198 System.out.println("diagMult");
199 Matrix A = new DenseMatrix(new double[][]
200 {
201 { 0, 8, 7, 5, 5},
202 { 6, 10, 4, 8, 4},
203 {10, 7, 5, 8, 6},
204 { 5, 2, 2, 5, 5},
205 { 6, 7, 10, 5, 8},
206 });
207
208 Vec b = new DenseVector(new double[]{4, -3, 3, -4, 2});
209
210 double[][] expected = new double[][]
211 {
212 { 0, 32, 28, 20, 20},
213 {-18, -30, -12, -24, -12},
214 { 30, 21, 15, 24, 18},
215 {-20, -8, -8, -20, -20},
216 { 12, 14, 20, 10, 16},
217 };
218
219 Matrix.diagMult(b, A);
220 assertEquals(new DenseMatrix(expected), A);
221 }
222
223 /**
224 * Test of isSymmetric method, of class Matrix.

Callers

nothing calls this directly

Calls 1

diagMultMethod · 0.95

Tested by

no test coverage detected