Class SteepestDescentMinimizer.SteepestDescentImpl
- java.lang.Object
-
- dev.nm.solver.multivariate.unconstrained.c2.steepestdescent.SteepestDescentMinimizer.SteepestDescentImpl
-
- All Implemented Interfaces:
IterativeMethod<Vector>
,IterativeSolution<Vector>
,MinimizationSolution<Vector>
- Direct Known Subclasses:
GaussNewtonMinimizer.MySteepestDescent.GaussNewtonImpl
,NewtonRaphsonMinimizer.NewtonRaphsonImpl
,PowellMinimizer.PowellImpl
,QuasiNewtonMinimizer.QuasiNewtonImpl
,ZangwillMinimizer.ZangwillImpl
- Enclosing class:
- SteepestDescentMinimizer
protected abstract class SteepestDescentMinimizer.SteepestDescentImpl extends Object implements IterativeSolution<Vector>
This is an implementation of the steepest descent method.
-
-
Field Summary
Fields Modifier and Type Field Description protected LineSearch.Solution
linesearch
protected C2OptimProblem
problem
-
Constructor Summary
Constructors Modifier Constructor Description protected
SteepestDescentImpl(C2OptimProblem problem)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract Vector
getDirection(Vector xk)
Get the next search direction.protected double
getIncrement(Vector xk, Vector dk)
Get the increment fraction, αk.ImmutableVector
minimizer()
Get the minimizer (solution) to the minimization problem.double
minimum()
Get the (approximate) minimum found.Vector
search(Vector... initials)
Search for a solution that optimizes the objective function from the given starting points.void
setInitials(Vector... initials)
Supply the starting points for the search.Vector
step()
Do the next iteration.
-
-
-
Field Detail
-
problem
protected final C2OptimProblem problem
-
linesearch
protected final LineSearch.Solution linesearch
-
-
Constructor Detail
-
SteepestDescentImpl
protected SteepestDescentImpl(C2OptimProblem problem) throws Exception
- Throws:
Exception
-
-
Method Detail
-
getDirection
protected abstract Vector getDirection(Vector xk)
Get the next search direction.- Parameters:
xk
- the current minimizer- Returns:
- the next search direction
-
getIncrement
protected double getIncrement(Vector xk, Vector dk)
Get the increment fraction, αk.- Parameters:
xk
- the current minimizerdk
- the search direction- Returns:
- αk
-
minimum
public double minimum()
Description copied from interface:MinimizationSolution
Get the (approximate) minimum found.- Specified by:
minimum
in interfaceMinimizationSolution<Vector>
- Returns:
- the (approximate) minimum found
-
minimizer
public ImmutableVector minimizer()
Description copied from interface:MinimizationSolution
Get the minimizer (solution) to the minimization problem.- Specified by:
minimizer
in interfaceMinimizationSolution<Vector>
- Returns:
- the minimizer
-
search
public Vector search(Vector... initials) throws Exception
Description copied from interface:IterativeMethod
Search for a solution that optimizes the objective function from the given starting points. This method typically calls first#setInitials(S...)
and then iterativelyIterativeMethod.step()
. It implements a default convergence criterion.- Specified by:
search
in interfaceIterativeMethod<Vector>
- Parameters:
initials
- the initial guesses- Returns:
- an (approximate) optimizer
- Throws:
Exception
- when an error occurs during the search
-
setInitials
public void setInitials(Vector... initials)
Description copied from interface:IterativeMethod
Supply the starting points for the search. This can also initialize the state of the algorithm for a new search.- Specified by:
setInitials
in interfaceIterativeMethod<Vector>
- Parameters:
initials
- the initial guesses
-
step
public Vector step()
Description copied from interface:IterativeMethod
Do the next iteration.- Specified by:
step
in interfaceIterativeMethod<Vector>
- Returns:
- the information about this step
-
-