queso-0.57.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Pages
QUESO::GenericVectorFunction< P_V, P_M, Q_V, Q_M > Class Template Reference

A class for handling generic vector functions. More...

#include <GenericVectorFunction.h>

Inheritance diagram for QUESO::GenericVectorFunction< P_V, P_M, Q_V, Q_M >:
QUESO::BaseVectorFunction< P_V, P_M, Q_V, Q_M >

Public Member Functions

Constructor/Destructor methods
 GenericVectorFunction (const char *prefix, const VectorSet< P_V, P_M > &domainSet, const VectorSet< Q_V, Q_M > &imageSet, void(*routinePtr)(const P_V &domainVector, const P_V *domainDirection, const void *functionDataPtr, Q_V &imageVector, DistArray< P_V * > *gradVectors, DistArray< P_M * > *hessianMatrices, DistArray< P_V * > *hessianEffects), const void *functionDataPtr)
 Default constructor. More...
 
virtual ~GenericVectorFunction ()
 Virtual destructor. More...
 
Mathematical method
void compute (const P_V &domainVector, const P_V *domainDirection, Q_V &imageVector, DistArray< P_V * > *gradVectors, DistArray< P_M * > *hessianMatrices, DistArray< P_V * > *hessianEffects) const
 Calls the protected member *m_routinePtr(), in order to calculate the image vector imageVector. More...
 
- Public Member Functions inherited from QUESO::BaseVectorFunction< P_V, P_M, Q_V, Q_M >
 BaseVectorFunction (const char *prefix, const VectorSet< P_V, P_M > &domainSet, const VectorSet< Q_V, Q_M > &imageSet)
 Default Constructor. More...
 
virtual ~BaseVectorFunction ()
 Destructor. More...
 
const VectorSet< P_V, P_M > & domainSet () const
 Access to the protected attribute m_domainSet: domain set of the vector function. It is an instance of the class VectorSet. More...
 
const VectorSet< Q_V, Q_M > & imageSet () const
 Access to the protected attribute m_imageSet: image set of the vector function/ It is an instance of the class VectorSet. More...
 

Protected Attributes

void(* m_routinePtr )(const P_V &domainVector, const P_V *domainDirection, const void *functionDataPtr, Q_V &imageVector, DistArray< P_V * > *gradVectors, DistArray< P_M * > *hessianMatrices, DistArray< P_V * > *hessianEffects)
 Routine defining a vector-valued function. More...
 
const void * m_routineDataPtr
 
- Protected Attributes inherited from QUESO::BaseVectorFunction< P_V, P_M, Q_V, Q_M >
const BaseEnvironmentm_env
 
std::string m_prefix
 
const VectorSet< P_V, P_M > & m_domainSet
 Domain set of the vector function. More...
 
const VectorSet< Q_V, Q_M > & m_imageSet
 Image set of the vector function. More...
 

Detailed Description

template<class P_V = GslVector, class P_M = GslMatrix, class Q_V = GslVector, class Q_M = GslMatrix>
class QUESO::GenericVectorFunction< P_V, P_M, Q_V, Q_M >

A class for handling generic vector functions.

This class allows the mathematical definition of a vector function such as: \( \mathbf{q}: B \subset R^n \rightarrow R^m \). It is derived from BaseVectorFunction.

Definition at line 47 of file GenericVectorFunction.h.

Constructor & Destructor Documentation

template<class P_V , class P_M , class Q_V , class Q_M >
QUESO::GenericVectorFunction< P_V, P_M, Q_V, Q_M >::GenericVectorFunction ( const char *  prefix,
const VectorSet< P_V, P_M > &  domainSet,
const VectorSet< Q_V, Q_M > &  imageSet,
void(*)(const P_V &domainVector, const P_V *domainDirection, const void *functionDataPtr, Q_V &imageVector, DistArray< P_V * > *gradVectors, DistArray< P_M * > *hessianMatrices, DistArray< P_V * > *hessianEffects)  routinePtr,
const void *  functionDataPtr 
)

