Example usage for org.apache.commons.math.linear SingularMatrixException printStackTrace

List of usage examples for org.apache.commons.math.linear SingularMatrixException printStackTrace

Introduction

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

Prototype

@Override
public void printStackTrace() 

Source Link

Document

Prints the stack trace of this exception to the standard error stream.

Usage

From source file:org.deegree.geometry.linearization.CurveLinearizer.java

private double[] solveLinearEquation(double[][] matrixA, double[] vectorb) {

    RealMatrix coefficients = new Array2DRowRealMatrix(matrixA, false);

    // LU-decomposition
    DecompositionSolver solver = new LUDecompositionImpl(coefficients).getSolver();

    RealVector constants = new ArrayRealVector(vectorb, false);
    RealVector solution = null;/*from  ww w.jav a  2 s  .  c  o  m*/
    try {
        solution = solver.solve(constants);
    } catch (SingularMatrixException e) {
        LOG.error(e.getLocalizedMessage());
        e.printStackTrace();
    }
    return solution.getData();
}