Adding liborCap and interpolationMethod to clone()
@@ -1570,18 +1570,6 @@ public class LIBORMarketModelFromCovarianceModel extends AbstractProcessModel im
return integratedLIBORCovariance;
}
- @Override
- public Object clone() {
- try {
- Map<String, Object> properties = new HashMap<>();
- properties.put("measure", measure.name());
- properties.put("stateSpace", stateSpace.name());
- return new LIBORMarketModelFromCovarianceModel(getLiborPeriodDiscretization(), getAnalyticModel(), getForwardRateCurve(), getDiscountCurve(), randomVariableFactory, covarianceModel, new CalibrationProduct[0], properties);
- } catch (CalculationException e) {
- return null;
- }
- }
-
@Override
public AnalyticModel getAnalyticModel() {
return curveModel;
@@ -1611,6 +1599,20 @@ public class LIBORMarketModelFromCovarianceModel extends AbstractProcessModel im
return covarianceModel;
}
+ @Override
+ public Object clone() {
+ try {
+ Map<String, Object> properties = new HashMap<>();
+ properties.put("measure", measure.name());
+ properties.put("stateSpace", stateSpace.name());
+ properties.put("interpolationMethod", interpolationMethod.name());
+ properties.put("liborCap", liborCap);
+ return LIBORMarketModelFromCovarianceModel.of(getLiborPeriodDiscretization(), getAnalyticModel(), getForwardRateCurve(), getDiscountCurve(), randomVariableFactory, covarianceModel, null, properties);
+ } catch (CalculationException e) {
+ return null;
+ }
+ }
+
/**
* @param covarianceModel A covariance model
* @return A new <code>LIBORMarketModelFromCovarianceModel</code> using the specified covariance model.
