use of org.ojalgo.matrix.task.SolverTask in project ojAlgo by optimatika.
the class DesignCase method testSolveIdentity.
@Test
public void testSolveIdentity() {
final Access2D<?> tmpIdentity = MatrixStore.PRIMITIVE.makeIdentity(9).get();
final Access2D<?> tmpRandom = PrimitiveDenseStore.FACTORY.makeFilled(9, 1, new Uniform());
final List<MatrixDecomposition<Double>> tmpAllDecomps = MatrixDecompositionTests.getAllPrimitive();
for (final MatrixDecomposition<Double> tmpDecomp : tmpAllDecomps) {
if (tmpDecomp instanceof SolverTask) {
final SolverTask<Double> tmpSolverTask = (SolverTask<Double>) tmpDecomp;
try {
TestUtils.assertEquals(tmpDecomp.getClass().toString(), tmpRandom, tmpSolverTask.solve(tmpIdentity, tmpRandom));
} catch (final RecoverableCondition xcptn) {
TestUtils.fail(tmpDecomp.getClass().toString() + " " + xcptn.getMessage());
}
}
}
}
Aggregations