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;
72 virtual std::unique_ptr<ROOT::Math::IOptions>
Options()
const = 0;
92 if (dim > 0)
Init(dim);
95 bool Init(
size_t dim)
override {
96 fWs = gsl_monte_vegas_alloc( dim);
98 return (
fWs !=
nullptr);
103 if (!
fWs)
return false;
104 int iret = gsl_monte_vegas_init(
fWs );
110 if (
fWs) gsl_monte_vegas_free(
fWs);
121 size_t NDim()
const override {
return (
fWs) ?
fWs->dim : 0; }
134 std::unique_ptr<IOptions>
Options()
const override {
153 gsl_monte_vegas_state *
fWs;
170 if (dim > 0)
Init(dim);
174 bool Init(
size_t dim)
override {
175 fWs = gsl_monte_miser_alloc( dim);
179 return (
fWs !=
nullptr);
184 if (!
fWs)
return false;
185 int iret = gsl_monte_miser_init(
fWs );
191 if (
fWs) gsl_monte_miser_free(
fWs);
203 size_t NDim()
const override {
return (
fWs) ?
fWs->dim : 0; }
211 std::unique_ptr<ROOT::Math::IOptions>
Options()
const override {
231 gsl_monte_miser_state *
fWs;
247 bool Init(
size_t dim)
override {
248 fWs = gsl_monte_plain_alloc( dim);
250 return (
fWs !=
nullptr);
254 if (!
fWs)
return false;
255 int iret = gsl_monte_plain_init(
fWs );
260 if (
fWs) gsl_monte_plain_free(
fWs);
270 size_t NDim()
const override {
return (
fWs) ?
fWs->dim : 0; }
272 std::unique_ptr<ROOT::Math::IOptions>
Options()
const override {
273 return std::unique_ptr<ROOT::Math::IOptions>();
281 gsl_monte_plain_state *
fWs;
winID h TVirtualViewer3D TVirtualGLPainter p
virtual ~GSLMCIntegrationWorkspace()
virtual void Clear()
free the workspace deleting the GSL pointer
virtual size_t NDim() const
GSLMCIntegrationWorkspace()
virtual void SetOptions(const ROOT::Math::IOptions &)=0
set options
virtual MCIntegration::Type Type() const =0
virtual bool ReInit()=0
re-initialize an existing the workspace
virtual std::unique_ptr< ROOT::Math::IOptions > Options() const =0
retrieve option pointer corresponding to parameters create a new object to be managed by the user
virtual bool Init(size_t dim)=0
initialize the workspace creating the GSL pointer if it is not there
gsl_monte_miser_state * fWs
bool ReInit() override
re-initialize an existing the workspace
const MiserParameters & Parameters() const
void SetMiserParameters()
GSLMiserIntegrationWorkspace(size_t dim=0)
void Clear() override
free the workspace deleting the GSL pointer
MiserParameters & Parameters()
std::unique_ptr< ROOT::Math::IOptions > Options() const override
retrieve option pointer corresponding to parameters create a new object to be managed by the user
size_t NDim() const override
bool Init(size_t dim) override
initialize the workspace creating the GSL pointer if it is not there
virtual void SetOptions(const ROOT::Math::IOptions &opt) override
set options
gsl_monte_miser_state * GetWS()
void SetParameters(const MiserParameters &p)
MCIntegration::Type Type() const override
void Clear() override
free the workspace deleting the GSL pointer
MCIntegration::Type Type() const override
bool ReInit() override
re-initialize an existing the workspace
bool Init(size_t dim) override
initialize the workspace creating the GSL pointer if it is not there
virtual void SetOptions(const ROOT::Math::IOptions &) override
set options
gsl_monte_plain_state * GetWS()
gsl_monte_plain_state * fWs
std::unique_ptr< ROOT::Math::IOptions > Options() const override
retrieve option pointer corresponding to parameters create a new object to be managed by the user
GSLPlainIntegrationWorkspace()
size_t NDim() const override
gsl_monte_vegas_state * fWs
gsl_monte_vegas_state * GetWS()
std::unique_ptr< IOptions > Options() const override
retrieve option pointer corresponding to parameters create a new object to be managed by the user
void Clear() override
free the workspace deleting the GSL pointer
bool ReInit() override
re-initialize an existing the workspace
bool Init(size_t dim) override
initialize the workspace creating the GSL pointer if it is not there
const VegasParameters & Parameters() const
MCIntegration::Type Type() const override
VegasParameters & Parameters()
virtual void SetOptions(const ROOT::Math::IOptions &opt) override
set options
void SetParameters(const struct VegasParameters &p)
GSLVegasIntegrationWorkspace(size_t dim=0)
void SetVegasParameters()
size_t NDim() const override
Generic interface for defining configuration options of a numerical algorithm.
Type
enumeration specifying the integration types.
Namespace for new Math classes and functions.
This file contains a specialised ROOT message handler to test for diagnostic in unit tests.
Structure collecting parameters for MISER multidimensional integration.
size_t min_calls_per_bisection
std::unique_ptr< ROOT::Math::IOptions > MakeIOptions() const
convert to options (return object is managed by the user)
Structures collecting parameters for VEGAS multidimensional integration For implementation of default...
std::unique_ptr< ROOT::Math::IOptions > MakeIOptions() const
Convert to options.