LUDecompositionCommonsResult implements LUDecompositionResult { @Override public DoubleMatrix1D solve(final DoubleMatrix1D b) { Validate.notNull(b); return CommonsMathWrapper.unwrap(_solver.solve(CommonsMathWrapper.wrap(b))); } LUDecompositionCommonsResult(final LUDecomposition lu); @Override double getDeterminant(); @Override DoubleMatrix2D getL(); @Override DoubleMatrix2D getP(); @Override int[] getPivot(); @Override DoubleMatrix2D getU(); @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() { LU.solve((double[]) null); }
@Test(expectedExceptions = IllegalArgumentException.class) public void testNullVector() { LU.solve((DoubleMatrix1D) null); }
@Test(expectedExceptions = IllegalArgumentException.class) public void testNullMatrix() { LU.solve((DoubleMatrix2D) null); }
@Test public void testSolvers() { assertTrue(Arrays.equals(RESULT_1D.getData(), LU.solve(RESULT_1D.getData()))); assertTrue(Arrays.equals(RESULT_1D.getData(), LU.solve(new DoubleMatrix1D(RESULT_1D.getData())).getData())); assertRealMatrixEquals(RESULT_2D, LU.solve(new DoubleMatrix2D(RESULT_2D.getData()))); }