A wrapper class for FunctionBase. More...
#include <FunctionWrap.h>


Public Member Functions | |
| virtual void | addToComposite (FunctionBase *) |
| Does nothing. More... | |
| FunctionBase * | clone () const |
| Make copy of object, including copy of Python object. More... | |
| virtual int | count () |
| Returns 0. More... | |
| double | derivByParm (int, double) const |
| unsigned int | dimensions () const |
| Returns the number of dimensions of the data coordinate. More... | |
| FunctionWrap (const FunctionBase &base) | |
| Constructor. More... | |
| FunctionWrap (const FunctionWrap &) | |
| The copy constructor. More... | |
| FunctionWrap () | |
| The default constructor. More... | |
| template<class T > | |
| object | get_owner (T *) const |
| virtual const std::vector< int > & | getFixedFlags () const |
| Returns the flags indicating which parameters should remain fixed during any minimization process. More... | |
| virtual const std::vector < double > & | getParameters () const |
| Returns the values of the parameters as a vector. More... | |
| virtual bool | hasDerivatives () const |
Returns true if the Python function has implemented returning partial derivatives. More... | |
| void | initialize () |
| void | initialParameters (const FunctionHelper *) |
| Sets the FunctionHelper so that the function can calculate a reasonable set of initial parameter values. More... | |
| virtual double | integrate (double lower_limit, double upper_limit) const |
| Returns the integral of the function from the lower limit to the higher limit. More... | |
| virtual bool | isComposite () const |
Returns false. More... | |
| const std::string & | name () const |
| Returns the name of the function. More... | |
| double | operator() (double) const |
| double | operator() (const std::vector< double > &) const |
| virtual const std::vector < std::string > & | parmNames () const |
| Returns a reference to a vector of parameter names. More... | |
| virtual void | removeFromComposite (FunctionBase *) |
| Does nothing. More... | |
| virtual void | setFixedFlags (const std::vector< int > &flags) |
| Sets to flags indicating that a function parameter is to be held fixed in a minimization process. More... | |
| virtual std::vector< int > ::const_iterator | setFixedFlags (std::vector< int >::const_iterator it) |
| void | setName (const std::string &name) |
| Sets the name of the function. More... | |
| virtual void | setParameters (const std::vector< double > &incr) |
| Sets the parameter values. More... | |
| virtual std::vector< double > ::const_iterator | setParameters (std::vector< double >::const_iterator it) |
| Sets the parameter values to the value pointed to by the iterator. More... | |
| void | setParmNames (const std::vector< std::string > &names) |
| Sets the names of the parameters and re-sizes the number of parameters available. More... | |
| virtual int | size () const |
| Returns the number of parameters. More... | |
| virtual | ~FunctionWrap () |
| The destructor. More... | |
Protected Member Functions | |
| virtual void | resize () |
| Re-sizes the appropriate vectors maintained in this base class. More... | |
| void | setName (const char *) |
| Sets the name of the function. More... | |
Protected Attributes | |
| std::vector< int > | m_fixed_flags |
| The flags to indicated which parameters are to be held fixed during minimization of this objective function. More... | |
| std::string | m_name |
| The name of the function. More... | |
| std::vector< std::string > | m_parm_names |
| The names of the function parameters. More... | |
| std::vector< double > | m_parms |
| The parameter values. More... | |
Private Member Functions | |
| template<class T > | |
| boost::python::object | get_owner (T *me) const |
| Find the Python object that owns this object. More... | |
Private Attributes | |
| boost::python::object | invert_ownership |
| The new ownership. More... | |
A wrapper class for FunctionBase.
This class allows one to implement in Python a derived class of FunctionBase.
with a lot of help from David Abrahams dave@boost-consulting.com
Definition at line 30 of file FunctionWrap.h.
| FunctionWrap | ( | const FunctionBase & | base | ) |
Constructor.
Definition at line 110 of file FunctionWrap.cxx.
| FunctionWrap | ( | const FunctionWrap & | wrap | ) |
The copy constructor.
Definition at line 116 of file FunctionWrap.cxx.
| FunctionWrap | ( | ) |
The default constructor.
Definition at line 104 of file FunctionWrap.cxx.
|
virtual |
The destructor.
Definition at line 122 of file FunctionWrap.cxx.
References FunctionWrap::get_owner().
|
virtualinherited |
Does nothing.
Derived classes that are a composite of functions should override this member function and add functions to the composite.
Reimplemented in LinearSumFunction.
Definition at line 193 of file FunctionBase.cxx.
|
virtual |
Make copy of object, including copy of Python object.
Reimplemented from FunctionBase.
Definition at line 183 of file FunctionWrap.cxx.
References FunctionWrap::get_owner(), and FunctionWrap::invert_ownership.
|
virtualinherited |
Returns 0.
Derived classes that are a composite of functions should override this member function to return the number of functions in the composite.
Reimplemented in LinearSumFunction.
Definition at line 201 of file FunctionBase.cxx.
|
virtual |
Reimplemented from FunctionBase.
Definition at line 255 of file FunctionWrap.cxx.
References FunctionWrap::get_owner(), and i.
|
virtual |
Returns the number of dimensions of the data coordinate.
This implementation in the base class returns 1. Derived class should override this function if the data coordinate is multi-dimensional.
Reimplemented from FunctionBase.
Definition at line 148 of file FunctionWrap.cxx.
References FunctionBase::dimensions(), and FunctionWrap::get_owner().
|
private |
Find the Python object that owns this object.
Referenced by FunctionWrap::clone(), FunctionWrap::derivByParm(), FunctionWrap::dimensions(), FunctionWrap::initialize(), FunctionWrap::operator()(), and FunctionWrap::~FunctionWrap().
| object get_owner | ( | T * | ) | const |
Definition at line 137 of file FunctionWrap.cxx.
|
virtualinherited |
Returns the flags indicating which parameters should remain fixed during any minimization process.
Reimplemented in LinearSumFunction.
Definition at line 106 of file FunctionBase.cxx.
References FunctionBase::m_fixed_flags.
|
virtualinherited |
Returns the values of the parameters as a vector.
The function is non-const because a derived class may need to create the vector.
Reimplemented in LinearSumFunction.
Definition at line 99 of file FunctionBase.cxx.
References FunctionBase::m_parms.
Referenced by FunctionProjector::saveParameters(), and FunctionProjector::setParameters().
|
virtual |
Returns true if the Python function has implemented returning partial derivatives.
Reimplemented from FunctionBase.
Definition at line 170 of file FunctionWrap.cxx.
References yes.
|
virtual |
Reimplemented from FunctionBase.
Definition at line 283 of file FunctionWrap.cxx.
References FunctionWrap::get_owner(), and FunctionBase::resize().
|
virtual |
Sets the FunctionHelper so that the function can calculate a reasonable set of initial parameter values.
Reimplemented from FunctionBase.
Definition at line 359 of file FunctionWrap.cxx.
|
virtualinherited |
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 trapezoidal rule. Derived class may implement an analytical expression in place of this numerical method.
Definition at line 165 of file FunctionBase.cxx.
References i, and FunctionBase::operator()().
|
virtualinherited |
Returns false.
Derived classes that are a composite of functions should override this member function and return true.
Reimplemented in LinearSumFunction.
Definition at line 188 of file FunctionBase.cxx.
|
inherited |
Returns the name of the function.
Definition at line 81 of file FunctionBase.cxx.
References FunctionBase::m_name.
Referenced by FunctionController::functionNames(), FunctionProjector::getTitle(), FunctionProjector::getYLabel(), LinearSumFunction::parmNames(), and FunctionBase::setName().
|
virtual |
Reimplemented from FunctionBase.
Definition at line 303 of file FunctionWrap.cxx.
References FunctionWrap::get_owner().
|
virtual |
Reimplemented from FunctionBase.
Definition at line 329 of file FunctionWrap.cxx.
References FunctionWrap::get_owner(), and FunctionBase::size().
|
virtualinherited |
Returns a reference to a vector of parameter names.
Reimplemented in LinearSumFunction.
Definition at line 86 of file FunctionBase.cxx.
References FunctionBase::m_parm_names.
|
virtualinherited |
Does nothing.
Derived classes that are a composite of functions should override this member function and remove functions from the composite.
Reimplemented in LinearSumFunction.
Definition at line 197 of file FunctionBase.cxx.
|
protectedvirtualinherited |
Re-sizes the appropriate vectors maintained in this base class.
Derived classes should call this member function after initializing the m_parm_names data member, as the new size is taken from that data member's size.
Definition at line 72 of file FunctionBase.cxx.
References FunctionBase::m_fixed_flags, FunctionBase::m_parm_names, FunctionBase::m_parms, and FunctionBase::size().
Referenced by LogNormal::initialize(), Novosibirsk::initialize(), FunctionWrap::initialize(), FunctionWrap::setParmNames(), and FunctionBase::setParmNames().
|
virtualinherited |
Sets to flags indicating that a function parameter is to be held fixed in a minimization process.
Definition at line 113 of file FunctionBase.cxx.
References it.
|
virtualinherited |
Definition at line 141 of file FunctionBase.cxx.
References i, it, FunctionBase::m_fixed_flags, FunctionBase::m_parms, and FunctionBase::size().
| void setName | ( | const std::string & | name | ) |
Sets the name of the function.
Definition at line 236 of file FunctionWrap.cxx.
References FunctionBase::setName().
|
protectedinherited |
Sets the name of the function.
Definition at line 67 of file FunctionBase.cxx.
References FunctionBase::m_name, and FunctionBase::name().
Referenced by FunctionWrap::setName().
|
virtualinherited |
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.
Definition at line 121 of file FunctionBase.cxx.
References it.
Referenced by FunctionProjector::restoreParameters(), and FunctionProjector::setParameters().
|
virtualinherited |
Sets the parameter values to the value pointed to by the iterator.
Returns an iterator to a data element one past the last used data element.
Reimplemented in LinearSumFunction.
Definition at line 129 of file FunctionBase.cxx.
References i, it, FunctionBase::m_parms, and FunctionBase::size().
| void setParmNames | ( | const std::vector< std::string > & | names | ) |
Sets the names of the parameters and re-sizes the number of parameters available.
Definition at line 243 of file FunctionWrap.cxx.
References FunctionBase::m_parm_names, and FunctionBase::resize().
|
virtualinherited |
Returns the number of parameters.
Reimplemented in LinearSumFunction.
Definition at line 183 of file FunctionBase.cxx.
References FunctionBase::m_parm_names.
Referenced by Novosibirsk::initialParameters(), FunctionWrap::operator()(), FunctionBase::resize(), FunctionBase::setFixedFlags(), and FunctionBase::setParameters().
|
private |
The new ownership.
Definition at line 37 of file FunctionWrap.h.
Referenced by FunctionWrap::clone().
|
protectedinherited |
The flags to indicated which parameters are to be held fixed during minimization of this objective function.
Definition at line 117 of file FunctionBase.h.
Referenced by LinearSumFunction::getFixedFlags(), FunctionBase::getFixedFlags(), FunctionBase::resize(), and FunctionBase::setFixedFlags().
|
protectedinherited |
The name of the function.
Definition at line 103 of file FunctionBase.h.
Referenced by FunctionBase::FunctionBase(), LinearSumFunction::initialize(), LogNormal::initialize(), Novosibirsk::initialize(), FunctionBase::name(), and FunctionBase::setName().
|
protectedinherited |
The names of the function parameters.
Definition at line 106 of file FunctionBase.h.
Referenced by LogNormal::initialize(), Novosibirsk::initialize(), LinearSumFunction::parmNames(), FunctionBase::parmNames(), FunctionBase::resize(), FunctionWrap::setParmNames(), FunctionBase::setParmNames(), and FunctionBase::size().
|
protectedinherited |
The parameter values.
Definition at line 109 of file FunctionBase.h.
Referenced by Erfc::calcRed(), LinearSumFunction::getParameters(), FunctionBase::getParameters(), LogNormal::initialParameters(), Novosibirsk::initialParameters(), LogNormal::LogNormal(), Novosibirsk::Novosibirsk(), LogNormal::operator()(), Novosibirsk::operator()(), FunctionBase::resize(), FunctionBase::setFixedFlags(), and FunctionBase::setParameters().