queso-0.53.0
Protected Attributes | List of all members
QUESO::BaseScalarCdf< T > Class Template Referenceabstract

A templated (base) class for handling CDFs. More...

#include <ScalarCdf.h>

Inheritance diagram for QUESO::BaseScalarCdf< T >:
Inheritance graph
[legend]
Collaboration diagram for QUESO::BaseScalarCdf< T >:
Collaboration graph
[legend]

Public Member Functions

Constructor/Destructor methods
 BaseScalarCdf (const BaseEnvironment &env, const char *prefix)
 Default constructor. More...
 
virtual ~BaseScalarCdf ()
 Virtual destructor. More...
 
Environment methods
const BaseEnvironmentenv () const
 Environment. Access to private attribute m_env. More...
 
const std::string & prefix () const
 Access to private attribute m_prefix. More...
 
Mathematical methods
virtual double value (T paramValue) const =0
 Returns the value of the CDF at paramValue. See template specialization. More...
 
virtual T inverse (double cdfValue) const =0
 Returns the position of a given value of CDF. See template specialization. More...
 
virtual void getSupport (T &minHorizontal, T &maxHorizontal) const =0
 Returns the support (image) of the CDF between two horizontal values (domain). See template specialization. More...
 

Protected Attributes

const BaseEnvironmentm_env
 
std::string m_prefix
 
m_minHorizontal
 
m_maxHorizontal
 

I/O methods

virtual void print (std::ostream &os) const =0
 Prints the CDF. See template specialization. More...
 
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. More...
 
std::ostream & operator<< (std::ostream &os, const BaseScalarCdf< T > &obj)
 

Detailed Description

template<class T>
class QUESO::BaseScalarCdf< T >

A templated (base) class for handling CDFs.

This class allows the mathematical definition of a cumulative distribution function (CDF), which is a scalar function such as * $ f: B \subset R \rightarrow C \subset R $; ie a function of one or more variables that has always one-dimensional range, which for the specific CDF case, the image set $ C = [0,1]$. The CDF describes the probability that a real-valued random variable X with a given probability distribution will be found at a value less than or equal to x. In the case of a continuous distribution, it gives the area under the probability density function (PDF) from minus infinity to x.

Definition at line 49 of file ScalarCdf.h.

Constructor & Destructor Documentation

template<class T >
QUESO::BaseScalarCdf< T >::BaseScalarCdf ( const BaseEnvironment env,
const char *  prefix 
)

Default constructor.

Instantiates an object of the class given a prefix and the environment.

Definition at line 31 of file ScalarCdf.C.

References QUESO::BaseEnvironment::displayVerbosity(), QUESO::BaseScalarCdf< T >::m_env, QUESO::BaseScalarCdf< T >::m_prefix, and QUESO::BaseEnvironment::subDisplayFile().

34  :
35  m_env (env),
36  m_prefix ((std::string)(prefix)+""),
37  m_minHorizontal(-INFINITY),
38  m_maxHorizontal( INFINITY)
39 {
40  if ((m_env.subDisplayFile()) && (m_env.displayVerbosity() >= 5)) {
41  *m_env.subDisplayFile() << "Entering BaseScalarCdf<T>::constructor()"
42  << ": prefix = " << m_prefix
43  << std::endl;
44  }
45 
46  if ((m_env.subDisplayFile()) && (m_env.displayVerbosity() >= 5)) {
47  *m_env.subDisplayFile() << "Leaving BaseScalarCdf<T>::constructor()"
48  << ": prefix = " << m_prefix
49  << std::endl;
50  }
51 }
unsigned int displayVerbosity() const
Definition: Environment.C:396
const BaseEnvironment & m_env
Definition: ScalarCdf.h:99
std::string m_prefix
Definition: ScalarCdf.h:100
const std::string & prefix() const
Access to private attribute m_prefix.
Definition: ScalarCdf.C:67
std::ofstream * subDisplayFile() const
Access function for m_subDisplayFile (displays file on stream).
Definition: Environment.C:274
const BaseEnvironment & env() const
Environment. Access to private attribute m_env.
Definition: ScalarCdf.C:60
template<class T >
QUESO::BaseScalarCdf< T >::~BaseScalarCdf ( )
virtual

