A factory class with static methods for generating MultiIndexSets. More...
#include <MultiIndexFactory.h>
A factory class with static methods for generating MultiIndexSets.
Functions in this class are static and used to create MultiIndex sets with different structure. If the default behavior of these methods is insufficient to create a multiindex for your application, a custom MultiIndexLimiter can be used to ``filter" the results of one of these methods. @seealso muq::Utilities::MultiIndexLimiter
Definition at line 18 of file MultiIndexFactory.h.
Static Public Member Functions | |
static std::shared_ptr< MultiIndexSet > | CreateTotalOrder (unsigned int const length, unsigned int const maxOrder, unsigned int const minOrder=0, std::shared_ptr< MultiIndexLimiter > limiter=std::make_shared< NoLimiter >()) |
Construct a total order limited MultiIndex. More... | |
static std::vector< std::shared_ptr< MultiIndexSet > > | CreateTriTotalOrder (unsigned int const length, unsigned int const maxOrder, unsigned int const minOrder=0, std::shared_ptr< MultiIndexLimiter > limiter=std::make_shared< NoLimiter >()) |
static std::shared_ptr< MultiIndexSet > | CreateHyperbolic (unsigned int const length, unsigned int const maxOrder, const double q=0.5, std::shared_ptr< MultiIndexLimiter > limiter=std::make_shared< NoLimiter >()) |
Construct a general hyperbolic MultiIndex. More... | |
static std::vector< std::shared_ptr< MultiIndexSet > > | CreateTriHyperbolic (unsigned int const length, unsigned int const maxOrder, const double q=0.5, std::shared_ptr< MultiIndexLimiter > limiter=std::make_shared< NoLimiter >()) |
static std::shared_ptr< MultiIndexSet > | CreateFullTensor (unsigned int const length, unsigned int const order, std::shared_ptr< MultiIndexLimiter > limiter=std::make_shared< NoLimiter >()) |
Construct a full tensor product multiindex set. More... | |
static std::shared_ptr< MultiIndexSet > | CreateFullTensor (const Eigen::RowVectorXi &orders, std::shared_ptr< MultiIndexLimiter > limiter=std::make_shared< NoLimiter >()) |
Construct a full tensor product multiindex set with the potential for different orders in each dimension. More... | |
static std::shared_ptr< MultiIndexSet > | CreateAnisotropic (const Eigen::RowVectorXf &weights, const double epsilon) |
Construct an anisotropic multiindex set based on a priori information on the importance of each dimension. More... | |
static std::shared_ptr< MultiIndex > | CreateSingleTerm (int totalDim, int nonzeroDim, int order) |
Creates a single multiindex with one nonzero term. More... | |
|
static |
Construct an anisotropic multiindex set based on a priori information on the importance of each dimension.
Given a weight vector \( w = (w_i)_{i=1}^d \) with \( w_i \in [0,1] \) and a cutoff threshold \( \epsilon \in (0,1)\), the anisotropic multiindex set contains all d-dimensional multiindices \( \nu = (\nu_i)_{i=1}^d \) for which \( w^\nu := \prod_{i=1}^d w_i^{\nu_i} > \epsilon \). The algorithm is further described as Algorithm 2 in
weights | A vector of weights representing the importance of each dimension. |
epsilon | Cutoff threshold \( \epsilon \in (0,1)\). Multiindices with \( w^\nu > \epsilon \) are excluded from the multiindex set. |
Definition at line 220 of file MultiIndexFactory.cpp.
|
static |
Construct a full tensor product multiindex set with the potential for different orders in each dimension.
Like the CreateFullTensor(int,int) function, the output of the this function is a tensor product multiindex set. However, this function allows each dimension of the multiindex to have a different maximum. For example, if [1,2] was passed as the input to this function, the returned multiindex set would include \([0, 0], [0, 1], [0, 2], [1, 0], [1, 1], [1, 2] \).
[in] | orders | A row vector of nonnegative unsigned integers dictating the maximum order in each dimension. Note that the maximum order is inclusive. |
Definition at line 198 of file MultiIndexFactory.cpp.
|
static |
Construct a full tensor product multiindex set.
The output of this function is a multiindex set containing a full tensor product of the one dimensional orders. For example, a two dimensional set with order 2 would include \( [0, 0], [0, 1], [0, 2], [1, 0], [1, 1], [1, 2], [2, 0], [2,1], [2,2]\). Notice that full tensor sets are significantly larger than total order limited sets. In this function, the upper bound on the order is the same for each dimension. For constructing tensor product sets with a different upper bound for each dimension,
[in] | length | The dimension of the multiindex |
[in] | order | The upper bound on the order for all dimensions. |
Definition at line 190 of file MultiIndexFactory.cpp.
Referenced by muq::SamplingAlgorithms::ParallelMIMCMCBox::ParallelMIMCMCBox().
|
static |
Construct a general hyperbolic MultiIndex.
Following Blatman and Sudret 2011, this function creates a hyperbolic index set. Define the \(q\)-norm of the multindex as
\[ \|\mathbf{j}\|_q = \left(\sum_{d=1}^Dj_d^q\right)^{1/q} \]
where \(D\) is the dimension of the multiindex and \(q\) is a positive scalar. This function creates a set such that \( \|\mathbf{j}\|_q \leq p_U\) for some nonnegative integer \(p_U\). When \(q=1\), we obtain a total order limited set and as \(q\rightarrow\infty\), we would obtain the full tensor set. Notice that in general \(q<1\) to ensure that the resulting set is smaller than the total order set.
[in] | length | The dimension of the multiindex \(\mathbf{j}\). |
[in] | maxOrder | The upper bound \(p_U\). Notice that this is also an upper bound on the maximum value in the multiindex. |
[in] | q | A scalar defining the norm used. The default value is 0.5. |
[in] | limiter | A shared_ptr to a child of the abstract MultiIndexLimiter class. This input can be used to further restrict what multiIndices are put in the set. However, the default limiter is a NoLimiter, which has no effect. |
Definition at line 156 of file MultiIndexFactory.cpp.
References nlohmann::detail::dtoa_impl::e.
|
static |
Creates a single multiindex with one nonzero term.
Constructs a MultiIndex of length totalDim that contains a single nonzero element. Component nonzeroDim is set to value of order.
[in] | totalDim | The length of the MultiIndex (i.e., number of components) |
[in] | nonzeroDim | The index of the single nonzero component. |
[in] | order | The value of the single nonzero component. |
Definition at line 265 of file MultiIndexFactory.cpp.
|
static |
Construct a total order limited MultiIndex.
The total order of a multiindex \(\mbox{j}\) is given by the \(\ell_1\) norm \(\|\mathbf{j}\|_1\). This function creates the set of all MultiIndices such that \(p_L \leq \|\mathbf{j}\|_1 \leq p_U\) for two nonnegative integers \(p_L\) and \(p_U\). For example, in two dimensions, setting \(p_L=0\) and \(p_U=3\) would result in a set containing \( [0, 0], [0, 1], [0, 2], [0, 3], [1, 0], [1, 1], [1, 2], [2,0], [2,1], [3,0]\).
[in] | length | The dimension of the multiindex \(\mathbf{j}\). |
[in] | maxOrder | The upper bound on the total order \(p_U\). |
[in] | minOrder | The lower bound on the total order \(p_L\). The default value is 0. |
[in] | limiter | A shared_ptr to a child of the abstract MultiIndexLimiter class. This input can be used to further restrict what multiIndices are put in the set. However, the default limiter is a NoLimiter, which has no effect. |
Definition at line 122 of file MultiIndexFactory.cpp.
|
static |
Definition at line 176 of file MultiIndexFactory.cpp.
|
static |
Definition at line 142 of file MultiIndexFactory.cpp.
|
staticprivate |
Definition at line 36 of file MultiIndexFactory.cpp.
|
staticprivate |
Definition at line 76 of file MultiIndexFactory.cpp.
|
staticprivate |
Definition at line 7 of file MultiIndexFactory.cpp.