Map Factory#

namespace MapFactory#

Namespace containing factory methods for constructing triangular maps and map components.

Example usage:

// First, set options defining the paramterization
MapOptions options;
options.basisType = BasisTypes::ProbabilistHermite; // Optional. Default = BasisTypes::ProbabilistHermite
options.posFuncType = PosFuncTypes::SoftPlus;       // Optional. Default = PosFuncTypes::SoftPlus
options.quadType = QuadTypes::AdaptiveSimpson;      // Optional. Default = QuadTypes::AdaptiveSimpson
options.quadAbsTol = 1e-6;                          // Optional. Default = 1e-6
options.quadRelTol = 1e-6;                          // Optional. Default = 1e-6
options.quadMaxSub = 10;                            // Optional. Default = 30
options.contDeriv = true;                           // Optional. Default = true
options.nugget = 1e-4;                              // Optional. Default = 0.0

// Create a triangular map with these options
unsigned int inDim = 4;
unsigned int outDim = 3;
unsigned int totalOrder = 3;
auto map = MapFactory::CreateTriangular<Kokkos::HostSpace>(inDim, outDim, totalOrder, options);

Functions

template<typename MemorySpace>
std::shared_ptr<ConditionalMapBase<MemorySpace>> CreateComponent(FixedMultiIndexSet<MemorySpace> const &mset, MapOptions options = MapOptions())#
Parameters:

mset – The multiindex set specifying which terms should be used in the multivariate expansion.

template<typename MemorySpace>
std::shared_ptr<ConditionalMapBase<MemorySpace>> CreateSingleEntryMap(unsigned int dim, unsigned int activeInd, std::shared_ptr<ConditionalMapBase<MemorySpace>> const &comp)#

Creates a square triangular map that is an identity in all but one output dimension.

Constructs a (generally) non-monotone multivariate expansion.

Given a dimension \(d\), an active index \(i\), and a real-valued map \(f:\mathbb{R}^d\rightarrow\mathbb{R}\), this function creates a map \(T:\mathbb{R}^d\rightarrow\mathbb{R}^d\) such that \(T_j(x) = x_j\) for all \(j\neq i\) and \(T_i(x) = f(x)\).

Parameters:
  • dim – The dimension of the map.

  • activeInd – The index of the component to be non-identity.

  • comp – The component placed the activeInd.

  • outputDim – The output dimension of the expansion. Each output will be defined by the same multiindex set but will have different coefficients.

  • mset – The multiindex set specifying which terms should be used in the multivariate expansion.

  • options – Options specifying the 1d basis functions used in the parameterization.

template<typename MemorySpace>
std::shared_ptr<ConditionalMapBase<MemorySpace>> CreateTriangular(unsigned int inputDim, unsigned int outputDim, unsigned int totalOrder, MapOptions options = MapOptions())#

Constructs a triangular map with MonotoneComponents for each block. A total order multiindex set is used to define the MonotoneComponent.

For more control over the individual components, consider constructing components with MapFactory::CreateComponent function and then manually constructing and instance of the TriangularMap class.

Parameters:
  • inputDim – The dimension of the input to this map. Will be the number of inputs passed to the last component of the triangular map.

  • outputDim – The output dimension of the map. Note that this must be less than or equal to the input dimension.

  • totalOrder – The total order used to define the parameterization of each MonotoneComponent.

  • options – Additional options that will be passed on to CreateComponent to construct each MonotoneComponent.

template<typename MemorySpace>
std::shared_ptr<ParameterizedFunctionBase<MemorySpace>> CreateExpansion(unsigned int outputDim, FixedMultiIndexSet<MemorySpace> const &mset, MapOptions options = MapOptions())#

Constructs a (generally) non-monotone multivariate expansion.

Parameters:
  • outputDim – The output dimension of the expansion. Each output will be defined by the same multiindex set but will have different coefficients.

  • mset – The multiindex set specifying which terms should be used in the multivariate expansion.

  • options – Options specifying the 1d basis functions used in the parameterization.

