UQTk: Uncertainty Quantification Toolkit  3.1.1
mrv.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 ===================================================================================== */
31 
32 #ifndef MRV_H_SEEN
33 #define MRV_H_SEEN
34 
35 #include "Array1D.h"
36 #include "Array2D.h"
37 #include "PCSet.h"
38 
39 #include <iostream>
40 #include <string.h>
41 #include <stdio.h>
42 #include <sstream>
43 
44 using namespace std; // needed for python string conversion
45 
47 
48 class Mrv {
49 public:
50 
52  Mrv(int ndim,string pdfType, Array1D<int> rndInd, int order,string pctype);
54  ~Mrv() {}
55 
56 
58  int Parametrize();
59 
62  void getBounds(Array1D<double>& lower, Array1D<double>& upper);
63 
65  int getPDim(){ return this->pDim_;}
66 
68  Array2D<double> getMultiPCcf(Array1D<double>& rvParams);
70  Array2D<double> evalMultiPC(Array2D<double>& xiSam, Array2D<double>& multiPCcf);
72  Array2D<double> mcParam(Array2D<double>& multiPCcf, int nsam);
74  Array2D<double> quadParam(Array2D<double>& multiPCcf);
76  Array2D<double> propNISP(Array2D<double> (*forwardFcn)(Array2D<double>&, Array2D<double>&, Array2D<double>&, void*), Array2D<double>& fixindnom,void* funcinfo, Array2D<double>& multiPCcf, Array2D<double>& x);
78  Array2D<double> propMC(Array2D<double> (*forwardFcn)(Array2D<double>&, Array2D<double>&, Array2D<double>&, void*), Array2D<double>& fixindnom,void* funcinfo,Array2D<double>& multiPCcf, Array2D<double>& x,int nsam);
80  void computeMoments(Array2D<double>& funcCf, Array1D<double>& fcnMean,Array1D<double>& fcnStd,bool covFlag, Array2D<double>& fcnCov);
81 
83  void getPCTermId(Array1D<int>& pctermid){pctermid=pctermId_; return;}
84 
85 private:
92 
94  string pdfType_;
96  string pcType_;
98  int pDim_;
100  int rDim_;
102  int nDim_;
104  int order_;
106  int nPC_;
109 
110 
111 
112 };
113 
114 /*******************************************************************/
115 /*******************************************************************/
116 /*******************************************************************/
117 
118 
119 #endif /* MRV_H_SEEN */
1D Array class for any type T
2D Array class for any type T
Header file for the Multivariate PC class.
Definition: Array1D.h:472
Definition: Array1D.h:262
multivariate RV parameterized by PC expansions
Definition: mrv.h:48
int getPDim()
Get dimensionailty of parameterization.
Definition: mrv.h:65
~Mrv()
Destructor.
Definition: mrv.h:54
PCSet * pcModel_
Pointer to the corresponding PC object.
Definition: mrv.h:108
int order_
Order of function PC representation.
Definition: mrv.h:104
int nDim_
Number of physical parameters lambda.
Definition: mrv.h:102
Array1D< int > rndInd_
Randomized parameters indices.
Definition: mrv.h:87
void getPCTermId(Array1D< int > &pctermid)
Get PC term ID.
Definition: mrv.h:83
Array1D< int > paramId_
For a given parameterization, id the corresponding physical parameter lambda.
Definition: mrv.h:89
Array1D< int > pctermId_
For a given parameterization, id the PC term/order for the corresponding parameter representation.
Definition: mrv.h:91
int nPC_
Number of PC parameters for each independent component.
Definition: mrv.h:106
int rDim_
Number of randomized parameters.
Definition: mrv.h:100
string pcType_
PC type (see pce library for options)
Definition: mrv.h:96
int pDim_
Number of parameters in alpha parameterization.
Definition: mrv.h:98
string pdfType_
PDF type ('pct', 'pci' or 'full')
Definition: mrv.h:94
Defines and initializes PC basis function set and provides functions to manipulate PC expansions defi...
Definition: PCSet.h:71