queso-0.52.0
VectorCdf.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_VECTOR_CUMULATIVE_DISTRIBUTION_FUNCTION_H
26 #define UQ_VECTOR_CUMULATIVE_DISTRIBUTION_FUNCTION_H
27 
28 #include <queso/ArrayOfOneDGrids.h>
29 #include <queso/ArrayOfOneDTables.h>
30 #include <queso/ScalarCdf.h>
31 #include <queso/SampledScalarCdf.h>
32 #include <queso/Environment.h>
33 #include <math.h>
34 
35 namespace QUESO {
36 
37 //*****************************************************
38 // Classes to accommodate a cumulative distribution function
39 //*****************************************************
52 //*****************************************************
53 // Base class
54 //*****************************************************
55 template<class V, class M>
57 public:
59 
60 
63  BaseVectorCdf(const char* prefix,
64  const VectorSet<V,M>& pdfSupport);
65 
67  virtual ~BaseVectorCdf();
69 
71 
72  const VectorSet<V,M>& pdfSupport () const;
74 
76  virtual void values (const V& paramValues, V& cdfVec) const = 0;
77 
79  virtual const BaseScalarCdf<double>& cdf (unsigned int rowId) const = 0;
81 
83 
84  virtual void print (std::ostream& os) const = 0;
86  friend std::ostream& operator<< (std::ostream& os,
87  const BaseVectorCdf<V,M>& obj) {
88  obj.print(os);
89  return os;
90  }
91 
93 
94  virtual void subWriteContents(const std::string& varNamePrefix,
95  const std::string& fileName,
96  const std::string& fileType,
97  const std::set<unsigned int>& allowedSubEnvIds) const;
99 protected:
100 
102  std::string m_prefix;
104 };
105 
106 //---------------------------------------------------
107 // Method outside either class definition------------
108 //---------------------------------------------------
110 //
111 template <class V, class M>
112 void
114  const BaseVectorCdf<V,M>& cdf2,
115  const V& epsilonVec,
116  V& distances);
117 
118 } // End namespace QUESO
119 
120 #endif // UQ_VECTOR_CUMULATIVE_DISTRIBUTION_FUNCTION_H
A templated (base) class for handling CDFs.
Definition: ScalarCdf.h:56
const BaseEnvironment & m_env
Definition: VectorCdf.h:101
virtual void print(std::ostream &os) const =0
Prints the vector CDF. See template specialization.
A templated class for handling sets.
Definition: VectorSet.h:49
const VectorSet< V, M > & m_pdfSupport
Definition: VectorCdf.h:103
This (virtual) class sets up the environment underlying the use of the QUESO library by an executable...
Definition: Environment.h:187
BaseVectorCdf(const char *prefix, const VectorSet< V, M > &pdfSupport)
Default constructor.
Definition: VectorCdf.C:31
friend std::ostream & operator<<(std::ostream &os, const BaseVectorCdf< V, M > &obj)
Definition: VectorCdf.h:86
void horizontalDistances(const BaseVectorCdf< V, M > &cdf1, const BaseVectorCdf< V, M > &cdf2, const V &epsilonVec, V &distances)
It calculated the maximum horizontal distances between two vector CDFs.
Definition: VectorCdf.C:89
std::string m_prefix
Definition: VectorCdf.h:102
const VectorSet< V, M > & pdfSupport() const
Returns the image set (support) of the PDF; access to protected attribute m_pdfSupport.
Definition: VectorCdf.C:59
virtual 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: VectorCdf.C:66
virtual ~BaseVectorCdf()
Virtual destructor.
Definition: VectorCdf.C:53
virtual void values(const V &paramValues, V &cdfVec) const =0
Finds the value of the vector CDF at each element of paramValue, and saves it in cdfVec. See template specialization.
A templated (base) class for handling CDFs of vector functions.
Definition: VectorCdf.h:56
virtual const BaseScalarCdf< double > & cdf(unsigned int rowId) const =0

Generated on Thu Apr 23 2015 19:30:54 for queso-0.52.0 by  doxygen 1.8.5