15#include "gsl/gsl_siman.h"
35 fX( std::vector<
double>(
x,
x + func.NDim() ) ),
36 fScale( std::vector<
double>(func.NDim() )),
44 fX( std::vector<
double>(
x,
x + func.NDim() ) ),
57 unsigned int ndim =
NDim();
58 for (
unsigned int i = 0; i < ndim; ++i) {
68 const std::vector<double> &
x =
fX;
69 const std::vector<double> &
y =
f.X();
70 unsigned int n =
x.size();
74 for (
unsigned int i = 0; i <
n; ++i)
75 d2 += (
x[i] -
y[i] ) * (
x[i] -
y[i] );
80 return std::abs(
x[0] -
y[0] );
86 std::cout <<
"\tx = ( ";
88 for (
unsigned int i = 0; i <
n-1; ++i) {
89 std::cout <<
fX[i] <<
" , ";
91 std::cout <<
fX.back() <<
" )\t";
93 std::cout <<
"E / E_best = ";
136 return fx->Distance(*fy);
160 return static_cast<void *
> (
fx->Clone() );
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t dest
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t r
GSLRandomEngine Base class for all GSL random engines, normally user instantiate the derived classes ...
GSLRngWrapper class to wrap gsl_rng structure.
GSLSimAnFunc class description.
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
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...
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...
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 ...
GSLSimAnnealing()
Default constructor.
Documentation for the abstract class IBaseFunctionMultiDim.
const_iterator begin() const
const_iterator end() const
Namespace for new Math classes and functions.
double Dist(void *xp, void *yp)
void * CopyCtor(void *xp)
void Copy(void *source, void *dest)
void Step(const gsl_rng *r, void *xp, double step_size)
tbb::task_arena is an alias of tbb::interface7::task_arena, which doesn't allow to forward declare tb...
double k
parameters for the Boltzman distribution