Example usage for org.apache.commons.math.linear QRDecomposition getSolver

List of usage examples for org.apache.commons.math.linear QRDecomposition getSolver

Introduction

In this page you can find the example usage for org.apache.commons.math.linear QRDecomposition getSolver.

Prototype

DecompositionSolver getSolver();

Source Link

Document

Get a solver for finding the A × X = B solution in least square sense.

Usage

From source file:com.opengamma.analytics.math.linearalgebra.QRDecompositionCommonsResult.java

/**
 * @param qr The result of the QR decomposition, not null
 *//*  www  .j ava 2  s  .c  o  m*/
public QRDecompositionCommonsResult(final QRDecomposition qr) {
    Validate.notNull(qr);
    _h = CommonsMathWrapper.unwrap(qr.getH());
    _q = CommonsMathWrapper.unwrap(qr.getQ());
    _r = CommonsMathWrapper.unwrap(qr.getR());
    _qTranspose = DoubleMatrixUtils.getTranspose(_q);
    _solver = qr.getSolver();
}

From source file:playground.mmoyo.taste_variations.MyLeastSquareSolutionCalculator.java

private double[] getQRDsolution(final RealMatrix matrixA, final double[] arrayB) {
    QRDecomposition qrd = new QRDecompositionImpl(matrixA);
    DecompositionSolver qrSolver = qrd.getSolver();
    double[] arrayX = qrSolver.solve(arrayB);
    return arrayX;
}