Unused parameters.

This commit is contained in:
Gilles Sadowski 2021-07-14 13:32:39 +02:00
parent 286ff6ad39
commit 344fb6dedd
1 changed files with 8 additions and 18 deletions

View File

@ -64,18 +64,14 @@ public class MultiDirectionalTransform
final PointValuePair best = original.get(0); final PointValuePair best = original.get(0);
// Perform a reflection step. // Perform a reflection step.
final Simplex reflectedSimplex = transform(evaluationFunction, final Simplex reflectedSimplex = transform(original,
original, 1);
1,
comparator);
final PointValuePair reflectedBest = reflectedSimplex.get(0); final PointValuePair reflectedBest = reflectedSimplex.get(0);
if (comparator.compare(reflectedBest, best) < 0) { if (comparator.compare(reflectedBest, best) < 0) {
// Compute the expanded simplex. // Compute the expanded simplex.
final Simplex expandedSimplex = transform(evaluationFunction, final Simplex expandedSimplex = transform(original,
original, gamma);
gamma,
comparator);
final PointValuePair expandedBest = expandedSimplex.get(0); final PointValuePair expandedBest = expandedSimplex.get(0);
return comparator.compare(reflectedBest, expandedBest) <= 0 ? return comparator.compare(reflectedBest, expandedBest) <= 0 ?
@ -83,10 +79,8 @@ public class MultiDirectionalTransform
expandedSimplex; expandedSimplex;
} else { } else {
// Compute the contracted simplex. // Compute the contracted simplex.
return transform(evaluationFunction, return transform(original,
original, rho);
rho,
comparator);
} }
}; };
} }
@ -94,18 +88,14 @@ public class MultiDirectionalTransform
/** /**
* Computes and evaluates a new simplex. * Computes and evaluates a new simplex.
* *
* @param evaluationFunction Evaluation function.
* @param original Original simplex. * @param original Original simplex.
* @param coeff Linear coefficient. * @param coeff Linear coefficient.
* @param comparator Comparator for sorting vertices from best to worst.
* @return the transformed simplex. * @return the transformed simplex.
* @throws org.apache.commons.math4.legacy.exception.TooManyEvaluationsException * @throws org.apache.commons.math4.legacy.exception.TooManyEvaluationsException
* if the maximal number of evaluations is exceeded. * if the maximal number of evaluations is exceeded.
*/ */
private Simplex transform(MultivariateFunction evaluationFunction, private Simplex transform(Simplex original,
Simplex original, double coeff) {
double coeff,
Comparator<PointValuePair> comparator) {
// Transformed simplex is the result a linear transformation on all // Transformed simplex is the result a linear transformation on all
// points except the first one. // points except the first one.
final int dim = original.getDimension(); final int dim = original.getDimension();