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.Solutionlinesearchprotected C2OptimProblemproblem
-
Constructor Summary
Constructors Modifier Constructor Description protectedSteepestDescentImpl(C2OptimProblem problem)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract VectorgetDirection(Vector xk)Get the next search direction.protected doublegetIncrement(Vector xk, Vector dk)Get the increment fraction, αk.ImmutableVectorminimizer()Get the minimizer (solution) to the minimization problem.doubleminimum()Get the (approximate) minimum found.Vectorsearch(Vector... initials)Search for a solution that optimizes the objective function from the given starting points.voidsetInitials(Vector... initials)Supply the starting points for the search.Vectorstep()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:MinimizationSolutionGet the (approximate) minimum found.- Specified by:
minimumin interfaceMinimizationSolution<Vector>- Returns:
- the (approximate) minimum found
-
minimizer
public ImmutableVector minimizer()
Description copied from interface:MinimizationSolutionGet the minimizer (solution) to the minimization problem.- Specified by:
minimizerin interfaceMinimizationSolution<Vector>- Returns:
- the minimizer
-
search
public Vector search(Vector... initials) throws Exception
Description copied from interface:IterativeMethodSearch 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:
searchin 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:IterativeMethodSupply the starting points for the search. This can also initialize the state of the algorithm for a new search.- Specified by:
setInitialsin interfaceIterativeMethod<Vector>- Parameters:
initials- the initial guesses
-
step
public Vector step()
Description copied from interface:IterativeMethodDo the next iteration.- Specified by:
stepin interfaceIterativeMethod<Vector>- Returns:
- the information about this step
-
-