hep.aida.ref.function
Class AbstractDevModelFunction

java.lang.Object
  extended by hep.aida.ref.function.AbstractDevModelFunction
All Implemented Interfaces:
hep.aida.dev.IDevFunction, hep.aida.dev.IDevModelFunction, IFunction, IModelFunction
Direct Known Subclasses:
ExponentModelFunction, PolynomialModelFunction

public abstract class AbstractDevModelFunction
extends Object
implements hep.aida.dev.IDevModelFunction


Constructor Summary
AbstractDevModelFunction()
           
 
Method Summary
 IAnnotation annotation()
           
 String codeletString()
          String describing the metatype and implementation of the function.
abstract  int dimension()
          Dimensionality of the domain space.
 void excludeNormalizationAll()
          Set empty range in all axes.
 void excludeNormalizationAll(int iAxis)
           
 void excludeNormalizationRange(double xMin, double xMax, int iAxis)
           
abstract  double functionValue(double[] var)
           
 double[] gradient(double[] x)
          Gradient of the function.
 void includeNormalizationAll()
          Set full range in all axes.
 void includeNormalizationAll(int iAxis)
           
 void includeNormalizationRange(double xMin, double xMax, int iAxis)
           
 int indexOfParameter(String name)
          Return -1 if parameter not found (name undefined).
 boolean isEqual(IFunction f)
          Compare if functions are the same.
 boolean isNormalized()
          Return true if normalization is currently switched on.
 double normalizationAmplitude()
           
 double normalizationAmplitude(ArrayList[] xMin, ArrayList[] xMax)
           
 String normalizationParameter()
          Returns the name of the normalization parameter if the function has one.
 IRangeSet normalizationRange(int iAxis)
          Set the normalization range from -inf to +inf in the i-th axis (dimension).
 void normalize(boolean on)
          Normalize by internally adjusting some of the parameters.
abstract  int numberOfParameters()
          Number of parameters.
 double parameter(String name)
           
 double[] parameterGradient(double[] x)
          Compute gradient with respect to parameters.
 String[] parameterNames()
          Names of paramaters.
 double[] parameters()
          Retrieve current vector of parameters.
 boolean providesGradient()
          Determine whether function is able to compute gradient.
 boolean providesNormalization()
           
 boolean providesParameterGradient()
          Return true if provides parameter gradient.
 void setAnnotation(IAnnotation ptr)
           
 void setCodeletString(String codelet)
           
 void setDimension(int dim)
           
 boolean setNormalization(boolean provides, boolean is_normalized)
           
 void setNormalizationRange(double rMin, double rMax, int iAxis)
           
 void setNumberOfParameters(int parnum)
           
 void setParameter(String name, double x)
          Set parameter's value by name.
 boolean setParameterNames(String[] names)
           
 void setParameters(double[] params)
          Set new vector of parameters.
 void setProvidesGradient(boolean yes)
           
 void setProvidesParameterGradient(boolean yes)
           
 void setTitle(String t)
          Set the histogram title.
 boolean setVariableNames(String[] names)
           
 String title()
          Get the Function's title.
 double value(double[] var)
          Scalar value of the function.
 String variableName(int i)
          Get the symbolic name of i-th variable.
 String[] variableNames()
          Get all the names in a vector.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractDevModelFunction

public AbstractDevModelFunction()
Method Detail

normalizationParameter

public 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

dimension

public abstract int dimension()
Description copied from interface: IFunction
Dimensionality of the domain space.

Specified by:
dimension in interface IFunction

numberOfParameters

public abstract int numberOfParameters()
Description copied from interface: IFunction
Number of parameters.

Specified by:
numberOfParameters in interface IFunction

functionValue

public abstract double functionValue(double[] var)

value

public final double value(double[] var)
Description copied from interface: IFunction
Scalar value of the function.

Specified by:
value in interface IFunction

annotation

public IAnnotation annotation()
Specified by:
annotation in interface IFunction

variableName

public String variableName(int i)
Description copied from interface: IFunction
Get the symbolic name of i-th variable.

Specified by:
variableName in interface IFunction

variableNames

public String[] variableNames()
Description copied from interface: IFunction
Get all the names in a vector.

Specified by:
variableNames in interface IFunction

parameterNames

public 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

indexOfParameter

