Package xal.extension.fit.lsm
Class ModelFunction1D
java.lang.Object
xal.extension.fit.lsm.ModelFunction1D
- All Implemented Interfaces:
ModelFunction
This is an abstract adapter class for a model function with one independent
variable. It delegates calls of getValue and getDerivative methods of
interface to the abstract methods with the same names and different
signatures. The signatures are different in a very simple way. The array of
independent variables is replaced by a simple double value.
- Author:
- shishlo
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal double
getDerivative
(double[] x, double[] a, int aIndex) Returns the partial derivative of the model function for the particular set of independent variables and parameters and the index of parameters for which the derivative is calculatedabstract double
getDerivative
(double x, double[] a, int aIndex) Returns the partial derivative of the model function for the particular value of independent variable and parameters and the index of parameters for which the derivative is calculatedfinal double
getValue
(double[] x, double[] a) Returns the value of the model function for the particular set of independent variables and parametersabstract double
getValue
(double x, double[] a) Returns the value of the model function for the particular value of the independent variable and parameters
-
Constructor Details
-
ModelFunction1D
public ModelFunction1D()
-
-
Method Details
-
getValue
public abstract double getValue(double x, double[] a) Returns the value of the model function for the particular value of the independent variable and parameters- Parameters:
x
- The value of independent variablea
- The array with set of parameters that should be found- Returns:
- The value of the function
-
getDerivative
public abstract double getDerivative(double x, double[] a, int aIndex) Returns the partial derivative of the model function for the particular value of independent variable and parameters and the index of parameters for which the derivative is calculated- Parameters:
x
- The value of independent variablea
- The array with set of parameters that should be foundaIndex
- The index of parameters for which the derivative is calculated- Returns:
- The value of the function
-
getValue
public final double getValue(double[] x, double[] a) Returns the value of the model function for the particular set of independent variables and parameters- Specified by:
getValue
in interfaceModelFunction
- Parameters:
x
- The array with the set of independent variablesa
- The array with set of parameters that should be found- Returns:
- The value of the function
-
getDerivative
public final double getDerivative(double[] x, double[] a, int aIndex) Returns the partial derivative of the model function for the particular set of independent variables and parameters and the index of parameters for which the derivative is calculated- Specified by:
getDerivative
in interfaceModelFunction
- Parameters:
x
- The array with the set of independent variablesa
- The array with set of parameters that should be foundaIndex
- The index of parameters for which the derivative is calculated- Returns:
- The value of the function
-