queso-0.57.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Pages
QUESO::BaseScalarCovarianceFunction< V, M > Class Template Referenceabstract

A templated (base) class to accommodate scalar covariance functions (of random variables). More...

#include <ScalarCovarianceFunction.h>

Inheritance diagram for QUESO::BaseScalarCovarianceFunction< V, M >:
QUESO::ExponentialScalarCovarianceFunction< V, M > QUESO::GenericScalarCovarianceFunction< V, M >

Public Member Functions

Constructor/Destructor methods
 BaseScalarCovarianceFunction (const char *prefix, const VectorSet< V, M > &basicDomainSet)
 Default constructor. More...
 
virtual ~BaseScalarCovarianceFunction ()
 Virtual destructor. More...
 
Math methods
const VectorSet< V, M > & basicDomainSet () const
 Domain set; access to private attribute m_basicDomainSet. More...
 
virtual double value (const V &domainVector1, const V &domainVector2) const =0
 The value of the covariance function. See template specialization. More...
 

Protected Attributes

const BaseEnvironmentm_env
 
std::string m_prefix
 
const VectorSet< V, M > & m_basicDomainSet
 

Detailed Description

template<class V = GslVector, class M = GslMatrix>
class QUESO::BaseScalarCovarianceFunction< V, M >

A templated (base) class to accommodate scalar covariance functions (of random variables).

This class allows the mathematical definition of the covariance function of a random variable Covariance provides a measure of the strength of the correlation between two or more sets of random variates. The covariance for two random variates \( X \) and \( Y \), each with sample size \( N \), is defined by the expectation value: \( cov (X,Y) = <(X-\mu_X)(Y-\mu_Y)> = < X Y > - \mu_X \mu_Y \) where \( \mu_X \) and \( \mu_Y \) are the respective means, which can be written out explicitly as

\[ cov (X,Y) = \sum_{i=1}^{N} \frac{(x_i - \bar{x})(y_i - \bar{y})}{N}\]

Definition at line 53 of file ScalarCovarianceFunction.h.

Constructor & Destructor Documentation

template<class V , class M >
QUESO::BaseScalarCovarianceFunction< V, M >::BaseScalarCovarianceFunction ( const char *  prefix,
const VectorSet< V, M > &  basicDomainSet 
)

Default constructor.

Instantiates an object of the class given a prefix and the domain set.

Definition at line 31 of file ScalarCovarianceFunction.C.

References QUESO::BaseEnvironment::displayVerbosity(), QUESO::BaseScalarCovarianceFunction< V, M >::m_env, QUESO::BaseScalarCovarianceFunction< V, M >::m_prefix, and QUESO::BaseEnvironment::subDisplayFile().

34  :
35  m_env (basicDomainSet.env()),
36  m_prefix ((std::string)(prefix)+"cov_func_"),
38 {
39  if ((m_env.subDisplayFile()) && (m_env.displayVerbosity() >= 54)) {
40  *m_env.subDisplayFile() << "Entering BaseScalarCovarianceFunction<V,M>::constructor()"
41  << ": prefix = " << m_prefix
42  << std::endl;
43  }
44 
45  if ((m_env.subDisplayFile()) && (m_env.displayVerbosity() >= 54)) {
46  *m_env.subDisplayFile() << "Leaving BaseScalarCovarianceFunction<V,M>::constructor()"
47  << ": prefix = " << m_prefix
48  << std::endl;
49  }
50 }
unsigned int displayVerbosity() const
Definition: Environment.C:450
const VectorSet< V, M > & basicDomainSet() const
Domain set; access to private attribute m_basicDomainSet.
std::ofstream * subDisplayFile() const
Access function for m_subDisplayFile (displays file on stream).
Definition: Environment.C:320
template<class V , class M >
QUESO::BaseScalarCovarianceFunction< V, M >::~BaseScalarCovarianceFunction ( )
virtual

Virtual destructor.

Definition at line 53 of file ScalarCovarianceFunction.C.

54 {
55  if ((m_env.subDisplayFile()) && (m_env.displayVerbosity() >= 54)) {
56  *m_env.subDisplayFile() << "Entering BaseScalarCovarianceFunction<V,M>::destructor()"
57  << ": prefix = " << m_prefix
58  << std::endl;
59  }
60 
61  if ((m_env.subDisplayFile()) && (m_env.displayVerbosity() >= 54)) {
62  *m_env.subDisplayFile() << "Leaving BaseScalarCovarianceFunction<V,M>::destructor()"
63  << ": prefix = " << m_prefix
64  << std::endl;
65  }
66 }
unsigned int displayVerbosity() const
Definition: Environment.C:450
std::ofstream * subDisplayFile() const
Access function for m_subDisplayFile (displays file on stream).
Definition: Environment.C:320

Member Function Documentation

template<class V , class M >
const VectorSet< V, M > & QUESO::BaseScalarCovarianceFunction< V, M >::basicDomainSet ( ) const

Domain set; access to private attribute m_basicDomainSet.

Definition at line 70 of file ScalarCovarianceFunction.C.

71 {
72  return m_basicDomainSet;
73 }
template<class V = GslVector, class M = GslMatrix>
virtual double QUESO::BaseScalarCovarianceFunction< V, M >::value ( const V &  domainVector1,
const V &  domainVector2 
) const
pure virtual

The value of the covariance function. See template specialization.

Implemented in QUESO::ExponentialScalarCovarianceFunction< V, M >, and QUESO::GenericScalarCovarianceFunction< V, M >.

Member Data Documentation

template<class V = GslVector, class M = GslMatrix>
const VectorSet<V,M>& QUESO::BaseScalarCovarianceFunction< V, M >::m_basicDomainSet
protected

Definition at line 78 of file ScalarCovarianceFunction.h.


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

Generated on Tue Jun 5 2018 19:49:36 for queso-0.57.1 by  doxygen 1.8.5