*/
protected void updateResidualsAndCost()
throws FunctionEvaluationException {
if (++objectiveEvaluations > maxEvaluations) {
throw new FunctionEvaluationException(new MaxEvaluationsExceededException(maxEvaluations),
point);
}
objective = f.value(point);
if (objective.length != rows) {
throw new FunctionEvaluationException(point, "dimension mismatch {0} != {1}",
objective.length, rows);
}
cost = 0;
for (int i = 0, index = 0; i < rows; i++, index += cols) {
final double residual = target[i] - objective[i];