queso-0.53.0
StdScalarCdf.h
Go to the documentation of this file.
1 //-----------------------------------------------------------------------bl-
2 //--------------------------------------------------------------------------
3 //
4 // QUESO - a library to support the Quantification of Uncertainty
5 // for Estimation, Simulation and Optimization
6 //
7 // Copyright (C) 2008-2015 The PECOS Development Team
8 //
9 // This library is free software; you can redistribute it and/or
10 // modify it under the terms of the Version 2.1 GNU Lesser General
11 // Public License as published by the Free Software Foundation.
12 //
13 // This library is distributed in the hope that it will be useful,
14 // but WITHOUT ANY WARRANTY; without even the implied warranty of
15 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 // Lesser General Public License for more details.
17 //
18 // You should have received a copy of the GNU Lesser General Public
19 // License along with this library; if not, write to the Free Software
20 // Foundation, Inc. 51 Franklin Street, Fifth Floor,
21 // Boston, MA 02110-1301 USA
22 //
23 //-----------------------------------------------------------------------el-
24 
25 #ifndef UQ_STD_CUMULATIVE_DISTRIBUTION_FUNCTION_H
26 #define UQ_STD_CUMULATIVE_DISTRIBUTION_FUNCTION_H
27 
28 #include <queso/StdOneDGrid.h>
29 #include <queso/Environment.h>
30 #include <queso/ScalarCdf.h>
31 #include <queso/SampledScalarCdf.h>
32 #include <math.h>
33 
34 namespace QUESO {
35 
36 //*****************************************************
37 // Std cumulative distribution function class
38 //*****************************************************
47 template <class T>
48 class StdScalarCdf : public BaseScalarCdf<T> {
49 public:
51 
52 
56  const char* prefix,
57  const std::vector<T>& cdfGrid,
58  const std::vector<double>& cdfValues);
60  ~StdScalarCdf();
62 
64 
65  double value (T paramValue) const;
67 
69  T inverse (double cdfValue ) const;
70 
72  void getSupport (T& minHorizontal, T& maxHorizontal) const;
74 
76 
77  void print (std::ostream& os ) const;
79 
81 
82  void subWriteContents(const std::string& varNamePrefix,
83  const std::string& fileName,
84  const std::string& fileType,
85  const std::set<unsigned int>& allowedSubEnvIds) const;
87 protected:
92 
94  const std::vector<double> m_cdfValues;
96 };
97 
98 } // End namespace QUESO
99 
100 #endif // UQ_STD_CUMULATIVE_DISTRIBUTION_FUNCTION_H
SampledScalarCdf< T > * m_sampledCdfGrid
Definition: StdScalarCdf.h:95
A class for handling standard CDFs.
Definition: StdScalarCdf.h:48
A templated (base) class for handling CDFs.
Definition: ScalarCdf.h:49
T inverse(double cdfValue) const
Returns the position of a given value of CDF.
Definition: StdScalarCdf.C:72
Class for accommodating standard one-dimensional grids.
Definition: StdOneDGrid.h:45
const std::vector< double > m_cdfValues
Definition: StdScalarCdf.h:94
double value(T paramValue) const
Returns the value of the CDF at paramValue.
Definition: StdScalarCdf.C:65
const std::string & prefix() const
Access to private attribute m_prefix.
Definition: ScalarCdf.C:67
StdScalarCdf(const BaseEnvironment &env, const char *prefix, const std::vector< T > &cdfGrid, const std::vector< double > &cdfValues)
Default constructor.
Definition: StdScalarCdf.C:31
This (virtual) class sets up the environment underlying the use of the QUESO library by an executable...
Definition: Environment.h:193
void getSupport(T &minHorizontal, T &maxHorizontal) const
Returns the support (image) of the CDF between two horizontal values (domain).
Definition: StdScalarCdf.C:79
void print(std::ostream &os) const
Prints the CDF (values of the grid points and of the CDF at such grid points).
Definition: StdScalarCdf.C:86
const StdOneDGrid< T > m_cdfGrid
Definition: StdScalarCdf.h:93
~StdScalarCdf()
Destructor.
Definition: StdScalarCdf.C:58
A class for handling sampled CDFs.
const BaseEnvironment & env() const
Environment. Access to private attribute m_env.
Definition: ScalarCdf.C:60
void subWriteContents(const std::string &varNamePrefix, const std::string &fileName, const std::string &fileType, const std::set< unsigned int > &allowedSubEnvIds) const
Writes the CDF of an allowed sub-environment to a file.
Definition: StdScalarCdf.C:94

Generated on Thu Jun 11 2015 13:52:32 for queso-0.53.0 by  doxygen 1.8.5