27#ifndef ROOT_Math_GSLSimAnnealing
28#define ROOT_Math_GSLSimAnnealing
102 virtual double Energy()
const;
123 virtual void Print();
129 std::copy(
x,
x+
fX.size(),
fX.begin() );
134 std::copy(begin, end,
fX.begin() );
137 unsigned int NDim()
const {
return fX.size(); }
139 double X(
unsigned int i)
const {
return fX[i]; }
141 const std::vector<double> &
X()
const {
return fX; }
151 std::vector<double>
fX;
GSLRandomEngine Base class for all GSL random engines, normally user instantiate the derived classes ...
GSLSimAnFunc class description.
GSLSimAnFunc(const ROOT::Math::IMultiGenFunction &func, const double *x)
construct from an interface of a multi-dimensional function
void SetX(IT begin, IT end)
double X(unsigned int i) const
double Scale(unsigned int i) const
const std::vector< double > & X() const
virtual double Distance(const GSLSimAnFunc &func) const
calculate the distance (metric) between this one and another configuration Presently a cartesian metr...
virtual void Print()
print the position in the standard output std::ostream GSL prints in addition n iteration,...
GSLSimAnFunc()
derived classes might need to re-define completely the class
virtual ~GSLSimAnFunc()
virtual destructor (no operations)
unsigned int NDim() const
virtual GSLSimAnFunc & FastCopy(const GSLSimAnFunc &f)
fast copy method called by GSL simulated annealing internally copy only the things which have been ch...
void SetX(const double *x)
change the x values (used by sim annealing to take a step)
virtual double Energy() const
evaluate the energy ( objective function value) re-implement by derived classes if needed to be modif...
virtual void Step(const GSLRandomEngine &r, double maxstep)
change the x[i] value using a random value urndm generated between [0,1] up to a maximum value maxste...
void SetX(unsigned int i, double x)
virtual GSLSimAnFunc * Clone() const
clone method.
std::vector< double > fScale
const ROOT::Math::IMultiGenFunction * fFunc
int Solve(const ROOT::Math::IMultiGenFunction &func, const double *x0, const double *scale, double *xmin, bool debug=false)
solve the simulated annealing given a multi-dim function, the initial vector parameters and a vector ...
const GSLSimAnParams & Params() const
void SetParams(const GSLSimAnParams ¶ms)
GSLSimAnnealing()
Default constructor.
GSLSimAnnealing(const GSLSimAnnealing &)=delete
GSLSimAnnealing(GSLSimAnnealing &&)=delete
~GSLSimAnnealing()
Destructor (no operations).
GSLSimAnParams & Params()
GSLSimAnnealing & operator=(const GSLSimAnnealing &rhs)=delete
IMultiGenFunctionTempl< double > IMultiGenFunction
structure holding the simulated annealing parameters
double k
parameters for the Boltzman distribution