13 #include "msdevstudio/MSconfig.h" 22 #ifdef ITERATOR_MEMBER_DEFECT 31 LinearSumFunction::LinearSumFunction ( )
40 FunctionList_t::const_iterator it = old.
m_functions.begin();
67 for (
unsigned int i = 0; i < f_size; i++ ) {
68 string suffix (
"-" );
72 unsigned int n_size = names.size ();
73 for (
unsigned int j = 0; j < n_size; j++ ) {
74 string name = names [j];
87 FunctionList_t::const_iterator it =
m_functions.begin ();
89 const vector<double> & vals = (*it)->getParameters ();
90 p->
m_parms.insert ( p->
m_parms.end (), vals.begin(), vals.end () );
95 const vector < int > &
102 FunctionList_t::const_iterator it =
m_functions.begin ();
104 const vector < int > & flags = (*it)->getFixedFlags ();
106 flags.begin(), flags.end() );
111 vector< double >::const_iterator
115 FunctionList_t::iterator fit =
m_functions.begin();
118 it = (*fit)->setParameters ( it );
129 for (
unsigned int i = 0; i < numf; i++ ) {
131 if ( index < size ) {
155 for (
unsigned int i = 0; i < numf; i++ ) {
157 number +=
function ->
size ();
177 FunctionList_t::iterator it =
m_functions.begin ();
180 if ( (*it) == function ){
192 FunctionList_t::const_iterator it =
m_functions.begin ();
195 sum += (*it)->operator () ( x );
virtual double operator()(double x) const
The function call operator.
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.
virtual int count()
Returns the number of functions that are a part of this composite.
virtual double derivByParm(int i, double x) const
Returns the function's derivative at the coordinate value x with respect to the i-th parameter...
LinearSumFunction()
The default constructor.
virtual FunctionBase * clone() const
Creates a new function object by copying an existing one.
const std::vector< std::string > & parmNames() const
Returns a reference to a vector of parameter names.
std::vector< double > m_parms
The parameter values.
std::vector< std::string > m_parm_names
The names of the function parameters.
std::vector< int > m_fixed_flags
The flags to indicated which parameters are to be held fixed during minimization of this objective fu...
virtual int size() const
Returns the number of parameters.
The namespace for conversion to string.
virtual const std::vector< double > & getParameters() const
Returns the values of the parameters as a vector.
A function that can be used with a fitter.
virtual FunctionBase * clone() const
Creates a new function object by copying an existing one.
virtual void addToComposite(FunctionBase *)
Adds the function to the linear sum of functions.
A function that can be added to a DataRep and used in a fitter.
FunctionList_t m_functions
hippodraw::LinearSumFunction class interface
virtual bool isComposite() const
Returns true.
virtual void removeFromComposite(FunctionBase *)
Removes the function from the linear sum of functions.
An abstract base class to help FunctionBase objects perform some operations.
std::string m_name
The name of the function.
virtual void initialize()
Initializes the function and parameter names.
virtual void initialParameters(const FunctionHelper *helper)
Sets the FunctionHelper so that the function can calculate a reasonable set of initial parameter valu...
virtual const std::vector< int > & getFixedFlags() const
Returns the flags indicating which parameters should remain fixed during any minimization process...
const std::string & name() const
Returns the name of the function.
string convert(int i)
Converts an integer to a string.