Added a way to retrieve the limited the number of functions evaluations in optimizers

(the limited number of iterations could already be retrieved)

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/math/trunk@779284 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Luc Maisonobe 2009-05-27 19:47:27 +00:00
parent 4a97160c1f
commit 525418ab1c
2 changed files with 17 additions and 7 deletions

View File

@ -37,16 +37,21 @@ public interface MultivariateRealOptimizer {
*/ */
void setMaxIterations(int maxIterations); void setMaxIterations(int maxIterations);
/** Set the maximal number of evaluations of the algorithm.
* @param maxEvaluations maximal number of function calls
*/
void setMaxEvaluations(int maxEvaluations);
/** Get the maximal number of iterations of the algorithm. /** Get the maximal number of iterations of the algorithm.
* @return maximal number of iterations * @return maximal number of iterations
*/ */
int getMaxIterations(); int getMaxIterations();
/** Set the maximal number of functions evaluations.
* @param maxEvaluations maximal number of function evaluations
*/
void setMaxEvaluations(int maxEvaluations);
/** Get the maximal number of functions evaluations.
* @return maximal number of functions evaluations
*/
int getMaxEvaluations();
/** Get the number of iterations realized by the algorithm. /** Get the number of iterations realized by the algorithm.
* <p> * <p>
* The number of evaluations corresponds to the last call to the * The number of evaluations corresponds to the last call to the

View File

@ -226,14 +226,19 @@ public abstract class DirectSearchOptimizer implements MultivariateRealOptimizer
this.maxIterations = maxIterations; this.maxIterations = maxIterations;
} }
/** {@inheritDoc} */
public int getMaxIterations() {
return maxIterations;
}
/** {@inheritDoc} */ /** {@inheritDoc} */
public void setMaxEvaluations(int maxEvaluations) { public void setMaxEvaluations(int maxEvaluations) {
this.maxEvaluations = maxEvaluations; this.maxEvaluations = maxEvaluations;
} }
/** {@inheritDoc} */ /** {@inheritDoc} */
public int getMaxIterations() { public int getMaxEvaluations() {
return maxIterations; return maxEvaluations;
} }
/** {@inheritDoc} */ /** {@inheritDoc} */