Documentation of 'hep.aida.ref.pdf.Function' Java class
Function
hep.aida.ref.pdf

Class Function

    • Constructor Detail

      • Function

        public Function(java.lang.String name)
    • Method Detail

      • addVariable

        public void addVariable(Variable v)
        Variables Management.
      • addVariables

        public void addVariables(VariableList list)
      • variableChangingUnits

        public boolean variableChangingUnits(Variable var,
                                             Units units)
        Description copied from interface: VariableListener
        Method invoked when the Variable's Units are about to change.
        Specified by:
        variableChangingUnits in interface VariableListener
        Parameters:
        var - The Variable whose Units are changing.
        units - The new Units for the Variable.
        Returns:
        true if the change is allowed.
      • variableChangedUnits

        public void variableChangedUnits(Variable var)
        Description copied from interface: VariableListener
        Method invoked when the Variable's Units have changed.
        Specified by:
        variableChangedUnits in interface VariableListener
        Parameters:
        var - The Variable whose Units have changed.
      • variableChangingValue

        public boolean variableChangingValue(Variable var,
                                             double value)
        Description copied from interface: VariableListener
        Method invoked when the Variable's value is about to change.
        Specified by:
        variableChangingValue in interface VariableListener
        Parameters:
        var - The Variable whose value is changing.
        value - The new value for the Variable.
        Returns:
        true if the change is allowed.
      • normalizationParameter

        public java.lang.String normalizationParameter()
        Description copied from interface: IFunction
        Returns the name of the normalization parameter if the function has one.
        Specified by:
        normalizationParameter in interface IFunction
        Returns:
        The name of the normalization parameter.null if no such parameter is available
      • variableChanged

        public void variableChanged(Variable var)
        This method is invoked when a variable in the function has changed its value.
      • variableChangedValue

        public void variableChangedValue(Variable var)
        Description copied from interface: VariableListener
        Method invoked when the Variable's value have changed.
        Specified by:
        variableChangedValue in interface VariableListener
        Parameters:
        var - The Variable whose value have changed.
      • variableChangingName

        public boolean variableChangingName(Variable var,
                                            java.lang.String name)
        Description copied from interface: VariableListener
        Method invoked when the Variable's name is about to change.
        Specified by:
        variableChangingName in interface VariableListener
        Parameters:
        var - The Variable whose name is changing.
        name - The new name for the Variable.
        Returns:
        true if the change is allowed.
      • variableChangedName

        public void variableChangedName(Variable var)
        Description copied from interface: VariableListener
        Method invoked when the Variable's name have changed.
        Specified by:
        variableChangedName in interface VariableListener
        Parameters:
        var - The Variable whose name has changed.
      • setValue

        public void setValue(double value)
        Description copied from interface: HasValue
        Set the current value.
        Specified by:
        setValue in interface HasValue
        Overrides:
        setValue in class Variable
        Parameters:
        value - The new value.
      • functionValue

        public double functionValue()
      • functionMaxValue

        public double functionMaxValue()
        This method is used to generate toy Mc data sets. It should be overwritten by functions whose maximum value can be provided. If it is not overwriten the maximum value will be evaluated with a mc set of data points.
      • hasAnalyticalNormalization

        public boolean hasAnalyticalNormalization(Dependent dep)
        To be overwritten if Function provides analytical normalization.
      • evaluateAnalyticalNormalization

        public double evaluateAnalyticalNormalization(Dependent dep)
      • value

        public double value()
        Description copied from interface: HasValue
        Get the current value.
        Specified by:
        value in interface HasValue
        Specified by:
        value in class Variable
        Returns:
        The current value.
      • evaluateAnalyticalVariableGradient

        public double evaluateAnalyticalVariableGradient(Variable var)
        To be overwritten by classes extending Function. This method is used internally by this class to evaluate the derivative with respect to a given Variable.
      • hasAnalyticalVariableGradient

        public boolean hasAnalyticalVariableGradient(Variable var)
        To be overwritten by classes extending Function. This method is used internally by this class to determine if a function has can provide an analytical gradient with respect to a given Variable.
      • providesGradientWithRespectToVariable

        public boolean providesGradientWithRespectToVariable(Variable var)
      • gradient

        public double[] gradient()
      • parameterGradient

        public double[] parameterGradient()
      • getParameter

        public Parameter getParameter(int index)
      • getParameter

        public Parameter getParameter(java.lang.String parName)
      • numberOfParameters

        public int numberOfParameters()
        Description copied from interface: IFunction
        Number of parameters.
        Specified by:
        numberOfParameters in interface IFunction
      • getDependent

        public Dependent getDependent(int index)
      • getDependent

        public Dependent getDependent(java.lang.String parName)
      • numberOfDependents

        public int numberOfDependents()
      • isComposite

        public boolean isComposite(Variable var)
      • getNormalizationParameter

        public Parameter getNormalizationParameter()
        The normalization Parameter for a function is ALWAYS the last one.
      • setNormalizationParamter

        public void setNormalizationParamter(Parameter par)
      • variableChangedRange

        public void variableChangedRange(Variable var)
        Description copied from interface: VariableListener
        Method invoked when the Variable's range have changed.
        Specified by:
        variableChangedRange in interface VariableListener
        Parameters:
        var - The Variable whose range has changed.
      • normalizationRangeChanged

        public void normalizationRangeChanged()
      • isNormalized

        public boolean isNormalized()
        Description copied from interface: IModelFunction
        Return true if normalization is currently switched on.
        Specified by:
        isNormalized in interface IModelFunction
      • normalize

        public void normalize(boolean normalize)
        Description copied from interface: IModelFunction
        Normalize by internally adjusting some of the parameters. When normalization is on then integral of the function in the normalization range equals to 1.
        Specified by:
        normalize in interface IModelFunction
      • codeletString

        public java.lang.String codeletString()
        Description copied from interface: IFunction
        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); }
        Specified by:
        codeletString in interface IFunction
      • setCodeletString

        public void setCodeletString(java.lang.String str)
      • value

        public double value(double[] v)
        Description copied from interface: IFunction
        Scalar value of the function.
        Specified by:
        value in interface IFunction
      • gradient

        public double[] gradient(double[] v)
        Description copied from interface: IFunction
        Gradient of the function. The result is valid only if providesGradient()==true. Otherwise the result is some default (empty) vector.
        Specified by:
        gradient in interface IFunction
      • dimension

        public int dimension()
        Description copied from interface: IFunction
        Dimensionality of the domain space.
        Specified by:
        dimension in interface IFunction
      • indexOfParameter

        public int indexOfParameter(java.lang.String parName)
        Description copied from interface: IFunction
        Return -1 if parameter not found (name undefined). Leave it because there are use cases - some users prefer to use numbers.
        Specified by:
        indexOfParameter in interface IFunction
      • parameter

        public double parameter(java.lang.String parName)
        Specified by:
        parameter in interface IFunction
      • parameterNames

        public java.lang.String[] parameterNames()
        Description copied from interface: IFunction
        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.
        Specified by:
        parameterNames in interface IFunction
      • parameters

        public double[] parameters()
        Description copied from interface: IFunction
        Retrieve current vector of parameters.
        Specified by:
        parameters in interface IFunction
      • setParameter

        public void setParameter(java.lang.String parName,
                                 double parValue)
                          throws java.lang.IllegalArgumentException
        Description copied from interface: IFunction
        Set parameter's value by name.
        Specified by:
        setParameter in interface IFunction
        Parameters:
        parName - The name of the parameter.
        parValue - The new value of the parameter.
        Throws:
        java.lang.IllegalArgumentException - If name does not correspond to a parameter.
      • setParameters

        public void setParameters(double[] pars)
                           throws java.lang.IllegalArgumentException
        Description copied from interface: IFunction
        Set new vector of parameters.
        Specified by:
        setParameters in interface IFunction
        Throws:
        java.lang.IllegalArgumentException
      • setTitle

        public void setTitle(java.lang.String title)
                      throws java.lang.IllegalArgumentException
        Description copied from interface: IFunction
        Set the histogram title.
        Specified by:
        setTitle in interface IFunction
        Parameters:
        title - The title.
        Throws:
        java.lang.IllegalArgumentException
      • title

        public java.lang.String title()
        Description copied from interface: IFunction
        Get the Function's title.
        Specified by:
        title in interface IFunction
        Returns:
        The Function's title.
      • variableName

        public java.lang.String variableName(int index)
        Description copied from interface: IFunction
        Get the symbolic name of i-th variable.
        Specified by:
        variableName in interface IFunction
      • variableNames

        public java.lang.String[] variableNames()
        Description copied from interface: IFunction
        Get all the names in a vector.
        Specified by:
        variableNames in interface IFunction
      • functionValue

        public double functionValue(double[] v)
      • normalizationRange

        public IRangeSet normalizationRange(int i)
        Description copied from interface: IModelFunction
        Set the normalization range from -inf to +inf in the i-th axis (dimension). Full range is the default if not set otherwise. It is still possible to evaluate function outside of the normalization range. PENDING: no methods to retrieve current range!
        Specified by:
        normalizationRange in interface IModelFunction
      • parameterGradient

        public double[] parameterGradient(double[] v)
        Description copied from interface: IModelFunction
        Compute gradient with respect to parameters.
        Specified by:
        parameterGradient in interface IModelFunction
      • isEqual

        public boolean isEqual(IFunction iFunction)
        Description copied from interface: IFunction
        Compare if functions are the same. PENDING: define exactly what it means ;)
        Specified by:
        isEqual in interface IFunction
      • providesGradient

        public boolean providesGradient()
        Description copied from interface: IFunction
        Determine whether function is able to compute gradient.
        Specified by:
        providesGradient in interface IFunction

DMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.