hep.aida
Interface IFunction
-
- All Known Subinterfaces:
- IDevFunction, IDevModelFunction, IManagedFunction, IModelFunction
- All Known Implementing Classes:
- AbstractDevModelFunction, AbstractIFunction, BaseModelFunction, BreitWigner, Exponent, Exponential, ExponentModelFunction, FNon, Function, Gauss, Gaussian, IFunctionWrapper, InternalFitFunction, InternalObjectiveFunction, JELBaseModelFunction, Landau, NegativeBinomial, NonParametricFunction, NonParametricPdf, P0, P1, P2, P3, P4, P5, P6, Poisson, PolynomialModelFunction, Pow, PowModified, Product, Step, Sum, SumOfFunctions, UserFunction
public interface IFunctionPrincipal user-level function interface. Function is a self contained object, which remembers the current value of its parameters which are simple doubles. IFunction may be directly plotted or fitted. The standard convention of referring to variables by name: "x[0]" corresponds to variable number 0 etc.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method and Description IAnnotationannotation()java.lang.StringcodeletString()String describing the metatype and implementation of the function.intdimension()Dimensionality of the domain space.double[]gradient(double[] x)Gradient of the function.intindexOfParameter(java.lang.String name)Return -1 if parameter not found (name undefined).booleanisEqual(IFunction f)Compare if functions are the same.java.lang.StringnormalizationParameter()Returns the name of the normalization parameter if the function has one.intnumberOfParameters()Number of parameters.doubleparameter(java.lang.String name)java.lang.String[]parameterNames()Names of paramaters.double[]parameters()Retrieve current vector of parameters.booleanprovidesGradient()Determine whether function is able to compute gradient.voidsetParameter(java.lang.String name, double x)Set parameter's value by name.voidsetParameters(double[] params)Set new vector of parameters.voidsetTitle(java.lang.String title)Set the histogram title.java.lang.Stringtitle()Get the Function's title.doublevalue(double[] x)Scalar value of the function.java.lang.StringvariableName(int i)Get the symbolic name of i-th variable.java.lang.String[]variableNames()Get all the names in a vector.
-
-
-
Method Detail
-
title
java.lang.String title()
Get the Function's title.- Returns:
- The Function's title.
-
setTitle
void setTitle(java.lang.String title) throws java.lang.IllegalArgumentExceptionSet the histogram title.- Parameters:
title- The title.- Throws:
IllegalArgumentEception- If title cannot be changed.java.lang.IllegalArgumentException
-
value
double value(double[] x)
Scalar value of the function.
-
dimension
int dimension()
Dimensionality of the domain space.
-
isEqual
boolean isEqual(IFunction f)
Compare if functions are the same. PENDING: define exactly what it means ;)
-
gradient
double[] gradient(double[] x)
Gradient of the function. The result is valid only if providesGradient()==true. Otherwise the result is some default (empty) vector.
-
providesGradient
boolean providesGradient()
Determine whether function is able to compute gradient.
-
variableName
java.lang.String variableName(int i)
Get the symbolic name of i-th variable.
-
variableNames
java.lang.String[] variableNames()
Get all the names in a vector.
-
setParameters
void setParameters(double[] params) throws java.lang.IllegalArgumentExceptionSet new vector of parameters.- Throws:
java.lang.IllegalArgumentException
-
parameters
double[] parameters()
Retrieve current vector of parameters.
-
numberOfParameters
int numberOfParameters()
Number of parameters.
-
parameterNames
java.lang.String[] parameterNames()
Names of paramaters. Names should be unique. Case-insensitive for comparison. Case-sensitive for storage and output. All or several names may be left blank "" if the implementation does not want to provide them.
-
setParameter
void setParameter(java.lang.String name, double x) throws java.lang.IllegalArgumentExceptionSet parameter's value by name.- Parameters:
name- The name of the parameter.x- The new value of the parameter.- Throws:
java.lang.IllegalArgumentException- If name does not correspond to a parameter.
-
parameter
double parameter(java.lang.String name)
-
indexOfParameter
int indexOfParameter(java.lang.String name)
Return -1 if parameter not found (name undefined). Leave it because there are use cases - some users prefer to use numbers.
-
annotation
IAnnotation annotation()
-
codeletString
java.lang.String codeletString()
String describing the metatype and implementation of the function. Generic format of the string: codelet:TYPE:LOCATION TYPE part contains only a 'typename' string which is a metatype identifier (used in plugins and catalogues) LOCATION may be: 'file', 'verbatim', or 'catalogue' Detailed description: codelet:typename - no location specified (using 'catalogue') codelet:typename:file:/filename.cpp - a c++ source file codelet:typename:file:/filename.py - a python source file codelet:typename:file:/filename.so - a shared library codelet:typename:catalogue - entry in a catalogue repository codelet:typename:verbatim:cpp \n - c++ source file included verbatim after \n codelet:typename:verbatim:py \n - python source file included verbatim aftern \n Comments: file:/filename is a relative path to $AIDA_FUNCTION_DEFAULT_DIR file://filename is an absolute path Examples: codelet:G:catalogue codelet:userSinus:verbatim:cpp \n { return sin(x); }
-
normalizationParameter
java.lang.String normalizationParameter()
Returns the name of the normalization parameter if the function has one.- Returns:
- The name of the normalization parameter.null if no such parameter is available
-
-
DMelt 3.0 © DataMelt by jWork.ORG