RAIDA  1.9.0
Public Member Functions | List of all members
AIDA::IFunction Interface Referenceabstract

Principal user-level function interface. More...

#include <IFunction.h>

Inheritance diagram for AIDA::IFunction:
AIDA::IFunctionROOT AIDA::IModelFunction AIDA::IModelFunctionROOT AIDA::IModelFunctionROOT

Public Member Functions

virtual ~IFunction ()
 Destructor.
 
virtual std::string title () const =0
 Get the Function's title. More...
 
virtual bool setTitle (const std::string &title)=0
 Set the histogram title. More...
 
virtual double value (const std::vector< double > &x) const =0
 Scalar value of the function.
 
virtual int dimension () const =0
 Dimensionality of the domain space.
 
virtual bool isEqual (const IFunction &f) const =0
 Compare if functions are the same. More...
 
virtual const std::vector
< double > & 
gradient (const std::vector< double > &x) const =0
 Gradient of the function. More...
 
virtual bool providesGradient () const =0
 Determine whether function is able to compute gradient.
 
virtual std::string variableName (int i) const =0
 Get the symbolic name of i-th variable.
 
virtual std::vector< std::string > variableNames () const =0
 Get all the names in a vector.
 
virtual bool setParameters (const std::vector< double > &params)=0
 Set new vector of parameters.
 
virtual const std::vector
< double > & 
parameters () const =0
 Retrieve current vector of parameters.
 
virtual int numberOfParameters () const =0
 Number of parameters.
 
virtual std::vector< std::string > parameterNames () const =0
 Names of paramaters. More...
 
virtual bool setParameter (const std::string &name, double x)=0
 Set parameter's value by name. More...
 
virtual double parameter (const std::string &name) const =0
 
virtual int indexOfParameter (const std::string &name) const =0
 Return -1 if parameter not found (name undefined). More...
 
virtual IAnnotationannotation ()=0
 
virtual const IAnnotationannotation () const =0
 
virtual std::string codeletString () const =0
 String describing the metatype and implementation of the function. More...
 
virtual void * cast (const std::string &className) const =0
 See IManagedObject for a description. More...
 

Detailed Description

Principal user-level function interface.

Function is a self contained object, which remembers the current value of its parameters which are simple doubles. IFunction may be directly plotted or fitted.

The standard convention of referring to variables by name: "x[0]" corresponds to variable number 0 etc.

Author
The AIDA team (http://aida.freehep.org/)

Function is a self contained object, which remembers the current value of its parameters which are simple doubles. IFunction may be directly plotted or fitted.

The standard convention of referring to variables by name: "x[0]" corresponds to variable number 0 etc.

Author
T. Kraemer, DESY
Version
Id:
IFunctionROOT.h,v 1.2 2007-01-02 16:20:45 tkraemer Exp

Member Function Documentation

virtual void* AIDA::IFunction::cast ( const std::string &  className) const
pure virtual

See IManagedObject for a description.

Parameters
classNameThe name of the class to cast on.
Returns
The right pointer. Return 0 if failure.

Implemented in AIDA::IFunctionROOT.

virtual std::string AIDA::IFunction::codeletString ( ) const
pure virtual

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
- c++ source file included verbatim after
codelet:typename:verbatim:py
- python source file included verbatim aftern

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
{ return sin(x); }

Implemented in AIDA::IFunctionROOT.

virtual const std::vector<double>& AIDA::IFunction::gradient ( const std::vector< double > &  x) const
pure virtual

Gradient of the function.

The result is valid only if providesGradient()==true. Otherwise the result is some default (empty) vector.

Implemented in AIDA::IFunctionROOT.

virtual int AIDA::IFunction::indexOfParameter ( const std::string &  name) const
pure virtual

Return -1 if parameter not found (name undefined).

Leave it because there are use cases - some users prefer to use numbers.

Implemented in AIDA::IFunctionROOT.

virtual bool AIDA::IFunction::isEqual ( const IFunction f) const
pure virtual

Compare if functions are the same.

PENDING: define exactly what it means ;)

Implemented in AIDA::IFunctionROOT.

virtual std::vector<std::string> AIDA::IFunction::parameterNames ( ) const
pure virtual

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.

Implemented in AIDA::IFunctionROOT.

virtual bool AIDA::IFunction::setParameter ( const std::string &  name,
double  x 
)
pure virtual

Set parameter's value by name.

Parameters
nameThe name of the parameter.
xThe new value of the parameter.
Returns
false If name does not correspond to a parameter.

Implemented in AIDA::IFunctionROOT.

virtual bool AIDA::IFunction::setTitle ( const std::string &  title)
pure virtual

Set the histogram title.

Parameters
titleThe title.
Returns
false If title cannot be changed.

Implemented in AIDA::IFunctionROOT.

virtual std::string AIDA::IFunction::title ( ) const
pure virtual

Get the Function's title.

Returns
The Function's title.

Implemented in AIDA::IFunctionROOT.


The documentation for this interface was generated from the following file: