Package xal.extension.fit.lsm
Class SolverLM
java.lang.Object
xal.extension.fit.lsm.SolverLM
- All Implemented Interfaces:
FitSolver
The Levenberg-Marquardt fitting solver.
- Author:
- shishlo
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionint
Description of the Methoddouble
Gets the lambdaFactor attribute of the SolverLM objectdouble
Gets the lambdaIni attribute of the SolverLM objectdouble
Gets the lambdaMax attribute of the SolverLM objectdouble
getToll()
Gets the toll attribute of the SolverLM objectstatic void
MAIN for debuggingvoid
setIterLimit
(int totalIterLimit) Sets the iterLimit attribute of the SolverLM objectvoid
setLambdaFactor
(double factor) Sets the lambdaFactor attribute of the SolverLM objectvoid
setLambdaIni
(double lambdaIni) Sets the lambdaIni attribute of the SolverLM objectvoid
setLambdaMax
(double lambdaMax) Sets the lambdaMax attribute of the SolverLM objectvoid
setToll
(double epsToll) Sets the toll attribute of the SolverLM objectboolean
solve
(DataStore ds, ModelFunction mf, double[] iniArr, double[] errIniArr, boolean[] useArr) Solve the fitting problem.
-
Constructor Details
-
SolverLM
public SolverLM()
-
-
Method Details
-
solve
public boolean solve(DataStore ds, ModelFunction mf, double[] iniArr, double[] errIniArr, boolean[] useArr) Solve the fitting problem.- Specified by:
solve
in interfaceFitSolver
- Parameters:
ds
- The data for fitting.iniArr
- The initial values of the parameters.errIniArr
- The parameter values' errors.useArr
- The mask Array specifying if the parameter will be used in fitting.mf
- The model function- Returns:
- The boolean value specifying success of fitting.
-
setLambdaFactor
public void setLambdaFactor(double factor) Sets the lambdaFactor attribute of the SolverLM object- Parameters:
factor
- The new lambdaFactor value
-
getLambdaFactor
public double getLambdaFactor()Gets the lambdaFactor attribute of the SolverLM object- Returns:
- The lambdaFactor value
-
setLambdaIni
public void setLambdaIni(double lambdaIni) Sets the lambdaIni attribute of the SolverLM object- Parameters:
lambdaIni
- lambdaIni new lambdaIni value
-
getLambdaIni
public double getLambdaIni()Gets the lambdaIni attribute of the SolverLM object- Returns:
- The lambdaIni value
-
setLambdaMax
public void setLambdaMax(double lambdaMax) Sets the lambdaMax attribute of the SolverLM object- Parameters:
lambdaMax
- The new lambdaMax value
-
getLambdaMax
public double getLambdaMax()Gets the lambdaMax attribute of the SolverLM object- Returns:
- The lambdaMax value
-
setToll
public void setToll(double epsToll) Sets the toll attribute of the SolverLM object- Parameters:
epsToll
- The new toll value
-
getToll
public double getToll()Gets the toll attribute of the SolverLM object- Returns:
- The toll value
-
setIterLimit
public void setIterLimit(int totalIterLimit) Sets the iterLimit attribute of the SolverLM object- Parameters:
totalIterLimit
- The new iterLimit value
-
getIterLimit
public int getIterLimit()Description of the Method- Returns:
- Description of the Return Value
-
main
MAIN for debugging- Parameters:
args
- The Array of strings as parameters
-