queso-0.53.0
Protected Attributes | List of all members
QUESO::BaseTKGroup< V, M > Class Template Referenceabstract

This base class allows the representation of a transition kernel. More...

#include <TKGroup.h>

Inheritance diagram for QUESO::BaseTKGroup< V, M >:
Inheritance graph
[legend]
Collaboration diagram for QUESO::BaseTKGroup< V, M >:
Collaboration graph
[legend]

Public Member Functions

Constructor/Destructor methods
 BaseTKGroup ()
 Default constructor. More...
 
 BaseTKGroup (const char *prefix, const VectorSpace< V, M > &vectorSpace, const std::vector< double > &scales)
 Constructor. More...
 
virtual ~BaseTKGroup ()
 Destructor. More...
 
Statistical/Mathematical methods
virtual bool symmetric () const =0
 Whether or not the matrix is symmetric. See template specialization. More...
 
virtual const BaseVectorRV< V,
M > & 
rv (unsigned int stageId) const =0
 Gaussian increment property to construct a transition kernel. See template specialization. More...
 
virtual const BaseVectorRV< V,
M > & 
rv (const std::vector< unsigned int > &stageIds)=0
 Gaussian increment property to construct a transition kernel. See template specialization. More...
 
Misc methods
const BaseEnvironmentenv () const
 QUESO's environment. More...
 
const V & preComputingPosition (unsigned int stageId) const
 Pre-computing position; access to protected attribute *m_preComputingPositions[stageId]. More...
 
virtual bool setPreComputingPosition (const V &position, unsigned int stageId)
 Sets the pre-computing positions m_preComputingPositions[stageId] with a new vector of size position. More...
 
virtual void clearPreComputingPositions ()
 Clears the pre-computing positions m_preComputingPositions[stageId]. More...
 
I/O methods
virtual void print (std::ostream &os) const
 TODO: Prints the transition kernel. More...
 

Protected Attributes

const EmptyEnvironmentm_emptyEnv
 
const BaseEnvironmentm_env
 
std::string m_prefix
 
const VectorSpace< V, M > * m_vectorSpace
 
std::vector< double > m_scales
 
std::vector< const V * > m_preComputingPositions
 
std::vector< BaseVectorRV< V,
M > * > 
m_rvs
 

Detailed Description

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

This base class allows the representation of a transition kernel.

The transition kernel is a conditional distribution function that represents the probability of moving from a point $ x \in R^n $ to a point in the set $ A \in B $, where $ B $ is a Borel set over $ R^n $. Since it is a distribution function, $ P(x,R^n)=1 $, where it is permitted that the chain can make a transition from the point $ x $ to $ x $, that is $ P(x, {x}) $ is not necessarily zero.

Definition at line 50 of file TKGroup.h.

Constructor & Destructor Documentation

template<class V , class M >
QUESO::BaseTKGroup< V, M >::BaseTKGroup ( )

Default constructor.

Definition at line 33 of file TKGroup.C.

34  :
35  m_emptyEnv (new EmptyEnvironment()),
36  m_env (*m_emptyEnv),
37  m_prefix (""),
38  m_vectorSpace (NULL),
39  m_scales (0),
41  m_rvs (0)
42 {
43 }
const EmptyEnvironment * m_emptyEnv
Definition: TKGroup.h:99
const VectorSpace< V, M > * m_vectorSpace
Definition: TKGroup.h:102
const BaseEnvironment & m_env
Definition: TKGroup.h:100
std::vector< const V * > m_preComputingPositions
Definition: TKGroup.h:104
std::vector< BaseVectorRV< V, M > * > m_rvs
Definition: TKGroup.h:105
std::vector< double > m_scales
Definition: TKGroup.h:103
std::string m_prefix
Definition: TKGroup.h:101
template<class V, class M>
QUESO::BaseTKGroup< V, M >::BaseTKGroup ( const char *  prefix,
const VectorSpace< V, M > &  vectorSpace,
const std::vector< double > &  scales 
)

Constructor.

Definition at line 46 of file TKGroup.C.

References QUESO::BaseTKGroup< V, M >::m_scales.

