25 #include <queso/TensorProductQuadrature.h>
26 #include <queso/asserts.h>
27 #include <queso/1DQuadrature.h>
28 #include <queso/MultiDimensionalIndexing.h>
29 #include <queso/VectorSpace.h>
30 #include <queso/GslVector.h>
31 #include <queso/GslMatrix.h>
35 template<
class V,
class M>
45 unsigned int total_n_q_points = 1;
46 std::vector<unsigned int> n_q_points(dim);
47 for(
unsigned int i = 0; i <
dim; i++ )
49 n_q_points[i] = q_rules[i]->positions().size();
50 total_n_q_points *= q_rules[i]->positions().size();
63 std::vector<unsigned int> indices(dim);
64 for(
unsigned int q = 0; q < total_n_q_points; q++ )
69 queso_assert_equal_to(indices.size(),
dim);
77 for(
unsigned int i = 0; i <
dim; i++ )
79 unsigned int idx = indices[i];
80 (*domain_vec)[i] = q_rules[i]->positions()[idx];
81 weight *= q_rules[i]->weights()[idx];
std::shared_ptr< T > Type
A templated class for handling subsets.
Numerical quadrature using a tensor product of Base1DQuadrature rules.
static void globalToCoord(unsigned int global, const std::vector< unsigned int > &n_points, std::vector< unsigned int > &coord_indices)
Inverse of coordToGlobal map.
std::vector< double > m_weights
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"))
Base class for multi-dimensional quadrature rules.
TensorProductQuadrature(const VectorSubset< V, M > &domain, const std::vector< QUESO::SharedPtr< Base1DQuadrature >::Type > &q_rules)
std::vector< typename QUESO::SharedPtr< V >::Type > m_positions
Locations of quadrature points.
const VectorSpace< V, M > & vectorSpace() const
Vector space to which this set belongs to. See template specialization.