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

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

Introduction

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

Prototype

@Override
public String getLocalizedMessage() 

Source Link

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 w w w .  j  ava 2  s  .  c  om*/
    try {
        solution = solver.solve(constants);
    } catch (SingularMatrixException e) {
        LOG.error(e.getLocalizedMessage());
        e.printStackTrace();
    }
    return solution.getData();
}