50  :
51  m_emptyEnv (NULL),
52  m_env (vectorSpace.env()),
53  m_prefix (prefix),
54  m_vectorSpace (&vectorSpace),
55  m_scales (scales.size(),1.),
56  m_preComputingPositions(scales.size()+1,NULL), // Yes, +1
57  m_rvs (scales.size(),NULL) // IMPORTANT: it stays like this for scaledTK, but it will be overwritten to '+1' by hessianTK constructor
58 {
59  for (unsigned int i = 0; i < m_scales.size(); ++i) {
60  m_scales[i] = scales[i];
61  }
62 }
const EmptyEnvironment * m_emptyEnv
Definition: TKGroup.h:99
const VectorSpace< V, M > * m_vectorSpace
Definition: TKGroup.h:102
const BaseEnvironment & m_env
Definition: TKGroup.h:100
std::vector< const V * > m_preComputingPositions
Definition: TKGroup.h:104
std::vector< BaseVectorRV< V, M > * > m_rvs
Definition: TKGroup.h:105
std::vector< double > m_scales
Definition: TKGroup.h:103
std::string m_prefix
Definition: TKGroup.h:101
template<class V , class M >
QUESO::BaseTKGroup< V, M >::~BaseTKGroup ( )
virtual

Destructor.

Definition at line 65 of file TKGroup.C.

66 {
67  for (unsigned int i = 0; i < m_rvs.size(); ++i) {
68  if (m_rvs[i]) delete m_rvs[i];
69  }
70  for (unsigned int i = 0; i < m_preComputingPositions.size(); ++i) {
72  }
73  if (m_emptyEnv) delete m_emptyEnv;
74 }
const EmptyEnvironment * m_emptyEnv
Definition: TKGroup.h:99
std::vector< const V * > m_preComputingPositions
Definition: TKGroup.h:104
std::vector< BaseVectorRV< V, M > * > m_rvs
Definition: TKGroup.h:105

Member Function Documentation

template<class V , class M >
void QUESO::BaseTKGroup< V, M >::clearPreComputingPositions ( )
virtual

Clears the pre-computing positions m_preComputingPositions[stageId].

Reimplemented in QUESO::TransformedScaledCovMatrixTKGroup< V, M >, QUESO::ScaledCovMatrixTKGroup< V, M >, and QUESO::HessianCovMatricesTKGroup< V, M >.

Definition at line 109 of file TKGroup.C.

Referenced by QUESO::HessianCovMatricesTKGroup< V, M >::clearPreComputingPositions(), QUESO::ScaledCovMatrixTKGroup< V, M >::clearPreComputingPositions(), and QUESO::TransformedScaledCovMatrixTKGroup< V, M >::clearPreComputingPositions().

110 {
111  for (unsigned int i = 0; i < m_preComputingPositions.size(); ++i) {
112  if (m_preComputingPositions[i]) {
113  delete m_preComputingPositions[i];
114  m_preComputingPositions[i] = NULL;
115  }
116  }
117 
118  return;
119 }
std::vector< const V * > m_preComputingPositions
Definition: TKGroup.h:104
template<class V , class M >
const BaseEnvironment & QUESO::BaseTKGroup< V, M >::env ( ) const

QUESO's environment.

Definition at line 78 of file TKGroup.C.

79 {
80  return m_env;
81 }
const BaseEnvironment & m_env
Definition: TKGroup.h:100
template<class V , class M >
const V & QUESO::BaseTKGroup< V, M >::preComputingPosition ( unsigned int  stageId) const

Pre-computing position; access to protected attribute *m_preComputingPositions[stageId].

Definition at line 85 of file TKGroup.C.

References queso_require_greater_msg, and queso_require_msg.

86 {
87  queso_require_greater_msg(m_preComputingPositions.size(), stageId, "m_preComputingPositions.size() <= stageId");
88 
89  queso_require_msg(m_preComputingPositions[stageId], "m_preComputingPositions[stageId] == NULL");
90 
91  return *m_preComputingPositions[stageId];
92 }
#define queso_require_msg(asserted, msg)
Definition: asserts.h:69
std::vector< const V * > m_preComputingPositions
Definition: TKGroup.h:104
#define queso_require_greater_msg(expr1, expr2, msg)
Definition: asserts.h:88
template<class V , class M >
void QUESO::BaseTKGroup< V, M >::print ( std::ostream &  os) const
virtual

TODO: Prints the transition kernel.

Todo:
: implement me!

Reimplemented in QUESO::TransformedScaledCovMatrixTKGroup< V, M >, QUESO::ScaledCovMatrixTKGroup< V, M >, and QUESO::HessianCovMatricesTKGroup< V, M >.

Definition at line 123 of file TKGroup.C.