public int indexOfParameter(String name)
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

setParameters

public void setParameters(double[] params)
Description copied from interface: IFunction
Set new vector of parameters.

Specified by:
setParameters in interface IFunction

setParameter

public void setParameter(String name,
                         double x)
                  throws IllegalArgumentException
Description copied from interface: IFunction
Set parameter's value by name.

Specified by:
setParameter in interface IFunction
Parameters:
name - The name of the parameter.
x - The new value of the parameter.
Throws:
IllegalArgumentException - If name does not correspond to a parameter.

parameters

public double[] parameters()
Description copied from interface: IFunction
Retrieve current vector of parameters.

Specified by:
parameters in interface IFunction

parameter

public double parameter(String name)
Specified by:
parameter in interface IFunction

isEqual

public boolean isEqual(IFunction f)
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

gradient

public double[] gradient(double[] x)
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

codeletString

public 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(String codelet)
Specified by:
setCodeletString in interface hep.aida.dev.IDevFunction

setDimension

public void setDimension(int dim)
Specified by:
setDimension in interface hep.aida.dev.IDevFunction

setProvidesGradient

public void setProvidesGradient(boolean yes)
Specified by:
setProvidesGradient in interface hep.aida.dev.IDevFunction

setVariableNames

public boolean setVariableNames(String[] names)
Specified by:
setVariableNames in interface hep.aida.dev.IDevFunction

setNumberOfParameters

public void setNumberOfParameters(int parnum)
Specified by:
setNumberOfParameters in interface hep.aida.dev.IDevFunction

setParameterNames

public boolean setParameterNames(String[] names)
Specified by:
setParameterNames in interface hep.aida.dev.IDevFunction

setAnnotation

public void setAnnotation(IAnnotation ptr)
Specified by:
setAnnotation in interface hep.aida.dev.IDevFunction

providesNormalization

public boolean providesNormalization()
Specified by:
providesNormalization in interface IModelFunction

normalize

public void normalize(boolean on)
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

isNormalized

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

Specified by:
isNormalized in interface IModelFunction

parameterGradient

public double[] parameterGradient(double[] x)
Description copied from interface: IModelFunction
Compute gradient with respect to parameters.

Specified by:
parameterGradient in interface IModelFunction

providesParameterGradient

public boolean providesParameterGradient()
Description copied from interface: IModelFunction
Return true if provides parameter gradient.

Specified by:
providesParameterGradient in interface IModelFunction

setNormalizationRange

public void setNormalizationRange(double rMin,
                                  double rMax,
                                  int iAxis)

includeNormalizationRange

public void includeNormalizationRange(double xMin,
                                      double xMax,
                                      int iAxis)

excludeNormalizationRange

public void excludeNormalizationRange(double xMin,
                                      double xMax,
                                      int iAxis)

includeNormalizationAll

public void includeNormalizationAll(int iAxis)

excludeNormalizationAll

public void excludeNormalizationAll(int iAxis)

includeNormalizationAll

public void includeNormalizationAll()
Description copied from interface: IModelFunction
Set full range in all axes.

Specified by:
includeNormalizationAll in interface IModelFunction

excludeNormalizationAll

public void excludeNormalizationAll()
Description copied from interface: IModelFunction
Set empty range in all axes.

Specified by:
excludeNormalizationAll in interface IModelFunction

normalizationRange

public IRangeSet normalizationRange(int iAxis)
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

setNormalization

public boolean setNormalization(boolean provides,
                                boolean is_normalized)
Specified by:
setNormalization in interface hep.aida.dev.IDevModelFunction

setProvidesParameterGradient

public void setProvidesParameterGradient(boolean yes)
Specified by:
setProvidesParameterGradient in interface hep.aida.dev.IDevModelFunction

normalizationAmplitude

public final double normalizationAmplitude()

normalizationAmplitude

public double normalizationAmplitude(ArrayList[] xMin,
                                     ArrayList[] xMax)

title

public String title()
Description copied from interface: IFunction
Get the Function's title.

Specified by:
title in interface IFunction
Returns:
The Function's title.

setTitle

public void setTitle(String t)
Description copied from interface: IFunction
Set the histogram title.

Specified by:
setTitle in interface IFunction
Parameters:
t - The title.


jHepWork 3.2 © jWork.org