Class LeastSquaresAdapter
- java.lang.Object
-
- org.apache.commons.math4.legacy.fitting.leastsquares.LeastSquaresAdapter
-
- All Implemented Interfaces:
LeastSquaresProblem,OptimizationProblem<LeastSquaresProblem.Evaluation>
public class LeastSquaresAdapter extends Object implements LeastSquaresProblem
An adapter that delegates to another implementation ofLeastSquaresProblem.- Since:
- 3.3
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.apache.commons.math4.legacy.fitting.leastsquares.LeastSquaresProblem
LeastSquaresProblem.Evaluation
-
-
Constructor Summary
Constructors Constructor Description LeastSquaresAdapter(LeastSquaresProblem problem)Delegate theLeastSquaresProbleminterface to the given implementation.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description LeastSquaresProblem.Evaluationevaluate(RealVector point)Evaluate the model at the specified point.ConvergenceChecker<LeastSquaresProblem.Evaluation>getConvergenceChecker()Gets the convergence checker.IntegerSequence.IncrementorgetEvaluationCounter()Get a independent Incrementor that counts up to the maximum number of evaluations and then throws an exception.IntegerSequence.IncrementorgetIterationCounter()Get a independent Incrementor that counts up to the maximum number of iterations and then throws an exception.intgetObservationSize()Get the number of observations (rows in the Jacobian) in this problem.intgetParameterSize()Get the number of parameters (columns in the Jacobian) in this problem.RealVectorgetStart()Gets the initial guess.
-
-
-
Constructor Detail
-
LeastSquaresAdapter
public LeastSquaresAdapter(LeastSquaresProblem problem)
Delegate theLeastSquaresProbleminterface to the given implementation.- Parameters:
problem- the delegate
-
-
Method Detail
-
getStart
public RealVector getStart()
Gets the initial guess.- Specified by:
getStartin interfaceLeastSquaresProblem- Returns:
- the initial guess values.
-
getObservationSize
public int getObservationSize()
Get the number of observations (rows in the Jacobian) in this problem.- Specified by:
getObservationSizein interfaceLeastSquaresProblem- Returns:
- the number of scalar observations
-
getParameterSize
public int getParameterSize()
Get the number of parameters (columns in the Jacobian) in this problem.- Specified by:
getParameterSizein interfaceLeastSquaresProblem- Returns:
- the number of scalar parameters
-
evaluate
public LeastSquaresProblem.Evaluation evaluate(RealVector point)
Evaluate the model at the specified point.- Specified by:
evaluatein interfaceLeastSquaresProblem- Parameters:
point- the parameter values.- Returns:
- the model's value and derivative at the given point.
-
getEvaluationCounter
public IntegerSequence.Incrementor getEvaluationCounter()
Get a independent Incrementor that counts up to the maximum number of evaluations and then throws an exception.- Specified by:
getEvaluationCounterin interfaceOptimizationProblem<LeastSquaresProblem.Evaluation>- Returns:
- a counter for the evaluations.
-
getIterationCounter
public IntegerSequence.Incrementor getIterationCounter()
Get a independent Incrementor that counts up to the maximum number of iterations and then throws an exception.- Specified by:
getIterationCounterin interfaceOptimizationProblem<LeastSquaresProblem.Evaluation>- Returns:
- a counter for the evaluations.
-
getConvergenceChecker
public ConvergenceChecker<LeastSquaresProblem.Evaluation> getConvergenceChecker()
Gets the convergence checker.- Specified by:
getConvergenceCheckerin interfaceOptimizationProblem<LeastSquaresProblem.Evaluation>- Returns:
- the object used to check for convergence.
-
-