Referenced by QUESO::HessianCovMatricesTKGroup< V, M >::print(), QUESO::ScaledCovMatrixTKGroup< V, M >::print(), and QUESO::TransformedScaledCovMatrixTKGroup< V, M >::print().

124 {
125  os << "In BaseTKGroup<V,M>::print()"
126  << ": nothing to be printed" << std::endl;
127  return;
128 }
template<class V = GslVector, class M = GslMatrix>
virtual const BaseVectorRV<V,M>& QUESO::BaseTKGroup< V, M >::rv ( unsigned int  stageId) const
pure virtual

Gaussian increment property to construct a transition kernel. See template specialization.

Implemented in QUESO::TransformedScaledCovMatrixTKGroup< V, M >, QUESO::HessianCovMatricesTKGroup< V, M >, and QUESO::ScaledCovMatrixTKGroup< V, M >.

template<class V = GslVector, class M = GslMatrix>
virtual const BaseVectorRV<V,M>& QUESO::BaseTKGroup< V, M >::rv ( const std::vector< unsigned int > &  stageIds)
pure virtual

Gaussian increment property to construct a transition kernel. See template specialization.

Implemented in QUESO::TransformedScaledCovMatrixTKGroup< V, M >, QUESO::HessianCovMatricesTKGroup< V, M >, and QUESO::ScaledCovMatrixTKGroup< V, M >.

template<class V, class M >
bool QUESO::BaseTKGroup< V, M >::setPreComputingPosition ( const V &  position,
unsigned int  stageId 
)
virtual

Sets the pre-computing positions m_preComputingPositions[stageId] with a new vector of size position.

Reimplemented in QUESO::TransformedScaledCovMatrixTKGroup< V, M >, QUESO::ScaledCovMatrixTKGroup< V, M >, and QUESO::HessianCovMatricesTKGroup< V, M >.

Definition at line 96 of file TKGroup.C.

References queso_require_greater_msg, and queso_require_msg.

Referenced by QUESO::HessianCovMatricesTKGroup< V, M >::setPreComputingPosition(), QUESO::ScaledCovMatrixTKGroup< V, M >::setPreComputingPosition(), and QUESO::TransformedScaledCovMatrixTKGroup< V, M >::setPreComputingPosition().

97 {
98  queso_require_greater_msg(m_preComputingPositions.size(), stageId, "m_preComputingPositions.size() <= stageId");
99 
100  queso_require_msg(!(m_preComputingPositions[stageId]), "m_preComputingPositions[stageId] != NULL");
101 
102  m_preComputingPositions[stageId] = new V(position);
103 
104  return true;
105 }
#define queso_require_msg(asserted, msg)
Definition: asserts.h:69
std::vector< const V * > m_preComputingPositions
Definition: TKGroup.h:104
#define queso_require_greater_msg(expr1, expr2, msg)
Definition: asserts.h:88
template<class V = GslVector, class M = GslMatrix>
virtual bool QUESO::BaseTKGroup< V, M >::symmetric ( ) const
pure virtual

Whether or not the matrix is symmetric. See template specialization.

Implemented in QUESO::TransformedScaledCovMatrixTKGroup< V, M >, QUESO::HessianCovMatricesTKGroup< V, M >, and QUESO::ScaledCovMatrixTKGroup< V, M >.

Member Data Documentation

template<class V = GslVector, class M = GslMatrix>
const EmptyEnvironment* QUESO::BaseTKGroup< V, M >::m_emptyEnv
protected

Definition at line 99 of file TKGroup.h.

template<class V = GslVector, class M = GslMatrix>
const BaseEnvironment& QUESO::BaseTKGroup< V, M >::m_env
protected
template<class V = GslVector, class M = GslMatrix>
std::vector<const V*> QUESO::BaseTKGroup< V, M >::m_preComputingPositions
protected
template<class V = GslVector, class M = GslMatrix>
std::string QUESO::BaseTKGroup< V, M >::m_prefix
protected

Definition at line 101 of file TKGroup.h.

template<class V = GslVector, class M = GslMatrix>
std::vector<BaseVectorRV<V,M>* > QUESO::BaseTKGroup< V, M >::m_rvs
protected
template<class V = GslVector, class M = GslMatrix>
std::vector<double> QUESO::BaseTKGroup< V, M >::m_scales
protected
template<class V = GslVector, class M = GslMatrix>
const VectorSpace<V,M>* QUESO::BaseTKGroup< V, M >::m_vectorSpace
protected

Definition at line 102 of file TKGroup.h.


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