hep.aida.ref.function
Class SumOfFunctions

java.lang.Object
  extended by hep.aida.ref.event.AIDAObservable
      extended by hep.aida.ref.ManagedObject
          extended by hep.aida.ref.function.SumOfFunctions
All Implemented Interfaces:
hep.aida.dev.IDevManagedObject, IFunction, IManagedObject, Connectable

public class SumOfFunctions
extends ManagedObject
implements IFunction


Constructor Summary
SumOfFunctions(String name, ArrayList functions)
           
 
Method Summary
 void addFunction(IFunction func)
           
 IAnnotation annotation()
           
 String codeletString()
          String describing the metatype and implementation of the function.
 boolean containsFunction(IFunction function)
           
 int dimension()
          Dimensionality of the domain space.
 IFunction function(int index)
           
 double[] gradient(double[] values)
          Gradient of the function.
 int indexOfFunction(IFunction function)
           
 int indexOfParameter(String str)
          Return -1 if parameter not found (name undefined).
 boolean isEqual(IFunction iFunction)
          Compare if functions are the same.
 int nFunctions()
           
 String normalizationParameter()
          Returns the name of the normalization parameter if the function has one.
 int numberOfParameters()
          Number of parameters.
 double parameter(String str)
           
 String[] parameterNames()
          Names of paramaters.
 double[] parameters()
          Retrieve current vector of parameters.
 boolean providesGradient()
          Determine whether function is able to compute gradient.
 void removeAllFunctions()
           
 void removeFunction(IFunction func)
           
 void setParameter(String str, double param)
          Set parameter's value by name.
 void setParameters(double[] values)
          Set new vector of parameters.
 void setTitle(String str)
          Set the histogram title.
 String title()
          Get the Function's title.
 double value(double[] values)
          Scalar value of the function.
 String variableName(int param)
          Get the symbolic name of i-th variable.
 String[] variableNames()
          Get all the names in a vector.
 
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

SumOfFunctions

public SumOfFunctions(String name,
                      ArrayList functions)
Method Detail

annotation

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

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

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

dimension

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

Specified by:
dimension in interface IFunction

gradient

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

indexOfParameter

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

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

numberOfParameters

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

Specified by:
numberOfParameters in interface IFunction

parameter

public double parameter(String str)
Specified by:
parameter 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

parameters

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

Specified by:
parameters 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

setParameter

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

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

setParameters

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

Specified by:
setParameters in interface IFunction
Throws:
IllegalArgumentException

setTitle

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

Specified by:
setTitle in interface IFunction
Parameters:
str - The title.
Throws:
IllegalArgumentException

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.

value

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

Specified by:
value in interface IFunction

variableName

public String variableName(int param)
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

addFunction

public void addFunction(IFunction func)

removeFunction

public void removeFunction(IFunction func)

removeAllFunctions

public void removeAllFunctions()

function

public IFunction function(int index)

indexOfFunction

public int indexOfFunction(IFunction function)

nFunctions

public int nFunctions()

containsFunction

public boolean containsFunction(IFunction function)


jHepWork 3.2 © jWork.org