hep.aida.ref.function
Class AbstractIFunction

java.lang.Object
  extended by hep.aida.ref.event.AIDAObservable
      extended by hep.aida.ref.ManagedObject
          extended by hep.aida.ref.function.AbstractIFunction
All Implemented Interfaces:
hep.aida.dev.IDevManagedObject, hep.aida.IFunction, hep.aida.IManagedObject, hep.aida.IModelFunction, Connectable, FunctionDispatcher, java.lang.Cloneable
Direct Known Subclasses:
BreitWigner, Exponent, Gauss, Landau, NegativeBinomial, NonParametricFunction, P0, P1, P2, P3, P4, P5, P6, Poisson, Pow, PowModified, UserFunction

public abstract class AbstractIFunction
extends ManagedObject
implements hep.aida.IModelFunction, java.lang.Cloneable, FunctionDispatcher

AbstractIFunction is implementation of the IFunction. User has to implement "value" method.


Constructor Summary
AbstractIFunction()
          No-argument constructor to be used for cloning.
AbstractIFunction(java.lang.String[] variableNames, java.lang.String[] parameterNames)
          Creates a new instance of AbstractIFunction with specified variable and parameter names.
AbstractIFunction(java.lang.String title, int dimension, int numberOfParameters)
          Creates a new instance of AbstractIFunction with default variable names (x0, x1, ...) and default parameter names (p0, p1, ...)
AbstractIFunction(java.lang.String title, java.lang.String[] variableNames, java.lang.String[] parameterNames)
           
 
Method Summary
 void addFunctionListener(FunctionListener listener)
           
 hep.aida.IAnnotation annotation()
           
 java.lang.Object clone()
           
 java.lang.String codeletString()
           
 int dimension()
           
 void excludeNormalizationAll()
           
 double[] gradient(double[] values)
           
 void includeNormalizationAll()
           
 int indexOfParameter(java.lang.String str)
           
 boolean isEqual(hep.aida.IFunction iFunction)
           
 boolean isNormalized()
           
 java.lang.String normalizationParameter()
           
 hep.aida.IRangeSet normalizationRange(int iAxis)
           
 void normalize(boolean param)
           
 int numberOfParameters()
           
 double parameter(java.lang.String str)
           
 double[] parameterGradient(double[] values)
           
 java.lang.String[] parameterNames()
           
 double[] parameters()
           
 boolean providesGradient()
           
 boolean providesNormalization()
           
 boolean providesParameterGradient()
           
 void removeFunctionListener(FunctionListener listener)
           
 void setCodeletString(java.lang.String str)
           
 void setParameter(java.lang.String str, double param)
           
 void setParameters(double[] pars)
           
 void setTitle(java.lang.String title)
           
 java.lang.String title()
           
abstract  double value(double[] v)
          Provide value for your function here.
 java.lang.String variableName(int index)
           
 java.lang.String[] variableNames()
           
 
Methods inherited from class hep.aida.ref.ManagedObject
isFillable, name, setFillable, setName, type, typeForClass
 
Methods inherited from class hep.aida.ref.event.AIDAObservable
addListener, isConnected, removeAllListeners, removeListener, setConnected, setValid, setValidForAll
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface hep.aida.ref.event.Connectable
isConnected, setConnected
 

Constructor Detail

AbstractIFunction

public AbstractIFunction()
No-argument constructor to be used for cloning. Created function can not be used directly


AbstractIFunction

public AbstractIFunction(java.lang.String title,
                         int dimension,
                         int numberOfParameters)
Creates a new instance of AbstractIFunction with default variable names (x0, x1, ...) and default parameter names (p0, p1, ...)


AbstractIFunction

public AbstractIFunction(java.lang.String[] variableNames,
                         java.lang.String[] parameterNames)
Creates a new instance of AbstractIFunction with specified variable and parameter names. This constructor must be implemented by all subclasses in order for codelet-based creation to work properly


AbstractIFunction

public AbstractIFunction(java.lang.String title,
                         java.lang.String[] variableNames,
                         java.lang.String[] parameterNames)
