Class AbstractFunction

    • Field Detail

      • fparameter

        protected double[] fparameter
      • fparameterMin

        protected double[] fparameterMin
      • fparameterMax

        protected double[] fparameterMax
      • fparameterCopy

        protected double[] fparameterCopy
      • fparameterFixed

        protected boolean[] fparameterFixed
      • fparameterName

        protected java.lang.String[] fparameterName
      • fitterMode

        protected boolean fitterMode
    • Constructor Detail

      • AbstractFunction

        public AbstractFunction​(java.lang.String name,
                                double... parameter)
        Parameters:
        name - function name
        parameter - parameter vector
      • AbstractFunction

        public AbstractFunction​(java.lang.String name,
                                double[] parameters,
                                java.lang.String... parameterNames)
        Parameters:
        name - function name
        parameters - parameter array
        parameterNames - parameter name array
      • AbstractFunction

        public AbstractFunction​(java.lang.String name,
                                int nparm)
        Parameters:
        name - function name
        nparm - number of free parameter
    • Method Detail

      • addFunction

        public void addFunction​(Function object)
        add object to global function list
        Parameters:
        object - function to be added
      • addListener

        public void addListener​(UpdateListener object)
        add object to update listener list
        Parameters:
        object - update listener to be added
      • clearParameterValues

        public void clearParameterValues()
        Description copied from interface: Function
        resets all parameter values to zero
        Specified by:
        clearParameterValues in interface Function
      • fixParameter

        public void fixParameter​(int id,
                                 boolean state)
        Description copied from interface: Function
        sets
        Specified by:
        fixParameter in interface Function
        Parameters:
        id - the parameter id
        state - true: parameter is fixed, false: parameter is free
      • getFreeParameterCount

        public int getFreeParameterCount()
        Specified by:
        getFreeParameterCount in interface Function
        Returns:
        the number of free parameter
      • getFunctions

        public Function[] getFunctions()
        Returns:
        all registered functions
      • getID

        public java.lang.String getID()
        Specified by:
        getID in interface Function
        Returns:
        unique function ID
      • getName

        public java.lang.String getName()
        Specified by:
        getName in interface Function
        Returns:
        function name (e.g. brief description/Latex notation)
      • getParameterCount

        public int getParameterCount()
        Specified by:
        getParameterCount in interface Function
        Returns:
        the number of parameter
      • getParameterName

        public java.lang.String getParameterName​(int id)
        Specified by:
        getParameterName in interface Function
        Parameters:
        id - the parameter id
        Returns:
        the name of a by 'id' given parameter
      • getParameterRangeMaximum

        public double getParameterRangeMaximum​(int id)
        Specified by:
        getParameterRangeMaximum in interface Function
        Parameters:
        id - the parameter id
        Returns:
        the maximum value of a by 'id' given parameter range N.B. depending on the fitter, the range may be used only as a hint
      • getParameterRangeMinimum

        public double getParameterRangeMinimum​(int id)
        Specified by:
        getParameterRangeMinimum in interface Function
        Parameters:
        id - the parameter id
        Returns:
        the minimum value of a by 'id' given parameter range N.B. depending on the fitter, the range may be used only as a hint
      • getParameterValue

        public double getParameterValue​(int id)
        Specified by:
        getParameterValue in interface Function
        Parameters:
        id - parameter id
        Returns:
        the value of a by 'id' given parameter
      • getParameterValues

        public double[] getParameterValues()
        a convenience method to return all parameter values
        Returns:
        get array with parameter values
      • invokeListener

        public void invokeListener()
        invoke object within update listener list
      • isFitterMode

        public boolean isFitterMode()
        Description copied from interface: Function
        returns whether function is in use by fitting routine <expert function>
        Specified by:
        isFitterMode in interface Function
        Returns:
        true: function is used within a fitting routine
      • isParameterFixed

        public boolean isParameterFixed​(int id)
        Description copied from interface: Function
        returns whether given parameter is fixed (static) or not
        Specified by:
        isParameterFixed in interface Function
        Parameters:
        id - parameter id
        Returns:
        true: if parameter is fixed
      • printParameters

        public void printParameters()
      • printParameters

        public void printParameters​(boolean fullDebug)
      • removeFunction

        public void removeFunction​(Function object)
        remove object to global function list
        Parameters:
        object - function to be removed
      • removeListener

        public void removeListener​(UpdateListener object)
        remove object to update listener list
        Parameters:
        object - update listener to be removed
      • setFitterMode

        public void setFitterMode​(boolean state)
        Description copied from interface: Function
        sets whether function is in use by fitting routine <expert function>
        Specified by:
        setFitterMode in interface Function
        Parameters:
        state - true: function is used within a fitting routine
      • setParameterCount

        public void setParameterCount​(int count)
        Specified by:
        setParameterCount in interface Function
        Parameters:
        count - number of free parameter
      • setParameterName

        public void setParameterName​(int id,
                                     java.lang.String paramName)
        Description copied from interface: Function
        sets the name of a by 'id' given parameter
        Specified by:
        setParameterName in interface Function
        Parameters:
        id - the parameter id
        paramName - name for the given pararameter 'id'
      • setParameterRange

        public void setParameterRange​(int id,
                                      double minRange,
                                      double maxRange)
        Description copied from interface: Function
        sets the range of a by 'id' given parameter N.B. depending on the fitter, the range may be used only as a hint
        Specified by:
        setParameterRange in interface Function
        Parameters:
        id - the parameter id
        minRange - minimum parameter range
        maxRange - maximum parameter range
      • setParameterValue

        public void setParameterValue​(int id,
                                      double value)
        Description copied from interface: Function
        sets the value of a by 'id' given parameter
        Specified by:
        setParameterValue in interface Function
        Parameters:
        id - the parameter id
        value - new value of parameter
      • setParameterValues

        public void setParameterValues​(double[] value)
        Description copied from interface: Function
        sets the parameter values using an array the array is required to have at most getParameterCount() indices
        Specified by:
        setParameterValues in interface Function
        Parameters:
        value - new parameter values