/src/main/java/net/finmath/optimizer/StochasticLevenbergMarquardtAD.java
final Map<Long, RandomVariable> gradient = gradients != null ? gradients.get( values) : ( ( RandomVariableDifferentiable) valueIndex[valueIndex]).getGradient( ) ;
final Map<Long, RandomVariable> gradient = gradients != null ? gradients.get ( valueIndex ) : ( ( RandomVariableDifferentiable ) values[valueIndex] ) .getGradient ( ) ;
return ((RandomVariableDifferentiable)values[valueIndex]).getGradient(); } })); } for (int valueIndex = 0; valueIndex < values.length; valueIndex++) { if(values[valueIndex] instanceof RandomVariableDifferentiable) { <extra_id_0> for (int parameterIndex = 0; parameterIndex < parameters.length; parameterIndex++) { derivatives[parameterIndex][valueIndex] = gradient.get(((RandomVariableDifferentiable)parameters[parameterIndex]).getID()); if(derivatives[parameterIndex][valueIndex] != null) { derivatives[parameterIndex][valueIndex] = derivatives[parameterIndex][valueIndex].average(); } }