QRDecompositionCommons extends Decomposition<QRDecompositionResult> { @Override public QRDecompositionResult evaluate(final DoubleMatrix2D x) { Validate.notNull(x); final RealMatrix temp = CommonsMathWrapper.wrap(x); final QRDecomposition qr = new QRDecompositionImpl(temp); return new QRDecompositionCommonsResult(qr); }  @Override QRDecompositionResult evaluate(final DoubleMatrix2D x);  }
@Test(expectedExceptions = IllegalArgumentException.class) public void testNullObjectMatrix() { QR.evaluate((DoubleMatrix2D) null); }
@Test public void testRecoverOrginal() { final DecompositionResult result = QR.evaluate(A); assertTrue(result instanceof QRDecompositionResult); final QRDecompositionResult qr = (QRDecompositionResult) result; final DoubleMatrix2D q = qr.getQ(); final DoubleMatrix2D r = qr.getR(); final DoubleMatrix2D a = (DoubleMatrix2D) ALGEBRA.multiply(q, r); checkEquals(A, a); }