UQTk: Uncertainty Quantification Toolkit  3.1.1
multiindex.h
Go to the documentation of this file.
1 /* =====================================================================================
2 
3  The UQ Toolkit (UQTk) version 3.1.1
4  Copyright (2021) NTESS
5  https://www.sandia.gov/UQToolkit/
6  https://github.com/sandialabs/UQTk
7 
8  Copyright 2021 National Technology & Engineering Solutions of Sandia, LLC (NTESS).
9  Under the terms of Contract DE-NA0003525 with NTESS, the U.S. Government
10  retains certain rights in this software.
11 
12  This file is part of The UQ Toolkit (UQTk)
13 
14  UQTk is open source software: you can redistribute it and/or modify
15  it under the terms of BSD 3-Clause License
16 
17  UQTk is distributed in the hope that it will be useful,
18  but WITHOUT ANY WARRANTY; without even the implied warranty of
19  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20  BSD 3 Clause License for more details.
21 
22  You should have received a copy of the BSD 3 Clause License
23  along with UQTk. If not, see https://choosealicense.com/licenses/bsd-3-clause/.
24 
25  Questions? Contact the UQTk Developers at <uqtk-developers@software.sandia.gov>
26  Sandia National Laboratories, Livermore, CA, USA
27 ===================================================================================== */
28 #ifndef MULTIINDEX_H
29 #define MULTIINDEX_H
30 
31 #include "Array1D.h"
32 #include "Array2D.h"
33 
34 
40 extern "C" void heap_ext_(const int *,const int *, int *, int *, int *);
41 
45 int computeNPCTerms(int ndim,int norder);
46 
50 int computeMultiIndex(int ndim,int norder, Array2D<int> &mi);
51 
57 int computeMultiIndexT(int ndim,int norder, int *mi);
58 
62 int computeMultiIndex(int ndim,int norder, Array2D<int> &mi, string ordtype);
63 
64 
68 int computeMultiIndexTP(Array1D<int>& maxorders, Array2D<int>& mindex);
69 
73 int computeNPCTermsHDMR(int ndim, Array1D<int>& maxorders);
74 
78 int computeMultiIndexHDMR(int ndim, Array1D<int>& maxorders,Array2D<int>& mindex);
79 
83 void decodeMindex(Array1D< Array2D<int> >& sp_mindex, int ndim, Array2D<int>& mindex);
84 
85 
89 void upOrder(Array2D<int>& mindex,Array2D<int>& new_mindex);
90 
92 bool is_admis(Array1D<int>& mindex_try,Array2D<int>& mindex);
93 
96 void getOrders(Array2D<int>& mindex,Array1D<int>& orders);
97 
100 
103 
104 
105 #endif // MULTIINDEX_H
1D Array class for any type T
2D Array class for any type T
Definition: Array1D.h:262
Stores data of any type T in a 1D array.
Definition: Array1D.h:61
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 ...
Definition: multiindex.cpp:116
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 pe...
Definition: multiindex.cpp:381
int computeNPCTerms(int ndim, int norder)
Computes the number of PC basis terms for Total-Order truncation with a given dimensionality and orde...
Definition: multiindex.cpp:40
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 maxorde...
Definition: multiindex.cpp:431
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 ...
Definition: multiindex.cpp:61
int get_invmindex_ord(Array1D< int > mi)
Given a single multiindex, this returns its relative position in the total-order multiindex set among...
Definition: multiindex.cpp:600
void heap_ext_(const int *, const int *, int *, int *, int *)
bool is_admis(Array1D< int > &mindex_try, Array2D< int > &mindex)
A boolean check to see if a new basis term is admissible or not.
Definition: multiindex.cpp:488
void decodeMindex(Array1D< Array2D< int > > &sp_mindex, int ndim, Array2D< int > &mindex)
Decode a multiindex set from a sparse format to a regular format.
Definition: multiindex.cpp:464
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.
Definition: multiindex.cpp:526
int get_invmindex(Array1D< int > mi)
Given a single multiindex, this returns its relative position in the total-order multiindex set.
Definition: multiindex.cpp:583
void getOrders(Array2D< int > &mindex, Array1D< int > &orders)
Given a multiindex set, it returns the orders of each basis term.
Definition: multiindex.cpp:564
int computeNPCTermsHDMR(int ndim, Array1D< int > &maxorders)
Computes the number of PC basis terms for HDMR truncation with a given dimensionality and maxorders a...
Definition: multiindex.cpp:418