27 #include <queso/1DQuadrature.h>
35 double minDomainValue,
36 double maxDomainValue,
39 m_minDomainValue(minDomainValue),
40 m_maxDomainValue(maxDomainValue),
76 double minDomainValue,
77 double maxDomainValue,
78 const std::vector<double>& positions,
79 const std::vector<double>& weights)
99 double minDomainValue,
100 double maxDomainValue,
102 bool densityIsNormalized)
142 m_weights [0] = (322.-13.*sqrt(70.))/900.;
143 m_weights [1] = (322.+13.*sqrt(70.))/900.;
145 m_weights [3] = (322.+13.*sqrt(70.))/900.;
146 m_weights [4] = (322.-13.*sqrt(70.))/900.;
156 m_weights [0] = 0.1713244923791703450402961;
157 m_weights [1] = 0.3607615730481386075698335;
158 m_weights [2] = 0.4679139345726910473898703;
159 m_weights [3] = 0.4679139345726910473898703;
160 m_weights [4] = 0.3607615730481386075698335;
161 m_weights [5] = 0.1713244923791703450402961;
172 m_weights [0] = 0.1294849661688696932706114;
173 m_weights [1] = 0.2797053914892766679014678;
174 m_weights [2] = 0.3818300505051189449503698;
175 m_weights [3] = 0.4179591836734693877551020;
176 m_weights [4] = 0.3818300505051189449503698;
177 m_weights [5] = 0.2797053914892766679014678;
178 m_weights [6] = 0.1294849661688696932706114;
210 m_weights [ 0] = 0.0556685671161736664827537;
211 m_weights [ 1] = 0.1255803694649046246346943;
212 m_weights [ 2] = 0.1862902109277342514260976;
213 m_weights [ 3] = 0.2331937645919904799185237;
214 m_weights [ 4] = 0.2628045445102466621806889;
215 m_weights [ 5] = 0.2729250867779006307144835;
216 m_weights [ 6] = 0.2628045445102466621806889;
217 m_weights [ 7] = 0.2331937645919904799185237;
218 m_weights [ 8] = 0.1862902109277342514260976;
219 m_weights [ 9] = 0.1255803694649046246346943;
220 m_weights [10] = 0.0556685671161736664827537;
236 m_weights [ 0] = 0.0471753363865118271946160;
237 m_weights [ 1] = 0.1069393259953184309602547;
238 m_weights [ 2] = 0.1600783285433462263346525;
239 m_weights [ 3] = 0.2031674267230659217490645;
240 m_weights [ 4] = 0.2334925365383548087608499;
241 m_weights [ 5] = 0.2491470458134027850005624;
242 m_weights [ 6] = 0.2491470458134027850005624;
243 m_weights [ 7] = 0.2334925365383548087608499;
244 m_weights [ 8] = 0.2031674267230659217490645;
245 m_weights [ 9] = 0.1600783285433462263346525;
246 m_weights [10] = 0.1069393259953184309602547;
247 m_weights [11] = 0.0471753363865118271946160;
264 m_weights [ 0] = 0.0404840047653158795200216;
265 m_weights [ 1] = 0.0921214998377284479144218;
266 m_weights [ 2] = 0.1388735102197872384636018;
267 m_weights [ 3] = 0.1781459807619457382800467;
268 m_weights [ 4] = 0.2078160475368885023125232;
269 m_weights [ 5] = 0.2262831802628972384120902;
270 m_weights [ 6] = 0.2325515532308739101945895;
271 m_weights [ 7] = 0.2262831802628972384120902;
272 m_weights [ 8] = 0.2078160475368885023125232;
273 m_weights [ 9] = 0.1781459807619457382800467;
274 m_weights [10] = 0.1388735102197872384636018;
275 m_weights [11] = 0.0921214998377284479144218;
276 m_weights [12] = 0.0404840047653158795200216;
326 14 ±0.1080549487073436620662447 0.2152638534631577901958764
327 ±0.3191123689278897604356718 0.2051984637212956039659241
328 ±0.5152486363581540919652907 0.1855383974779378137417166
329 ±0.6872929048116854701480198 0.1572031671581935345696019
330 ±0.8272013150697649931897947 0.1215185706879031846894148
331 ±0.9284348836635735173363911 0.0801580871597602098056333
332 ±0.9862838086968123388415973 0.0351194603317518630318329
336 m_weights [ 0] = 0.0241483028685479319601100;
337 m_weights [ 1] = 0.0554595293739872011294402;
338 m_weights [ 2] = 0.0850361483171791808835354;
339 m_weights [ 3] = 0.1118838471934039710947884;
340 m_weights [ 4] = 0.1351363684685254732863200;
341 m_weights [ 5] = 0.1540457610768102880814316;
342 m_weights [ 6] = 0.1680041021564500445099707;
343 m_weights [ 7] = 0.1765627053669926463252710;
344 m_weights [ 8] = 0.1794464703562065254582656;
345 m_weights [ 9] = 0.1765627053669926463252710;
346 m_weights [10] = 0.1680041021564500445099707;
347 m_weights [11] = 0.1540457610768102880814316;
348 m_weights [12] = 0.1351363684685254732863200;
349 m_weights [13] = 0.1118838471934039710947884;
350 m_weights [14] = 0.0850361483171791808835354;
351 m_weights [15] = 0.0554595293739872011294402;
352 m_weights [16] = 0.0241483028685479319601100;
374 std::cerr <<
"In UniformLegendre1DQuadrature::constructor()"
377 queso_error_msg(
"order not supported");
382 for (
unsigned int j = 0; j <
m_positions.size(); ++j) {
384 if (densityIsNormalized) {
436 m_weights [0] = sqrt(M_PI)/4./(3.+sqrt(6.));
437 m_weights [1] = sqrt(M_PI)/4./(3.-sqrt(6.));
438 m_weights [2] = sqrt(M_PI)/4./(3.-sqrt(6.));
439 m_weights [3] = sqrt(M_PI)/4./(3.+sqrt(6.));
606 std::stringstream ss;
607 ss <<
"In GaussianHermite1DQuadrature::constructor()"
610 queso_error_msg(ss.str());
623 double minDomainValue,
624 double maxDomainValue,
635 queso_error_msg(
"order not supported");
640 for (
unsigned int j = 0; j <
m_positions.size(); ++j) {
654 double minDomainValue,
655 double maxDomainValue,
665 for (
unsigned int i = 0; i < n; ++i) {
666 double angle = M_PI*((double)(i+1))/((
double)(n+1));
667 double cosValue = cos(angle);
668 double sinValue = sin(angle);
670 m_weights[i] = ( M_PI/((double)(n+1)) )*sinValue*sinValue;
674 for (
unsigned int j = 0; j <
m_positions.size(); ++j) {
UniformLegendre1DQuadrature(double minDomainValue, double maxDomainValue, unsigned int order, bool densityIsNormalized)
Default constructor.
~GaussianHermite1DQuadrature()
Destructor.
double maxDomainValue() const
Returns the maximum value of the domain of the (one-dimensional) function.
double minDomainValue() const
Returns the minimum value of the domain of the (one-dimensional) function.
WignerChebyshev2nd1DQuadrature(double minDomainValue, double maxDomainValue, unsigned int order)
Default constructor.
MonteCarloSGOptions::MonteCarloSGOptions(const BaseEnvironment &env, const char *prefix queso_require_not_equal_to_msg)(m_env.optionsInputFileName(), std::string(""), std::string("this constructor is incompatible with the absence of an options input file"))
~UniformLegendre1DQuadrature()
Destructor.
GaussianHermite1DQuadrature(double mean, double stddev, unsigned int order)
Default constructor.
const std::vector< double > & positions() const
Array of the positions for the numerical integration.
WignerInverseChebyshev1st1DQuadrature(double minDomainValue, double maxDomainValue, unsigned int order)
TODO: Default constructor.
~WignerChebyshev2nd1DQuadrature()
Destructor.
Base class for one-dimensional quadrature rules (numerical integration of functions).
Base1DQuadrature(double minDomainValue, double maxDomainValue, unsigned int order)
Default constructor.
std::vector< double > m_weights
Generic1DQuadrature(double minDomainValue, double maxDomainValue, const std::vector< double > &positions, const std::vector< double > &weights)
Default constructor.
const std::vector< double > & weights() const
Array of the weights used in the numerical integration.
std::vector< double > m_positions
MonteCarloSGOptions::MonteCarloSGOptions(const BaseEnvironment &env, const char *prefix, const McOptionsValues &alternativeOptionsValues queso_require_equal_to_msg)(m_env.optionsInputFileName(), std::string(""), std::string("this constructor is incompatible with the existence of an options input file"))
~Generic1DQuadrature()
Destructor.
unsigned int order() const
Returns the order of the quadrature rule.
virtual ~Base1DQuadrature()=0
Pure virtual destructor, forcing this to be an abstract object.
~WignerInverseChebyshev1st1DQuadrature()
Destructor.
Base class for quadrature rules.