Virtual destructor.

Definition at line 54 of file ScalarCdf.C.

55 {
56 }

Member Function Documentation

template<class T >
const BaseEnvironment & QUESO::BaseScalarCdf< T >::env ( ) const

Environment. Access to private attribute m_env.

Definition at line 60 of file ScalarCdf.C.

Referenced by QUESO::horizontalDistance(), and QUESO::StdScalarCdf< T >::StdScalarCdf().

61 {
62  return m_env;
63 }
const BaseEnvironment & m_env
Definition: ScalarCdf.h:99
template<class T>
virtual void QUESO::BaseScalarCdf< T >::getSupport ( T &  minHorizontal,
T &  maxHorizontal 
) const
pure virtual

Returns the support (image) of the CDF between two horizontal values (domain). See template specialization.

Implemented in QUESO::StdScalarCdf< T >, and QUESO::SampledScalarCdf< T >.

template<class T>
virtual T QUESO::BaseScalarCdf< T >::inverse ( double  cdfValue) const
pure virtual

Returns the position of a given value of CDF. See template specialization.

Implemented in QUESO::StdScalarCdf< T >, and QUESO::SampledScalarCdf< T >.

Referenced by QUESO::horizontalDistance().

template<class T >
const std::string & QUESO::BaseScalarCdf< T >::prefix ( ) const

Access to private attribute m_prefix.

Definition at line 67 of file ScalarCdf.C.

Referenced by QUESO::horizontalDistance(), and QUESO::StdScalarCdf< T >::StdScalarCdf().

68 {
69  return m_prefix;
70 }
std::string m_prefix
Definition: ScalarCdf.h:100
template<class T>
virtual void QUESO::BaseScalarCdf< T >::print ( std::ostream &  os) const
pure virtual

Prints the CDF. See template specialization.

Implemented in QUESO::StdScalarCdf< T >, and QUESO::SampledScalarCdf< T >.

template<class T >
void QUESO::BaseScalarCdf< T >::subWriteContents ( const std::string &  varNamePrefix,
const std::string &  fileName,
const std::string &  fileType,
const std::set< unsigned int > &  allowedSubEnvIds 
) const
virtual

Writes the CDF of an allowed sub-environment to a file.

This function does nothing and should
not be called by the user.

Reimplemented in QUESO::StdScalarCdf< T >, and QUESO::SampledScalarCdf< T >.

Definition at line 74 of file ScalarCdf.C.

79 {
80  std::cerr << "WARNING: BaseScalarCdf<T>::subWriteContents() being used..."
81  << std::endl;
82  return;
83 }
template<class T>
virtual double QUESO::BaseScalarCdf< T >::value ( paramValue) const
pure virtual

Returns the value of the CDF at paramValue. See template specialization.

Implemented in QUESO::StdScalarCdf< T >, and QUESO::SampledScalarCdf< T >.

Referenced by QUESO::horizontalDistance().

Friends And Related Function Documentation

template<class T>
std::ostream& operator<< ( std::ostream &  os,
const BaseScalarCdf< T > &  obj 
)
friend

Definition at line 85 of file ScalarCdf.h.

86  {
87  obj.print(os);
88  return os;
89  }

Member Data Documentation

template<class T>
const BaseEnvironment& QUESO::BaseScalarCdf< T >::m_env
protected
template<class T>
T QUESO::BaseScalarCdf< T >::m_maxHorizontal
mutableprotected

Definition at line 102 of file ScalarCdf.h.

template<class T>
T QUESO::BaseScalarCdf< T >::m_minHorizontal
mutableprotected

Definition at line 101 of file ScalarCdf.h.

template<class T>
std::string QUESO::BaseScalarCdf< T >::m_prefix
protected

The documentation for this class was generated from the following files:

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