UQTk: Uncertainty Quantification Toolkit  3.1.1
Functions
multiindex.h File Reference

Header for tools that deal with integer multiindices. More...

#include "Array1D.h"
#include "Array2D.h"

Go to the source code of this file.

Functions

void heap_ext_ (const int *, const int *, int *, int *, int *)
 
int computeNPCTerms (int ndim, int norder)
 Computes the number of PC basis terms for Total-Order truncation with a given dimensionality and order. More...
 
int computeMultiIndex (int ndim, int norder, Array2D< int > &mi)
 Computes the multiindex set of a PC basis for Total-Order truncation with a given dimensionality and order Also, returns the number of terms. More...
 
int computeMultiIndexT (int ndim, int norder, int *mi)
 Computes the multiindex set of a PC basis for Total-Order truncation with a given dimensionality and order Also, returns the number of terms. Note that here, the multiindex array pointer stores indices in column-major format, i.e. mi[j*ndim+i] holds the j-th index for dimension i. More...
 
int computeMultiIndex (int ndim, int norder, Array2D< int > &mi, string ordtype)
 Computes the multiindex set of a PC basis for Total-Order truncation with a given dimensionality and order Also, returns the number of terms. More...
 
int computeMultiIndexTP (Array1D< int > &maxorders, Array2D< int > &mindex)
 Computes the multiindex set of a PC basis for Tensor-Product truncation with a given maximum order per dimensionality Also, returns the number of terms. More...
 
int computeNPCTermsHDMR (int ndim, Array1D< int > &maxorders)
 Computes the number of PC basis terms for HDMR truncation with a given dimensionality and maxorders array that contains maximal orders per interaction dimensionalities. More...
 
int computeMultiIndexHDMR (int ndim, Array1D< int > &maxorders, Array2D< int > &mindex)
 Computes the multiindex set of a PC basis for HDMR truncation with a given dimensionality and maxorders array that contains maximal orders per interaction dimensionalities. More...
 
void decodeMindex (Array1D< Array2D< int > > &sp_mindex, int ndim, Array2D< int > &mindex)
 Decode a multiindex set from a sparse format to a regular format. More...
 
void upOrder (Array2D< int > &mindex, Array2D< int > &new_mindex)
 Given a multiindex set it computes a new multiindex set where only 'admissible' bases are added. More...
 
bool is_admis (Array1D< int > &mindex_try, Array2D< int > &mindex)
 A boolean check to see if a new basis term is admissible or not. More...
 
void getOrders (Array2D< int > &mindex, Array1D< int > &orders)
 Given a multiindex set, it returns the orders of each basis term. More...
 
int get_invmindex (Array1D< int > mi)
 Given a single multiindex, this returns its relative position in the total-order multiindex set. More...
 
int get_invmindex_ord (Array1D< int > mi)
 Given a single multiindex, this returns its relative position in the total-order multiindex set among the bases of the same order. More...
 

Detailed Description

Header for tools that deal with integer multiindices.

Todo:
Multiindex could be a separate class and a part of core UQTk.

Function Documentation

◆ computeMultiIndex() [1/2]

int computeMultiIndex ( int  ndim,
int  norder,
Array2D< int > &  mi 
)

Computes the multiindex set of a PC basis for Total-Order truncation with a given dimensionality and order Also, returns the number of terms.

◆ computeMultiIndex() [2/2]

int computeMultiIndex ( int  ndim,
int  norder,
Array2D< int > &  mi,
string  ordtype 
)

Computes the multiindex set of a PC basis for Total-Order truncation with a given dimensionality and order Also, returns the number of terms.

◆ computeMultiIndexHDMR()

int computeMultiIndexHDMR ( int  ndim,
Array1D< int > &  maxorders,
Array2D< int > &  mindex 
)

Computes the multiindex set of a PC basis for HDMR truncation with a given dimensionality and maxorders array that contains maximal orders per interaction dimensionalities.

◆ computeMultiIndexT()

int computeMultiIndexT ( int  ndim,
int  norder,
int *  mi 
)

Computes the multiindex set of a PC basis for Total-Order truncation with a given dimensionality and order Also, returns the number of terms. Note that here, the multiindex array pointer stores indices in column-major format, i.e. mi[j*ndim+i] holds the j-th index for dimension i.

◆ computeMultiIndexTP()

int computeMultiIndexTP ( Array1D< int > &  maxorders,
Array2D< int > &  mindex 
)

Computes the multiindex set of a PC basis for Tensor-Product truncation with a given maximum order per dimensionality Also, returns the number of terms.

◆ computeNPCTerms()

int computeNPCTerms ( int  ndim,
int  norder 
)

Computes the number of PC basis terms for Total-Order truncation with a given dimensionality and order.

Note
The formula is (ndim+norder)!/(ndim!norder!)

◆ computeNPCTermsHDMR()

int computeNPCTermsHDMR ( int  ndim,
Array1D< int > &  maxorders 
)

Computes the number of PC basis terms for HDMR truncation with a given dimensionality and maxorders array that contains maximal orders per interaction dimensionalities.

◆ decodeMindex()

void decodeMindex ( Array1D< Array2D< int > > &  sp_mindex,
int  ndim,
Array2D< int > &  mindex 
)

Decode a multiindex set from a sparse format to a regular format.

Note
For encoding and for more details on the format, see encodeMindex function of PCSet class
See also
PCSet.h

◆ get_invmindex()

int get_invmindex ( Array1D< int >  mi)

Given a single multiindex, this returns its relative position in the total-order multiindex set.

◆ get_invmindex_ord()

int get_invmindex_ord ( Array1D< int >  mi)

Given a single multiindex, this returns its relative position in the total-order multiindex set among the bases of the same order.

◆ getOrders()

void getOrders ( Array2D< int > &  mindex,
Array1D< int > &  orders 
)

Given a multiindex set, it returns the orders of each basis term.

Note
Essentially, this function performs sums of each rows

◆ heap_ext_()

void heap_ext_ ( const int *  ,
const int *  ,
int *  ,
int *  ,
int *   
)

◆ is_admis()

bool is_admis ( Array1D< int > &  mindex_try,
Array2D< int > &  mindex 
)

A boolean check to see if a new basis term is admissible or not.

◆ upOrder()

void upOrder ( Array2D< int > &  mindex,
Array2D< int > &  new_mindex 
)

Given a multiindex set it computes a new multiindex set where only 'admissible' bases are added.

Note
A new basis is admissible, if by subtracting one order from any of the dimensions with non-zero order, one never leaves the set of old multiindices