final Pair<YieldCurveBundle, Double[]> unitCal = makeUnit(instrumentsUnit, parametersGuess[loopunit], gen, knownSoFarData, calculator, sensitivityCalculator);
parametersSoFar.addAll(Arrays.asList(unitCal.getSecond()));
final DoubleMatrix2D[] mat = makeCurveMatrix(instrumentsSoFarArray, generatorsSoFar, startUnit, nbIns, parametersSoFar.toArray(new Double[parametersSoFar.size()]),
knownData, sensitivityCalculator);
for (int loopcurve = 0; loopcurve < curveGenerators[loopunit].length; loopcurve++) {
unitBundleSoFar.put(curveNames[loopunit][loopcurve], new ObjectsPair<>(new CurveBuildingBlock(unitMap), mat[loopcurve]));
}
knownSoFarData.addAll(unitCal.getFirst());
startUnit = startUnit + nbInsUnit;
}
return new ObjectsPair<>(knownSoFarData, new CurveBuildingBlockBundle(unitBundleSoFar));