template<typename MemorySpace>
struct CompFactoryImpl#
#include <MapFactory.h>

This struct is used to map the options to functions that can create a map component with types corresponding to the options.

template<typename MemorySpace>
std::shared_ptr<ConditionalMapBase<MemorySpace>> mpart::MapFactory::CreateComponent(FixedMultiIndexSet<MemorySpace> const &mset, MapOptions options = MapOptions())
Parameters:

mset – The multiindex set specifying which terms should be used in the multivariate expansion.

template<typename MemorySpace>
std::shared_ptr<ConditionalMapBase<MemorySpace>> mpart::MapFactory::CreateTriangular(unsigned int inputDim, unsigned int outputDim, unsigned int totalOrder, MapOptions options = MapOptions())

Constructs a triangular map with MonotoneComponents for each block. A total order multiindex set is used to define the MonotoneComponent.

For more control over the individual components, consider constructing components with MapFactory::CreateComponent function and then manually constructing and instance of the TriangularMap class.

Parameters:
  • inputDim – The dimension of the input to this map. Will be the number of inputs passed to the last component of the triangular map.

  • outputDim – The output dimension of the map. Note that this must be less than or equal to the input dimension.

  • totalOrder – The total order used to define the parameterization of each MonotoneComponent.

  • options – Additional options that will be passed on to CreateComponent to construct each MonotoneComponent.

struct MapOptions#

struct to hold options used by the MapFactory methods to construct monotone components and triangular maps.

Subclassed by mpart::ATMOptions

Public Functions

inline bool operator==(MapOptions opts2) const#
inline virtual std::string String()#

Public Members

BasisTypes basisType = BasisTypes::ProbabilistHermite#

The type of 1d basis function used to define the multivariate expansion.

double basisLB = -std::numeric_limits<double>::infinity()#

Linearization bounds for the 1d basis function. The basis function is linearized outside [lb,ub]

double basisUB = std::numeric_limits<double>::infinity()#
PosFuncTypes posFuncType = PosFuncTypes::SoftPlus#

The type of positive bijector used inside the monotonicity-guaranteeing integral formulation.

QuadTypes quadType = QuadTypes::AdaptiveSimpson#

The type of quadrature rule to use.

double quadAbsTol = 1e-6#

The absolute tolerance used by adaptive quadrature rules like AdaptiveSimpson and AdaptiveClenshawCurtis.

double quadRelTol = 1e-6#

The relative tolerance used by adaptive quadrature rules like AdaptiveSimpson and AdaptiveClenshawCurtis.

unsigned int quadMaxSub = 30#

The maximum number of subdivisions used in the adaptive quadrature rules.

unsigned int quadMinSub = 0#

The minimum number of subdivisions used in the adaptive quadrature rules.

unsigned int quadPts = 5#

The number of quadrature points used in fixed rules like the Clenshaw Curtis rule. Also defines the base level used in the adaptive Clenshaw-Curtis rule.

bool contDeriv = true#

Specifies whether the derivative of the integral defining a monotone component is used or if the derivative of the quadrature-based approximation of the integral is used. See :ref:diag_deriv_section for more details. If true, the integral is differentiated directly. If false, the numerical approximation to the integral is differentiated.

bool basisNorm = true#

If orthogonal polynomial basis functions should be normalized.

double nugget = 0.0#

The minimum slope of the monotone component. This nugget is added to the g(df) integrand. Must be non-negative.

enum class mpart::BasisTypes#

Values:

enumerator ProbabilistHermite#
enumerator PhysicistHermite#
enumerator HermiteFunctions#
enum class mpart::PosFuncTypes#

Values:

enumerator Exp#
enumerator SoftPlus#
enum class mpart::QuadTypes#

Values:

enumerator ClenshawCurtis#
enumerator AdaptiveSimpson#
enumerator AdaptiveClenshawCurtis#