/** {@inheritDoc} */ public double value(double x) throws FunctionEvaluationException { // current point in the search direction final double[] shiftedPoint = point.clone(); for (int i = 0; i < shiftedPoint.length; ++i) { shiftedPoint[i] += x * searchDirection[i]; } // gradient of the objective function final double[] gradient; gradient = computeObjectiveGradient(shiftedPoint); // dot product with the search direction double dotProduct = 0; for (int i = 0; i < gradient.length; ++i) { dotProduct += gradient[i] * searchDirection[i]; } return dotProduct; }
double[] r = computeObjectiveGradient(point); if (goal == GoalType.MINIMIZE) { for (int i = 0; i < n; ++i) { while (true) { final double objective = computeObjectiveValue(point); RealPointValuePair previous = current; current = new RealPointValuePair(point, objective); if (previous != null) { if (checker.converged(getIterations(), previous, current)) { incrementIterationsCounter(); final double step = solver.solve(lsf, 0, findUpperBound(lsf, 0, initialStep)); point[i] += step * searchDirection[i]; r = computeObjectiveGradient(point); if (goal == GoalType.MINIMIZE) { for (int i = 0; i < n; ++i) { if ((getIterations() % n == 0) || (beta < 0)) {
double[] r = computeObjectiveGradient(point); if (goal == GoalType.MINIMIZE) { for (int i = 0; i < n; ++i) { while (true) { final double objective = computeObjectiveValue(point); RealPointValuePair previous = current; current = new RealPointValuePair(point, objective); if (previous != null) { if (checker.converged(getIterations(), previous, current)) { incrementIterationsCounter(); final double step = solver.solve(lsf, 0, findUpperBound(lsf, 0, initialStep)); point[i] += step * searchDirection[i]; r = computeObjectiveGradient(point); if (goal == GoalType.MINIMIZE) { for (int i = 0; i < n; ++i) { if ((getIterations() % n == 0) || (beta < 0)) {
/** {@inheritDoc} */ public double value(double x) throws FunctionEvaluationException { // current point in the search direction final double[] shiftedPoint = point.clone(); for (int i = 0; i < shiftedPoint.length; ++i) { shiftedPoint[i] += x * searchDirection[i]; } // gradient of the objective function final double[] gradient = computeObjectiveGradient(shiftedPoint); // dot product with the search direction double dotProduct = 0; for (int i = 0; i < gradient.length; ++i) { dotProduct += gradient[i] * searchDirection[i]; } return dotProduct; }