33 #include "gsl/gsl_monte_vegas.h"
40 void VegasParameters::SetDefaultValues() {
45 mode = GSL_VEGAS_MODE_IMPORTANCE;
49 VegasParameters::VegasParameters(
const IOptions & opt) {
54 VegasParameters & VegasParameters::operator= (
const IOptions & opt) {
60 ret = opt.GetRealValue(
"alpha",val);
62 ret = opt.GetIntValue(
"iterations",ival);
63 if (ret) iterations = ival;
64 ret = opt.GetIntValue(
"stage",ival);
65 if (ret) stage = ival;
66 ret = opt.GetIntValue(
"mode",ival);
68 ret = opt.GetIntValue(
"verbose",ival);
69 if (ret) verbose = ival;
73 IOptions * VegasParameters::operator() ()
const {
75 GenAlgoOptions * opt =
new GenAlgoOptions();
76 opt->SetRealValue(
"alpha",alpha);
77 opt->SetIntValue(
"iterations",iterations);
78 opt->SetIntValue(
"stage",stage);
79 opt->SetIntValue(
"mode",mode);
80 opt->SetIntValue(
"verbose",verbose);
89 void MiserParameters::SetDefaultValues(
size_t dim) {
92 min_calls = (dim>0) ? 16*dim : 160;
93 min_calls_per_bisection = 32*min_calls;
99 MiserParameters::MiserParameters(
const IOptions & opt,
size_t dim) {
100 SetDefaultValues(dim);
104 MiserParameters & MiserParameters::operator= (
const IOptions & opt) {
110 ret = opt.GetRealValue(
"alpha",val);
111 if (ret) alpha = val;
112 ret = opt.GetRealValue(
"dither",val);
113 if (ret) dither = val;
114 ret = opt.GetRealValue(
"estimate_frac",val);
115 if (ret) estimate_frac = val;
116 ret = opt.GetIntValue(
"min_calls",ival);
117 if (ret) min_calls = ival;
118 ret = opt.GetIntValue(
"min_calls_per_bisection",ival);
119 if (ret) min_calls_per_bisection = ival;
123 IOptions * MiserParameters::operator() ()
const {
125 GenAlgoOptions * opt =
new GenAlgoOptions();
126 opt->SetRealValue(
"alpha",alpha);
127 opt->SetRealValue(
"dither",dither);
128 opt->SetRealValue(
"estimate_frac",estimate_frac);
129 opt->SetIntValue(
"min_calls",min_calls);
130 opt->SetIntValue(
"min_calls_per_bisection",min_calls_per_bisection);