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

A class for generic covariances. More...

#include <GenericScalarCovarianceFunction.h>

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

Public Member Functions

Constructor/Destructor methods
 GenericScalarCovarianceFunction (const char *prefix, const VectorSet< V, M > &domainSet, double(*covRoutinePtr)(const V &positionVector1, const V &positionVector2, const void *routineDataPtr), const void *routinesDataPtr)
 Default constructor. More...
 
virtual ~GenericScalarCovarianceFunction ()
 Virtual destructor. More...
 
- Public Member Functions inherited from QUESO::BaseScalarCovarianceFunction< V, M >
 BaseScalarCovarianceFunction (const char *prefix, const VectorSet< V, M > &basicDomainSet)
 Default constructor. More...
 
virtual ~BaseScalarCovarianceFunction ()
 Virtual destructor. More...
 
const VectorSet< V, M > & basicDomainSet () const
 Domain set; access to private attribute m_basicDomainSet. More...
 

Math methods

double(* m_covRoutinePtr )(const V &positionVector1, const V &positionVector2, const void *routineDataPtr)
 
const void * m_routineDataPtr
 
double value (const V &positionVector1, const V &positionVector2) const
 Calculates the value of the generic covariance function. More...
 

Additional Inherited Members

- Protected Attributes inherited from QUESO::BaseScalarCovarianceFunction< V, M >
const BaseEnvironmentm_env
 
std::string m_prefix
 
const VectorSet< V, M > & m_basicDomainSet
 

Detailed Description

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

A class for generic covariances.

This class implements a generic covariance functions, by calling a routine (via pointer).

Definition at line 48 of file GenericScalarCovarianceFunction.h.

Constructor & Destructor Documentation

template<class V , class M >
QUESO::GenericScalarCovarianceFunction< V, M >::GenericScalarCovarianceFunction ( const char *  prefix,
const VectorSet< V, M > &  domainSet,
double(*)(const V &positionVector1, const V &positionVector2, const void *routineDataPtr)  covRoutinePtr,
const void *  routinesDataPtr 
)

Default constructor.

Instantiates an object of the class given a prefix, the domain set, the pointer to the routine.

Definition at line 31 of file GenericScalarCovarianceFunction.C.

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

36  :
37  BaseScalarCovarianceFunction<V,M>(prefix,domainSet),
38  m_covRoutinePtr (covRoutinePtr),
39  m_routineDataPtr (routinesDataPtr)
40 {
41  if ((m_env.subDisplayFile()) && (m_env.displayVerbosity() >= 54)) {
42  *m_env.subDisplayFile() << "Entering GenericScalarCovarianceFunction<V,M>::constructor()"
43  << ": prefix = " << m_prefix
44  << std::endl;
45  }
46 
47  if ((m_env.subDisplayFile()) && (m_env.displayVerbosity() >= 54)) {
48  *m_env.subDisplayFile() << "Leaving GenericScalarCovarianceFunction<V,M>::constructor()"
49  << ": prefix = " << m_prefix
50  << std::endl;
51  }
52 }
double(* m_covRoutinePtr)(const V &positionVector1, const V &positionVector2, const void *routineDataPtr)
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
template<class V , class M >
QUESO::GenericScalarCovarianceFunction< V, M >::~GenericScalarCovarianceFunction ( )
virtual

Virtual destructor.

Definition at line 55 of file GenericScalarCovarianceFunction.C.

56 {
57  if ((m_env.subDisplayFile()) && (m_env.displayVerbosity() >= 54)) {
58  *m_env.subDisplayFile() << "Entering GenericScalarCovarianceFunction<V,M>::destructor()"
59  << ": prefix = " << m_prefix
60  << std::endl;
61  }
62 
63  if ((m_env.subDisplayFile()) && (m_env.displayVerbosity() >= 54)) {
64  *m_env.subDisplayFile() << "Leaving GenericScalarCovarianceFunction<V,M>::destructor()"
65  << ": prefix = " << m_prefix
66  << std::endl;
67  }
68 }
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 >
double QUESO::GenericScalarCovarianceFunction< V, M >::value ( const V &  positionVector1,
const V &  positionVector2 
) const
virtual

Calculates the value of the generic covariance function.

This function accesses the routine that calculates the covariance function.

Implements QUESO::BaseScalarCovarianceFunction< V, M >.

Definition at line 72 of file GenericScalarCovarianceFunction.C.

73 {
74  if ((m_env.subDisplayFile()) && (m_env.displayVerbosity() >= 54)) {
75  *m_env.subDisplayFile() << "Entering GenericScalarCovarianceFunction<V,M>::value()"
76  << std::endl;
77  }
78 
79  queso_require_msg(m_covRoutinePtr, "m_covRoutinePtr = NULL");
80 
81  double result = m_covRoutinePtr(positionVector1, positionVector2, m_routineDataPtr);
82 
83  if ((m_env.subDisplayFile()) && (m_env.displayVerbosity() >= 54)) {
84  *m_env.subDisplayFile() << "Leaving GenericScalarCovarianceFunction<V,M>::value()"
85  << std::endl;
86  }
87 
88  return result;
89 }
double(* m_covRoutinePtr)(const V &positionVector1, const V &positionVector2, const void *routineDataPtr)
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 Data Documentation

template<class V = GslVector, class M = GslMatrix>
double(* QUESO::GenericScalarCovarianceFunction< V, M >::m_covRoutinePtr)(const V &positionVector1, const V &positionVector2, const void *routineDataPtr)
protected

Definition at line 73 of file GenericScalarCovarianceFunction.h.

template<class V = GslVector, class M = GslMatrix>
const void* QUESO::GenericScalarCovarianceFunction< V, M >::m_routineDataPtr
protected

Definition at line 74 of file GenericScalarCovarianceFunction.h.


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

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