32 #ifndef ROOT_Math_GSLMCIntegrationWorkspace 33 #define ROOT_Math_GSLMCIntegrationWorkspace 35 #include "gsl/gsl_math.h" 36 #include "gsl/gsl_monte.h" 37 #include "gsl/gsl_monte_vegas.h" 38 #include "gsl/gsl_monte_miser.h" 39 #include "gsl/gsl_monte_plain.h" 59 virtual size_t NDim()
const {
return 0; }
62 virtual bool Init(
size_t dim) = 0;
89 if (dim > 0)
Init(dim);
93 fWs = gsl_monte_vegas_alloc( dim);
94 if (fWs) SetVegasParameters();
100 if (!fWs)
return false;
101 int iret = gsl_monte_vegas_init( fWs );
102 SetVegasParameters();
107 if (fWs) gsl_monte_vegas_free( fWs);
111 gsl_monte_vegas_state *
GetWS() {
return fWs; }
115 if (fWs) SetVegasParameters();
118 size_t NDim()
const {
return (fWs) ? fWs->dim : 0; }
120 double Result()
const {
return (fWs) ? fWs->result : -1;}
122 double Sigma()
const {
return (fWs) ? fWs->sigma : 0;}
124 double Chisq()
const {
return (fWs) ? fWs->chisq: -1;}
139 fWs->alpha = fParams.alpha;
140 fWs->iterations = fParams.iterations;
141 fWs->stage = fParams.stage;
142 fWs->mode = fParams.mode;
143 fWs->verbose = fParams.verbose;
147 gsl_monte_vegas_state *
fWs;
161 fHaveNewParams(false),
164 if (dim > 0)
Init(dim);
169 fWs = gsl_monte_miser_alloc( dim);
172 if (fWs) SetMiserParameters();
178 if (!fWs)
return false;
179 int iret = gsl_monte_miser_init( fWs );
180 SetMiserParameters();
185 if (fWs) gsl_monte_miser_free( fWs);
189 gsl_monte_miser_state *
GetWS() {
return fWs; }
193 fHaveNewParams =
true;
194 if (fWs) SetMiserParameters();
197 size_t NDim()
const {
return (fWs) ? fWs->dim : 0; }
213 fWs->estimate_frac = fParams.estimate_frac;
214 fWs->min_calls = fParams.min_calls;
215 fWs->min_calls_per_bisection = fParams.min_calls_per_bisection;
216 fWs->alpha = fParams.alpha;
217 fWs->dither = fParams.dither;
222 gsl_monte_miser_state *
fWs;
239 fWs = gsl_monte_plain_alloc( dim);
245 if (!fWs)
return false;
246 int iret = gsl_monte_plain_init( fWs );
247 return (iret == GSL_SUCCESS);
251 if (fWs) gsl_monte_plain_free( fWs);
255 gsl_monte_plain_state *
GetWS() {
return fWs; }
261 size_t NDim()
const {
return (fWs) ? fWs->dim : 0; }
270 gsl_monte_plain_state *
fWs;
virtual ROOT::Math::IOptions * Options() const
retrieve option pointer corresponding to parameters create a new object to be managed by the user ...
bool ReInit()
re-initialize an existing the workspace
MCIntegration::Type Type() const
GSLPlainIntegrationWorkspace()
gsl_monte_vegas_state * fWs
bool Init(size_t dim)
initialize the workspace creating the GSL pointer if it is not there
Namespace for new ROOT classes and functions.
Type
enumeration specifying the integration types.
void SetVegasParameters()
void SetMiserParameters()
virtual ROOT::Math::IOptions * Options() const
retrieve option pointer corresponding to parameters create a new object to be managed by the user ...
gsl_monte_plain_state * GetWS()
const VegasParameters & Parameters() const
structures collecting parameters for MISER multidimensional integration
void SetParameters(const MiserParameters &p)
structures collecting parameters for VEGAS multidimensional integration FOr implementation of default...
virtual size_t NDim() const
void Clear()
free the workspace deleting the GSL pointer
void Clear()
free the workspace deleting the GSL pointer
gsl_monte_miser_state * fWs
VegasParameters & Parameters()
bool Init(size_t dim)
initialize the workspace creating the GSL pointer if it is not there
void SetParameters(const struct VegasParameters &p)
void Clear()
free the workspace deleting the GSL pointer
GSLMiserIntegrationWorkspace(size_t dim=0)
virtual ~GSLMCIntegrationWorkspace()
gsl_monte_miser_state * GetWS()
bool Init(size_t dim)
initialize the workspace creating the GSL pointer if it is not there
MCIntegration::Type Type() const
MCIntegration::Type Type() const
gsl_monte_plain_state * fWs
const MiserParameters & Parameters() const
virtual ROOT::Math::IOptions * Options() const =0
retrieve option pointer corresponding to parameters create a new object to be managed by the user ...
Namespace for new Math classes and functions.
MiserParameters & Parameters()
Generic interface for defining configuration options of a numerical algorithm.
virtual MCIntegration::Type Type() const =0
bool ReInit()
re-initialize an existing the workspace
virtual void Clear()
free the workspace deleting the GSL pointer
virtual bool ReInit()=0
re-initialize an existing the workspace
virtual bool Init(size_t dim)=0
initialize the workspace creating the GSL pointer if it is not there
GSLVegasIntegrationWorkspace(size_t dim=0)
gsl_monte_vegas_state * GetWS()
virtual ROOT::Math::IOptions * Options() const
retrieve option pointer corresponding to parameters create a new object to be managed by the user ...
GSLMCIntegrationWorkspace()
bool ReInit()
re-initialize an existing the workspace