Method Detail

clone

public java.lang.Object clone()
Overrides:
clone in class java.lang.Object

setCodeletString

public void setCodeletString(java.lang.String str)

value

public abstract double value(double[] v)
Provide value for your function here. Something like: return p[0]+p[1]*v[0]+p[2]*v[0]*v[0];

Specified by:
value in interface hep.aida.IFunction

providesGradient

public boolean providesGradient()
Specified by:
providesGradient in interface hep.aida.IFunction

gradient

public double[] gradient(double[] values)
Specified by:
gradient in interface hep.aida.IFunction

codeletString

public java.lang.String codeletString()
Specified by:
codeletString in interface hep.aida.IFunction

annotation

public hep.aida.IAnnotation annotation()
Specified by:
annotation in interface hep.aida.IFunction

dimension

public int dimension()
Specified by:
dimension in interface hep.aida.IFunction

indexOfParameter

public int indexOfParameter(java.lang.String str)
Specified by:
indexOfParameter in interface hep.aida.IFunction

numberOfParameters

public int numberOfParameters()
Specified by:
numberOfParameters in interface hep.aida.IFunction

parameter

public double parameter(java.lang.String str)
Specified by:
parameter in interface hep.aida.IFunction

parameterNames

public java.lang.String[] parameterNames()
Specified by:
parameterNames in interface hep.aida.IFunction

parameters

public double[] parameters()
Specified by:
parameters in interface hep.aida.IFunction

setParameter

public void setParameter(java.lang.String str,
                         double param)
                  throws java.lang.IllegalArgumentException
Specified by:
setParameter in interface hep.aida.IFunction
Throws:
java.lang.IllegalArgumentException

setParameters

public void setParameters(double[] pars)
                   throws java.lang.IllegalArgumentException
Specified by:
setParameters in interface hep.aida.IFunction
Throws:
java.lang.IllegalArgumentException

setTitle

public void setTitle(java.lang.String title)
              throws java.lang.IllegalArgumentException
Specified by:
setTitle in interface hep.aida.IFunction
Throws:
java.lang.IllegalArgumentException

title

public java.lang.String title()
Specified by:
title in interface hep.aida.IFunction

variableName

public java.lang.String variableName(int index)
Specified by:
variableName in interface hep.aida.IFunction

variableNames

public java.lang.String[] variableNames()
Specified by:
variableNames in interface hep.aida.IFunction

excludeNormalizationAll

public void excludeNormalizationAll()
Specified by:
excludeNormalizationAll in interface hep.aida.IModelFunction

includeNormalizationAll

public void includeNormalizationAll()
Specified by:
includeNormalizationAll in interface hep.aida.IModelFunction

isNormalized

public boolean isNormalized()
Specified by:
isNormalized in interface hep.aida.IModelFunction

normalizationRange

public hep.aida.IRangeSet normalizationRange(int iAxis)
Specified by:
normalizationRange in interface hep.aida.IModelFunction

normalize

public void normalize(boolean param)
Specified by:
normalize in interface hep.aida.IModelFunction

parameterGradient

public double[] parameterGradient(double[] values)
Specified by:
parameterGradient in interface hep.aida.IModelFunction

providesNormalization

public boolean providesNormalization()
Specified by:
providesNormalization in interface hep.aida.IModelFunction

providesParameterGradient

public boolean providesParameterGradient()
Specified by:
providesParameterGradient in interface hep.aida.IModelFunction

normalizationParameter

public java.lang.String normalizationParameter()
Specified by:
normalizationParameter in interface hep.aida.IFunction

isEqual

public boolean isEqual(hep.aida.IFunction iFunction)
Specified by:
isEqual in interface hep.aida.IFunction

addFunctionListener

public void addFunctionListener(FunctionListener listener)
Specified by:
addFunctionListener in interface FunctionDispatcher

removeFunctionListener

public void removeFunctionListener(FunctionListener listener)
Specified by:
removeFunctionListener in interface FunctionDispatcher


jHepWork 2.8 (©) S.Chekanov