/src/main/java/net/finmath/functions/LinearAlgebra.java
final DecompositionSolver solver = new LUDecomposition( new Array2DRowRealMatrix( matrix) ).getSolver( ) ;final DecompositionSolver solver = new SingularValueDecomposition( new Array2DRowRealMatrix( matrix, false) ).getSolver( ) ;
final DecompositionSolver solver = new SingularValueDecomposition ( new Array2DRowRealMatrix ( matrix, false ) ) .getSolver ( ) ;
cern.colt.matrix.linalg.Algebra linearAlgebra = new cern.colt.matrix.linalg.Algebra(); double[] x = linearAlgebra.solve(new DenseDoubleMatrix2D(A), linearAlgebra.transpose(new DenseDoubleMatrix2D(new double[][] { b }))).viewColumn(0).toArray(); return x; } } public static double[] solveLinearEquationLeastSquare(final double[][] matrix, final double[] vector) { <extra_id_0> return solver.solve(new ArrayRealVector(vector)).toArray(); } public static double[][] solveLinearEquationLeastSquare(final double[][] matrix, final double[][] rhs) { final DecompositionSolver solver = new SingularValueDecomposition(new Array2DRowRealMatrix(matrix, false)).getSolver(); return solver.solve(new Array2DRowRealMatrix(rhs)).getData(); }