# SuanShu, a Java numerical and statistical library

com.numericalmethod.suanshu.optimization.univariate

## Class GridSearchMinimizer

• java.lang.Object
• com.numericalmethod.suanshu.optimization.univariate.GridSearchMinimizer
• ### Nested Class Summary

Nested Classes
Modifier and Type Class and Description
class  GridSearchMinimizer.Solution
This is the solution to the GridSearchMinimizer.
• ### Field Summary

Fields
Modifier and Type Field and Description
protected double epsilon
a precision parameter: when a number |x| ≤ ε, it is considered 0
protected int maxIterations
the maximum number of iterations
• ### Constructor Summary

Constructors
Constructor and Description
GridSearchMinimizer(double epsilon, int maxIterations)
Construct a univariate minimizer using the grid search method.
• ### Method Summary

All Methods
Modifier and Type Method and Description
GridSearchMinimizer.Solution solve(C2OptimProblem problem)
Solve an optimization problem, e.g., OptimProblem.
GridSearchMinimizer.Solution solve(UnivariateRealFunction f)
Minimize a univariate function.
• ### Methods inherited from class java.lang.Object

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
• ### Field Detail

• #### epsilon

protected final double epsilon
a precision parameter: when a number |x| ≤ ε, it is considered 0
• #### maxIterations

protected final int maxIterations
the maximum number of iterations
• ### Constructor Detail

• #### GridSearchMinimizer

public GridSearchMinimizer(double epsilon,
int maxIterations)
Construct a univariate minimizer using the grid search method.
Parameters:
epsilon - a precision parameter: when a number |x| ≤ ε, it is considered 0
maxIterations - the maximum number of iterations
• ### Method Detail

• #### solve

public GridSearchMinimizer.Solution solve(C2OptimProblem problem)
Description copied from interface: Optimizer
Solve an optimization problem, e.g., OptimProblem.
Specified by:
solve in interface Optimizer<C2OptimProblem,UnivariateMinimizer.Solution>
Parameters:
problem - an optimization problem
Returns:
a solution to the optimization problem
• #### solve

public GridSearchMinimizer.Solution solve(UnivariateRealFunction f)
Minimize a univariate function.
Parameters:
f - the objective function
Returns:
the minimizer