30 m_max_iterations ( 100 )
154 const vector < int > &
165 string what (
"The " );
167 what +=
" minimizer does not support limits on parameters";
168 throw std::runtime_error ( what );
175 unsigned int index = UINT_MAX;
176 const vector < string > & names =
m_fcn -> getParmNames ();
177 unsigned int size = names.size();
178 for (
unsigned int i = 0; i <
size; i++ ) {
179 const string & pname = names [i];
180 if ( pname == name ) {
185 if ( index == UINT_MAX ) {
186 string what (
"No parameter named `" );
188 what +=
"' for this function.";
189 throw std::runtime_error ( what );
207 string what (
"This " );
209 what +=
" minimizer does not support setting step size.";
210 throw std::runtime_error ( what );
231 return m_fcn -> degreesOfFreedom();
virtual void setFitCut(TupleCut *cut)
Sets the cut to limit range of fitting.
virtual void setLimits(unsigned int i, double lower, double upper)
Sets the limits for the parameter of the model function indexed by i.
virtual Fitter * clone() const =0
Makes a copy of the receiving object.
void setUseErrors(bool yes=true)
Sets the fitter to use error data from the DataSource, if available.
virtual int calcDegreesOfFreedom() const
Returns the number of degrees of freedom in the fit.
void fillFreeParameters(std::vector< double > &) const
Fills the vector with the free parameters values.
unsigned int getParameterIndex(const std::string &name)
Returns the index to the model function parameters name.
virtual void setFixedFlags(const std::vector< int > &flags)
Sets the parameters that are to be held fixed during objective function minimization.
std::string m_name
The name of the fitter.
void setDataSource(const DataSource *source)
Sets the source of data to be used.
void setFunction(FunctionBase *function)
Sets the model function.
virtual void setFCN(StatedFCN *fcn)
Sets the objective function object.
StatedFCN * getFCN()
Returns the objective function object.
virtual int calcCovariance(std::vector< std::vector< double > > &cov)
Calculates the covariance matrix.
bool needsIntegrated() const
Returns true if the Fitter needs integrated intervals.
Base class for DataSource.
A derived class for FCNBase class.
intp size(numeric::array arr)
virtual double objectiveValue() const
Calculates the value of the objective function at the current set of parameters.
hippodraw::StatedFCN class interface
virtual ~Fitter()
The virtual destructor.
Fitter(const Fitter &)
The copy constructor.
int m_max_iterations
The maximum number of iterations allowed in attempting the fit.
A function that can be added to a DataRep and used in a fitter.
The base class for fitters.
bool getUseErrors() const
Returns true if error data from the DataSource will be used if available.
const std::string & name() const
Returns the name of the fitter.
StatedFCN * m_fcn
The objective function.
virtual const std::vector< int > & getFixedFlags() const
Sets the limits of the model function parameter values.
virtual void setStepSize(unsigned int i, double size)
Sets the step size for parameter of the minimization.
virtual void copyFrom(const Fitter *other)
Makes a copy of other.
virtual void setFitRange(bool yes=true)
Sets use of a fitting range on or off.
bool isCompatible(const FunctionBase *) const
Returns true if the function is compatible with the objective function.
The class expresses a cut on a DataSource, i.e.
hippodraw::Fitter class interface