Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | File Members | Related Pages

FunctionBase Class Reference

Collaboration diagram for FunctionBase:

Collaboration graph
[legend]
List of all members.

Detailed Description

Definition at line 18 of file FunctionBase.sip.

Public Member Functions

virtual ~FunctionBase ()
const std::string & name () const
 Returns the name of the function.
virtual FunctionBaseclone () const
 Creates a new function object by copying an existing one.
 if (!sipResObj||sipParseResult(0, sipMethod, sipResObj,"L", sipForceConvertTo_FunctionBase,&sipRes)< 0)
 sipTransfer (sipResObj, 1)
virtual End int size () const
 Returns the number of parameters.
virtual const std::vector<
std::string > & 
parmNames ()
 Returns a reference to a vector of parameter names.
void setParmNames (const std::vector< std::string > &)
 Sets the parameter names.
virtual bool isComposite () const
 Returns false.
virtual void addToComposite (FunctionBase *)
 Does nothing.
virtual void removeFromComposite (FunctionBase *)
 Does nothing.
virtual int count ()
 Returns 0.
virtual const std::vector<
double > & 
getParameters ()
 Returns the values of the parameters as a vector.
virtual void setParameters (const std::vector< double > &)
 Sets the parameter values.
virtual double operator() (double) const =0
 The function call operator.
virtual bool hasDerivatives () const
 Returns true if function can calculate its partial derivatives.
virtual double integrate (double, double) const
 Returns the integral of the function from the lower limit to the higher limit.

Public Attributes

VirtualCatcherCode PyObject * sipResObj = sipCallMethod ( 0, sipMethod, "" )

Protected Member Functions

 FunctionBase ()
 FunctionBase (const FunctionBase &)
virtual double derivByParm (int, double) const =0
void setName (const char *)
virtual void initialize ()=0


Constructor & Destructor Documentation

FunctionBase::FunctionBase  )  [protected]
 

FunctionBase::FunctionBase const FunctionBase  )  [protected]
 

virtual FunctionBase::~FunctionBase  )  [virtual]
 


Member Function Documentation

virtual void FunctionBase::addToComposite FunctionBase  )  [virtual]
 

Does nothing.

Derived classes that are a composite of functions should override this member function and add functions to the composite.

virtual FunctionBase* FunctionBase::clone  )  const [virtual]
 

Creates a new function object by copying an existing one.

Note:
This needed special implementatin otherwise Python would garbage collect the created Python object since it thinks there's no reference to it. The call to sipTransfer transfers the ownership to C++ and increments a reference to the Python object. See archives of the mailing list around March 14, 2005 for discussion.

virtual int FunctionBase::count  )  [virtual]
 

Returns 0.

Derived classes that are a composite of functions should override this member function to return the number of functions in the composite.

virtual double FunctionBase::derivByParm int  ,
double 
const [protected, pure virtual]
 

virtual const std::vector< double >& FunctionBase::getParameters  )  [virtual]
 

Returns the values of the parameters as a vector.

The function is non-const because a derived class may need to create the vector.

virtual bool FunctionBase::hasDerivatives  )  const [virtual]
 

Returns true if function can calculate its partial derivatives.

This base class implementation returns true. Derived class that can not calculate its partial derivatives should return false. This allows an application to not attempt to use a minimizer that requires derivatives to use this function.

FunctionBase::if  )  [inline]
 

Definition at line 52 of file FunctionBase.sip.

virtual void FunctionBase::initialize  )  [protected, pure virtual]
 

virtual double FunctionBase::integrate double  ,
double 
const [virtual]
 

Returns the integral of the function from the lower limit to the higher limit.

As of now all the integration is done here numerically using the trapeziodal rule. Derived class may implement an analytical expression in place of this numerical method

virtual bool FunctionBase::isComposite  )  const [virtual]
 

Returns false.

Derived classes that are a composite of functions should override this member function and return true.

const std::string& FunctionBase::name  )  const
 

Returns the name of the function.

virtual double FunctionBase::operator() double   )  const [pure virtual]
 

The function call operator.

virtual const std::vector< std::string >& FunctionBase::parmNames  )  [virtual]
 

Returns a reference to a vector of parameter names.

virtual void FunctionBase::removeFromComposite FunctionBase  )  [virtual]
 

Does nothing.

Derived classes that are a composite of functions should override this member function and remove functions from the composite.

void FunctionBase::setName const char *   )  [protected]
 

virtual void FunctionBase::setParameters const std::vector< double > &   )  [virtual]
 

Sets the parameter values.

Derived classes should implement this function by invoking incrementValues ( vector< double >::const_iterator ) so that they correctly work with the LinearSumFunction class.

void FunctionBase::setParmNames const std::vector< std::string > &   ) 
 

Sets the parameter names.

FunctionBase::sipTransfer sipResObj  ,
 

virtual End int FunctionBase::size  )  const [virtual]
 

Returns the number of parameters.


Member Data Documentation

VirtualCatcherCode PyObject* FunctionBase::sipResObj = sipCallMethod ( 0, sipMethod, "" )
 

Definition at line 51 of file FunctionBase.sip.


The documentation for this class was generated from the following file:
Generated on Wed Sep 7 14:51:51 2005 for SiHippo by  doxygen 1.4.3