SVDecompositionCommonsResult implements SVDecompositionResult { @Override public DoubleMatrix1D solve(final DoubleMatrix1D b) { Validate.notNull(b); return CommonsMathWrapper.unwrap(_solver.solve(CommonsMathWrapper.wrap(b))); } SVDecompositionCommonsResult(final SingularValueDecomposition svd); @Override double getConditionNumber(); @Override double getNorm(); @Override int getRank(); @Override DoubleMatrix2D getS(); @Override double[] getSingularValues(); @Override DoubleMatrix2D getU(); @Override DoubleMatrix2D getUT(); @Override DoubleMatrix2D getV(); @Override DoubleMatrix2D getVT(); @Override DoubleMatrix1D solve(final DoubleMatrix1D b); @Override double[] solve(final double[] b); @Override DoubleMatrix2D solve(final DoubleMatrix2D b);  }
@Test(expectedExceptions = IllegalArgumentException.class) public void testNullArray() { SVD.solve((double[]) null); }
@Test(expectedExceptions = IllegalArgumentException.class) public void testNullVector() { SVD.solve((DoubleMatrix1D) null); }
@Test(expectedExceptions = IllegalArgumentException.class) public void testNullMatrix() { SVD.solve((DoubleMatrix2D) null); }
@Test public void testSolvers() { assertTrue(Arrays.equals(RESULT_1D.getData(), SVD.solve(new double[] {0.1, 0.2}))); assertRealVectorEquals(RESULT_1D, SVD.solve(new DoubleMatrix1D(new double[] {0.1, 0.2}))); assertRealMatrixEquals(RESULT_2D, SVD.solve(new DoubleMatrix2D(new double[][] {new double[] {0.1, 0.2}, new double[] {0.1, 0.2}}))); }