Default constructor.

Instantiates an object of this class given its prefix, domain and a pointer to a routine. This routine plays the role of a vector-valued function, and it is useful, for instance, to calculate the likelihood (and its image set).

Definition at line 33 of file GenericVectorFunction.C.

45  :
46  BaseVectorFunction<P_V,P_M,Q_V,Q_M>(((std::string)(prefix)+"gen").c_str(),
47  domainSet,
48  imageSet),
49  m_routinePtr (routinePtr),
50  m_routineDataPtr(functionDataPtr)
51 {
52 }
const VectorSet< Q_V, Q_M > & imageSet() const
Access to the protected attribute m_imageSet: image set of the vector function/ It is an instance of ...
void(* m_routinePtr)(const P_V &domainVector, const P_V *domainDirection, const void *functionDataPtr, Q_V &imageVector, DistArray< P_V * > *gradVectors, DistArray< P_M * > *hessianMatrices, DistArray< P_V * > *hessianEffects)
Routine defining a vector-valued function.
const VectorSet< P_V, P_M > & domainSet() const
Access to the protected attribute m_domainSet: domain set of the vector function. It is an instance o...
template<class P_V , class P_M , class Q_V , class Q_M >
QUESO::GenericVectorFunction< P_V, P_M, Q_V, Q_M >::~GenericVectorFunction ( )
virtual

Virtual destructor.

Definition at line 56 of file GenericVectorFunction.C.

57 {
58 }

Member Function Documentation

template<class P_V , class P_M , class Q_V , class Q_M >
void QUESO::GenericVectorFunction< P_V, P_M, Q_V, Q_M >::compute ( const P_V &  domainVector,
const P_V *  domainDirection,
Q_V &  imageVector,
DistArray< P_V * > *  gradVectors,
DistArray< P_M * > *  hessianMatrices,
DistArray< P_V * > *  hessianEffects 
) const
virtual

Calls the protected member *m_routinePtr(), in order to calculate the image vector imageVector.

Implements QUESO::BaseVectorFunction< P_V, P_M, Q_V, Q_M >.

Definition at line 63 of file GenericVectorFunction.C.

70 {
71 
72  // domainVector.env().worldRank(),
73  // "GenericVectorFunction<P_V,P_M,Q_V,Q_M>::compute()",
74  // "this method should not be called in the case of this class");
75 
76  m_routinePtr(domainVector, domainDirection, m_routineDataPtr, imageVector, gradVectors, hessianMatrices, hessianEffects);
77 
78  return;
79 }
void(* m_routinePtr)(const P_V &domainVector, const P_V *domainDirection, const void *functionDataPtr, Q_V &imageVector, DistArray< P_V * > *gradVectors, DistArray< P_M * > *hessianMatrices, DistArray< P_V * > *hessianEffects)
Routine defining a vector-valued function.

Member Data Documentation

template<class P_V = GslVector, class P_M = GslMatrix, class Q_V = GslVector, class Q_M = GslMatrix>
const void* QUESO::GenericVectorFunction< P_V, P_M, Q_V, Q_M >::m_routineDataPtr
protected

Definition at line 95 of file GenericVectorFunction.h.

template<class P_V = GslVector, class P_M = GslMatrix, class Q_V = GslVector, class Q_M = GslMatrix>
void(* QUESO::GenericVectorFunction< P_V, P_M, Q_V, Q_M >::m_routinePtr)(const P_V &domainVector, const P_V *domainDirection, const void *functionDataPtr, Q_V &imageVector, DistArray< P_V * > *gradVectors, DistArray< P_M * > *hessianMatrices, DistArray< P_V * > *hessianEffects)
protected

Routine defining a vector-valued function.

The presence of the parameters gradVectors, hessianMatrices and hessianEffects allows the user to calculate gradient vectors, Hessian matrices and Hessian effects; which can hold important information about her/his statistical application. Used, for instance to define the likelihood.

Definition at line 88 of file GenericVectorFunction.h.


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

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