public class BFGS extends Object implements Optimizer2
n
dimensional problems it requires
O(n2) work per iteration and uses first order information
to approximate the Hessian.Constructor and Description |
---|
BFGS()
Creates a new BFGS optimization object that uses a maximum of 250
iterations and a
backtracking line
search. |
BFGS(int maxIterations,
LineSearch lineSearch)
Creates a new BFGS optimization object
|
Modifier and Type | Method and Description |
---|---|
Optimizer2 |
clone() |
LineSearch |
getLineSearch()
Returns the line search method used at each iteration
|
int |
getMaximumIterations()
Returns the maximum number of iterations to perform
|
boolean |
isInftNormCriterion()
Returns whether or not the infinity norm (
true ) or 2 norm
(false ) is used to determine convergence. |
void |
optimize(double tolerance,
Vec w,
Vec x0,
Function f,
FunctionVec fp,
FunctionVec fpp)
Attempts to optimize the given function by finding the value of
w
that will minimize the value returned by f(w) , using
w = x0 as an initial starting point. |
void |
optimize(double tolerance,
Vec w,
Vec x0,
Function f,
FunctionVec fp,
FunctionVec fpp,
ExecutorService ex)
Attempts to optimize the given function by finding the value of
w
that will minimize the value returned by f(w) , using
w = x0 as an initial starting point. |
void |
setInftNormCriterion(boolean inftNormCriterion)
By default the infinity norm is used to judge convergence.
|
void |
setLineSearch(LineSearch lineSearch)
Sets the line search method used at each iteration
|
void |
setMaximumIterations(int iterations)
Sets the maximum number of iterations allowed for the optimization method
|
public BFGS()
backtracking
line
search.public BFGS(int maxIterations, LineSearch lineSearch)
maxIterations
- the maximum number of iterations to allow before
stoppinglineSearch
- the line search method to use on updatespublic void optimize(double tolerance, Vec w, Vec x0, Function f, FunctionVec fp, FunctionVec fpp)
Optimizer2
w
that will minimize the value returned by f(w)
, using
w = x0 as an initial starting point.optimize
in interface Optimizer2
tolerance
- the value that the gradient norm must be less than to
consider convergedw
- the the location to store the final solutionx0
- the initial guess for the solution. This value will not be
changed, and intermediate matrices will be created as the same type.f
- the objective function to minimizerfp
- the derivative of the objective function, may be null
depending on the optimizerfpp
- the Hessian of the objective function, may be null
depending on the optimizerpublic void optimize(double tolerance, Vec w, Vec x0, Function f, FunctionVec fp, FunctionVec fpp, ExecutorService ex)
Optimizer2
w
that will minimize the value returned by f(w)
, using
w = x0 as an initial starting point.optimize
in interface Optimizer2
tolerance
- the value that the gradient norm must be less than to
consider convergedw
- the the location to store the final solutionx0
- the initial guess for the solution. This value will not be
changed, and intermediate matrices will be created as the same type.f
- the objective function to minimizerfp
- the derivative of the objective function, may be null
depending on the optimizerfpp
- the Hessian of the objective function, may be null
depending on the optimizerex
- the source of threads for parallel computation, may be
null
to perform serial computation.public void setInftNormCriterion(boolean inftNormCriterion)
false
, the 2 norm will be used instead.inftNormCriterion
- public boolean isInftNormCriterion()
true
) or 2 norm
(false
) is used to determine convergence.true
if the infinity norm is in use, false
for
the 2 normpublic void setMaximumIterations(int iterations)
Optimizer2
setMaximumIterations
in interface Optimizer2
iterations
- the maximum number of iterations to performpublic int getMaximumIterations()
Optimizer2
getMaximumIterations
in interface Optimizer2
public void setLineSearch(LineSearch lineSearch)
lineSearch
- the line search method used at each iterationpublic LineSearch getLineSearch()
public Optimizer2 clone()
clone
in interface Optimizer2
clone
in class Object
Copyright © 2017. All rights reserved.