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