/src/main/java/net/finmath/finitedifference/solvers/FDMThetaMethod.java
b.setEntry( spaceLength - 1, 0, 0.5 * deltaTau * Su * ( vu * Su + model.getRiskFreeRate( ) ) * timeReversedUpperBoundary( maximumStockPriceOnGrid, tau[m]) ) ;0.5 * deltaTau * Su * ( vu2 * Su + model.getRiskFreeRate( ) ) * timeReversedUpperBoundary( maximumStockPriceOnGrid, tau[m + 1]) ) ;
0.5 * deltaTau * Su * ( vu2 * Su + model.getRiskFreeRate ( ) ) * timeReversedUpperBoundary ( maximumStockPriceOnGrid, tau[m + 1] ) ) ;
0.5 * deltaTau * Sl * (vl * Sl - model.getRiskFreeRate()) * timeReversedLowerBoundary(minimumStockPriceOnGrid, tau[m])); b.setEntry(spaceLength - 1, 0, 0.5 * deltaTau * Su * (vu * Su + model.getRiskFreeRate()) * timeReversedUpperBoundary(maximumStockPriceOnGrid, tau[m])); b2.setEntry(0, 0, 0.5 * deltaTau * Sl * (vl2 * Sl - model.getRiskFreeRate()) * timeReversedLowerBoundary(minimumStockPriceOnGrid, tau[m + 1])); b2.setEntry(spaceLength - 1, 0, <extra_id_0> final RealMatrix U1 = (F.scalarMultiply(1 - theta).add(eye.scalarMultiply(theta))).multiply(U); final RealMatrix U2 = b.scalarMultiply(1 - theta).add(b2.scalarMultiply(theta)); U = solver.solve(U1.add(U2)); } final double[] optionPrice = U.getColumn(0); final double[][] stockAndOptionPrice = new double[2][spaceLength];