joptima
Interface Function
-
- All Known Subinterfaces:
- Function2D
- All Known Implementing Classes:
- Arctangent, ChiSquaredFitter, ChiSquaredFitter2D, Constant, ConstrainableFunction, Cosine, Cubic, Fitter, Gaussian, Linear, Quadratic, Sine, Sum2D, Tangent
public interface FunctionA contract with functions that want to participate in optimization.
Function parameters are provided as an array of delegates. To set the parameters prior to calculating the value of the fuction one must call
Parameter.set(double)which sets member fields using reflection. Once all the parameters have been set,calculate(double)returns the value of the function at the given coordinate.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method and Description doublecalculate(double x)Calculates the value of the function at the given point using the preset parameters.java.lang.StringgetName()Gets the (user-settable) name of this function.Parameter[]getParameters()Lists all the mutable parameters to this function.voidsetName(java.lang.String newname)Overrides the default function name.
-
-
-
Method Detail
-
getParameters
Parameter[] getParameters()
Lists all the mutable parameters to this function.- Returns:
- a
Parameter[] of delegates that access the proper member variables.
-
calculate
double calculate(double x)
Calculates the value of the function at the given point using the preset parameters.- Parameters:
x- the x coordinate to calculate the function at- Returns:
- the value of the function at the given coordinate
-
getName
java.lang.String getName()
Gets the (user-settable) name of this function.- Returns:
- the name of the function
-
setName
void setName(java.lang.String newname)
Overrides the default function name.- Parameters:
newname- the new name for the function
-
-
DMelt 3.0 © DataMelt by jWork.ORG