hep.aida.ref.function
Class SumOfFunctions
- java.lang.Object
-
- hep.aida.ref.event.AIDAObservable
-
- hep.aida.ref.ManagedObject
-
- hep.aida.ref.function.SumOfFunctions
-
- All Implemented Interfaces:
- IDevManagedObject, IFunction, IManagedObject, Connectable
public class SumOfFunctions extends ManagedObject implements IFunction
-
-
Constructor Summary
Constructors Constructor and Description SumOfFunctions(java.lang.String name, java.util.ArrayList functions)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description voidaddFunction(IFunction func)IAnnotationannotation()java.lang.StringcodeletString()String describing the metatype and implementation of the function.booleancontainsFunction(IFunction function)intdimension()Dimensionality of the domain space.IFunctionfunction(int index)double[]gradient(double[] values)Gradient of the function.intindexOfFunction(IFunction function)intindexOfParameter(java.lang.String str)Return -1 if parameter not found (name undefined).booleanisEqual(IFunction iFunction)Compare if functions are the same.intnFunctions()java.lang.StringnormalizationParameter()Returns the name of the normalization parameter if the function has one.intnumberOfParameters()Number of parameters.doubleparameter(java.lang.String str)java.lang.String[]parameterNames()Names of paramaters.double[]parameters()Retrieve current vector of parameters.booleanprovidesGradient()Determine whether function is able to compute gradient.voidremoveAllFunctions()voidremoveFunction(IFunction func)voidsetParameter(java.lang.String str, double param)Set parameter's value by name.voidsetParameters(double[] values)Set new vector of parameters.voidsetTitle(java.lang.String str)Set the histogram title.java.lang.Stringtitle()Get the Function's title.doublevalue(double[] values)Scalar value of the function.java.lang.StringvariableName(int param)Get the symbolic name of i-th variable.java.lang.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(java.lang.String name, java.util.ArrayList functions)
-
-
Method Detail
-
annotation
public IAnnotation annotation()
- Specified by:
annotationin interfaceIFunction
-
normalizationParameter
public java.lang.String normalizationParameter()
Description copied from interface:IFunctionReturns the name of the normalization parameter if the function has one.- Specified by:
normalizationParameterin interfaceIFunction- Returns:
- The name of the normalization parameter.null if no such parameter is available
-
codeletString
public java.lang.String codeletString()
Description copied from interface:IFunctionString 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:
codeletStringin interfaceIFunction
-
dimension
public int dimension()
Description copied from interface:IFunctionDimensionality of the domain space.
-
gradient
public double[] gradient(double[] values)
Description copied from interface:IFunctionGradient of the function. The result is valid only if providesGradient()==true. Otherwise the result is some default (empty) vector.
-
indexOfParameter
public int indexOfParameter(java.lang.String str)
Description copied from interface:IFunctionReturn -1 if parameter not found (name undefined). Leave it because there are use cases - some users prefer to use numbers.- Specified by:
indexOfParameterin interfaceIFunction
-
isEqual
public boolean isEqual(IFunction iFunction)
Description copied from interface:IFunctionCompare if functions are the same. PENDING: define exactly what it means ;)
-
numberOfParameters
public int numberOfParameters()
Description copied from interface:IFunctionNumber of parameters.- Specified by:
numberOfParametersin interfaceIFunction
-
parameter
public double parameter(java.lang.String str)
-
parameterNames
public java.lang.String[] parameterNames()
Description copied from interface:IFunctionNames 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:
parameterNamesin interfaceIFunction
-
parameters
public double[] parameters()
Description copied from interface:IFunctionRetrieve current vector of parameters.- Specified by:
parametersin interfaceIFunction
-
providesGradient
public boolean providesGradient()
Description copied from interface:IFunctionDetermine whether function is able to compute gradient.- Specified by:
providesGradientin interfaceIFunction
-
setParameter
public void setParameter(java.lang.String str, double param) throws java.lang.IllegalArgumentExceptionDescription copied from interface:IFunctionSet parameter's value by name.- Specified by:
setParameterin interfaceIFunction- Parameters:
str- The name of the parameter.param- The new value of the parameter.- Throws:
java.lang.IllegalArgumentException- If name does not correspond to a parameter.
-
setParameters
public void setParameters(double[] values) throws java.lang.IllegalArgumentExceptionDescription copied from interface:IFunctionSet new vector of parameters.- Specified by:
setParametersin interfaceIFunction- Throws:
java.lang.IllegalArgumentException
-
setTitle
public void setTitle(java.lang.String str) throws java.lang.IllegalArgumentExceptionDescription copied from interface:IFunctionSet the histogram title.
-
title
public java.lang.String title()
Description copied from interface:IFunctionGet the Function's title.
-
value
public double value(double[] values)
Description copied from interface:IFunctionScalar value of the function.
-
variableName
public java.lang.String variableName(int param)
Description copied from interface:IFunctionGet the symbolic name of i-th variable.- Specified by:
variableNamein interfaceIFunction
-
variableNames
public java.lang.String[] variableNames()
Description copied from interface:IFunctionGet all the names in a vector.- Specified by:
variableNamesin interfaceIFunction
-
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)
-
-
DMelt 3.0 © DataMelt by jWork.ORG