/src/main/java/net/finmath/functions/LinearAlgebra.java
if( k < 15) {
if ( MatrixUtils.isSymmetric ( matrix, 1E-10 ) ) {
return matrixExp(new Array2DRowRealMatrix(matrix)).getData(); } public static double[][] matrixLog(double[][] matrix) { return matrixLog(new Array2DRowRealMatrix(matrix)).getData(); } private static RealMatrix matrixExp(RealMatrix matrix) { <extra_id_0> EigenDecomposition eigenDecomposition = new EigenDecomposition(matrix); RealMatrix diag = eigenDecomposition.getD(); for(int i=0; i<diag.getRowDimension(); i++) diag.setEntry(i, i, Math.exp(diag.getEntry(i, i))); return eigenDecomposition.getV().multiply(eigenDecomposition.getD()).multiply(eigenDecomposition.getVT()); } else {