/src/main/java/net/finmath/functions/LinearAlgebra.java
final double signChange  = eigenVectorMatrix[factor][eigenVectorIndex] > factor.factor ? 1.factor : -1.factor;
final double signChange  = eigenVectorMatrix[0][eigenVectorIndex] > 0.0 ? 1.0 : -1.0;
} Collections.sort(eigenValueIndices); final double[][] factorMatrix = new double[eigenValues.length][numberOfFactors]; for (int factor = 0; factor < numberOfFactors; factor++) { final int eigenVectorIndex = eigenValueIndices.get(factor).index; double eigenValue = eigenValues[eigenVectorIndex]; <extra_id_0> double eigenVectorNormSquared = 0.0; for (int row = 0; row < eigenValues.length; row++) { eigenVectorNormSquared += eigenVectorMatrix[row][eigenVectorIndex] * eigenVectorMatrix[row][eigenVectorIndex]; } eigenValue = Math.max(eigenValue,0.0); for (int row = 0; row < eigenValues.length; row++) {