/** {@inheritDoc} */ public void setRelativeAccuracy(double accuracy) { optimizer.setRelativeAccuracy(accuracy); }
/** {@inheritDoc} */ public void setConvergenceChecker(RealConvergenceChecker checker) { optimizer.setConvergenceChecker(checker); }
private double weightedResidual(final VectorialPointValuePair pv) { final double[] value = pv.getValueRef(); double sum = 0; for (int i = 0; i < value.length; ++i) { final double ri = value[i] - target[i]; sum += weights[i] * ri * ri; } return sum; } });
/** {@inheritDoc} */ public double optimize(final UnivariateRealFunction f, final GoalType goalType, final double min, final double max, final double startValue) throws ConvergenceException, FunctionEvaluationException { return optimize(f, goalType, min, max); } }
/** {@inheritDoc} */ public void resetAbsoluteAccuracy() { optimizer.resetAbsoluteAccuracy(); }
/** {@inheritDoc} */ public void resetMaximalIterationCount() { optimizer.resetMaximalIterationCount(); }
/** {@inheritDoc} */ public void setAbsoluteAccuracy(double accuracy) { optimizer.setAbsoluteAccuracy(accuracy); }
/** {@inheritDoc} */ public VectorialConvergenceChecker getConvergenceChecker() { return optimizer.getConvergenceChecker(); }
/** {@inheritDoc} */ public RealConvergenceChecker getConvergenceChecker() { return optimizer.getConvergenceChecker(); }
/** {@inheritDoc} */ public void setConvergenceChecker(RealConvergenceChecker checker) { optimizer.setConvergenceChecker(checker); }
/** {@inheritDoc} */ public double getAbsoluteAccuracy() { return optimizer.getAbsoluteAccuracy(); }
/** {@inheritDoc} */ public double getRelativeAccuracy() { return optimizer.getRelativeAccuracy(); }
/** {@inheritDoc} */ public RealConvergenceChecker getConvergenceChecker() { return optimizer.getConvergenceChecker(); }
/** Build a simplex from all its points. * @param vertices array containing all vertices of the simplex */ private void buildSimplex(double[][] vertices) { int n = vertices.length - 1; simplex = new PointCostPair[n + 1]; for (int i = 0; i <= n; ++i) { simplex[i] = new PointCostPair(vertices[i], Double.NaN); } }
/** Evaluate the cost on one point. * <p>A side effect of this method is to count the number of * function evaluations</p> * @param x point on which the cost function should be evaluated * @return cost at the given point * @exception CostException if no cost can be computed for the parameters */ protected double evaluateCost(double[] x) throws CostException { evaluations++; return f.cost(x); }
private double weightedResidual(final VectorialPointValuePair pv) { final double[] value = pv.getValueRef(); double sum = 0; for (int i = 0; i < value.length; ++i) { final double ri = value[i] - target[i]; sum += weights[i] * ri * ri; } return sum; } });
/** {@inheritDoc} */ public double optimize(final UnivariateRealFunction f, final GoalType goalType, final double min, final double max, final double startValue) throws ConvergenceException, FunctionEvaluationException { return optimize(f, goalType, min, max); }
/** {@inheritDoc} */ public void resetAbsoluteAccuracy() { optimizer.resetAbsoluteAccuracy(); }
/** {@inheritDoc} */ public void resetMaximalIterationCount() { optimizer.resetMaximalIterationCount(); }