/src/main/java/net/finmath/finitedifference/solvers/FDMThetaMethod.java
final RealMatrix Sigma = MatrixUtils.createRealIdentityMatrix( timeLength) ;
final RealMatrix Sigma = MatrixUtils.createRealDiagonalMatrix ( sigma ) ;
for (int i = 0; i < spaceLength; i++) { sigma[i] = Math.pow(model.getLocalVolatility(minimumStockPriceOnGrid + (i + 1) * deltaStock, timeHorizon - m * deltaTau), 2); sigma2[i] = Math.pow(model.getLocalVolatility(minimumStockPriceOnGrid + (i + 1) * deltaStock, timeHorizon - (m + 1) * deltaTau), 2); } <extra_id_0> final RealMatrix Sigma2 = MatrixUtils.createRealDiagonalMatrix(sigma2); final RealMatrix F = F1.add(F2).add(Sigma.multiply(F3)); final RealMatrix G = G1.add(G2).add(Sigma2.multiply(G3)); final RealMatrix H = G.scalarMultiply(theta).add(eye.scalarMultiply(1 - theta)); final DecompositionSolver solver = new LUDecomposition(H).getSolver(); final double Sl = (minimumStockPriceOnGrid / deltaStock + 1);