queso-0.53.0
Public Member Functions | Private Attributes | Friends | List of all members
QUESO::ExperimentStorage< S_V, S_M, D_V, D_M > Class Template Reference

#include <ExperimentStorage.h>

Collaboration diagram for QUESO::ExperimentStorage< S_V, S_M, D_V, D_M >:
Collaboration graph
[legend]

Public Member Functions

 ExperimentStorage (const VectorSpace< S_V, S_M > &scenarioSpace, unsigned int numExperiments)
 
 ~ExperimentStorage ()
 
void addExperiment (const S_V &scenarioVec_standard, const D_V &dataVec_transformed, const D_M &covMat_transformed_inv)
 
unsigned int numExperiments () const
 
const VectorSpace< S_V, S_M > & scenarioSpace () const
 
const std::vector< const S_V * > & xs_standard () const
 
const std::vector< unsigned int > & n_ys_transformed () const
 
unsigned int n_y () const
 
const S_V & scenarioVec_standard (unsigned int experimentId) const
 
const D_V & dataVec_transformed (unsigned int experimentId) const
 
const D_V & yVec_transformed () const
 
const D_M & Wy () const
 
const BaseEnvironmentenv () const
 
void print (std::ostream &os) const
 

Private Attributes

const BaseEnvironmentm_env
 
const VectorSpace< S_V, S_M > & m_scenarioSpace
 
unsigned int m_paper_n
 
std::vector< unsigned int > m_paper_n_ys_transformed
 
unsigned int m_paper_n_y
 
unsigned int m_addId
 
std::vector< const S_V * > m_scenarioVecs_standard
 
std::vector< const D_V * > m_dataVecs_transformed
 
std::vector< const D_M * > m_covMats_transformed_inv
 
VectorSpace< D_V, D_M > * m_y_space
 
D_V * m_yVec_transformed
 
D_M * m_Wy
 

Friends

std::ostream & operator<< (std::ostream &os, const ExperimentStorage< S_V, S_M, D_V, D_M > &obj)
 

Detailed Description

template<class S_V = GslVector, class S_M = GslMatrix, class D_V = GslVector, class D_M = GslMatrix>
class QUESO::ExperimentStorage< S_V, S_M, D_V, D_M >

Definition at line 36 of file ExperimentStorage.h.

Constructor & Destructor Documentation

template<class S_V , class S_M , class D_V , class D_M >
QUESO::ExperimentStorage< S_V, S_M, D_V, D_M >::ExperimentStorage ( const VectorSpace< S_V, S_M > &  scenarioSpace,
unsigned int  numExperiments 
)

Definition at line 32 of file ExperimentStorage.C.

References QUESO::BaseEnvironment::displayVerbosity(), QUESO::ExperimentStorage< S_V, S_M, D_V, D_M >::m_env, QUESO::ExperimentStorage< S_V, S_M, D_V, D_M >::m_paper_n, and QUESO::BaseEnvironment::subDisplayFile().

35  :
36  m_env (scenarioSpace.env()),
37  m_scenarioSpace (scenarioSpace),
40  m_paper_n_y (0),
41  m_addId (0),
42  m_scenarioVecs_standard (m_paper_n, (S_V*) NULL),
43  m_dataVecs_transformed (m_paper_n, (D_V*) NULL),
45  m_y_space (NULL),
46  m_yVec_transformed (NULL),
47  m_Wy (NULL)
48 {
49  if ((m_env.subDisplayFile()) && (m_env.displayVerbosity() >= 2)) {
50  *m_env.subDisplayFile() << "Entering ExperimentStorage<S_V,S_M,D_V,D_M>::constructor()"
51  << "\n m_paper_n = " << m_paper_n
52  << std::endl;
53  }
54 
55  if ((m_env.subDisplayFile()) && (m_env.displayVerbosity() >= 2)) {
56  *m_env.subDisplayFile() << "Leaving ExperimentStorage<S_V,S_M,D_V,D_M>::constructor()"
57  << std::endl;
58  }
59 }
unsigned int displayVerbosity() const
Definition: Environment.C:396
unsigned int numExperiments() const
const VectorSpace< S_V, S_M > & m_scenarioSpace
std::vector< unsigned int > m_paper_n_ys_transformed
std::vector< const D_M * > m_covMats_transformed_inv
VectorSpace< D_V, D_M > * m_y_space
const BaseEnvironment & env() const
Environment.
Definition: VectorSpace.C:151
std::ofstream * subDisplayFile() const
Access function for m_subDisplayFile (displays file on stream).
Definition: Environment.C:274
std::vector< const D_V * > m_dataVecs_transformed
std::vector< const S_V * > m_scenarioVecs_standard
const BaseEnvironment & m_env
template<class S_V , class S_M , class D_V , class D_M >
QUESO::ExperimentStorage< S_V, S_M, D_V, D_M >::~ExperimentStorage ( )

Definition at line 62 of file ExperimentStorage.C.

63 {
64  if ((m_env.subDisplayFile()) && (m_env.displayVerbosity() >= 2)) {
65  *m_env.subDisplayFile() << "Entering ExperimentStorage<S_V,S_M,P_V,P_M,Q_V,Q_M>::destructor()..."
66  << std::endl;
67  }
68 
69  delete m_Wy;
70  delete m_yVec_transformed;
71  delete m_y_space;
72 
73  if ((m_env.subDisplayFile()) && (m_env.displayVerbosity() >= 2)) {
74  *m_env.subDisplayFile() << "Leaving ExperimentStorage<S_V,S_M,P_V,P_M,Q_V,Q_M>::destructor()"
75  << std::endl;
76  }
77 }
unsigned int displayVerbosity() const
Definition: Environment.C:396
VectorSpace< D_V, D_M > * m_y_space
std::ofstream * subDisplayFile() const
Access function for m_subDisplayFile (displays file on stream).
Definition: Environment.C:274
const BaseEnvironment & m_env

Member Function Documentation

template<class S_V , class S_M , class D_V , class D_M >
void QUESO::ExperimentStorage< S_V, S_M, D_V, D_M >::addExperiment ( const S_V &  scenarioVec_standard,
const D_V &  dataVec_transformed,
const D_M &  covMat_transformed_inv 
)

Definition at line 81 of file ExperimentStorage.C.

References queso_require_less_msg.

85 {
86  if ((m_env.subDisplayFile()) && (m_env.displayVerbosity() >= 2)) {
87  *m_env.subDisplayFile() << "Entering ExperimentStorage<S_V,S_M,D_V,D_M>::addExperiment()"
88  << ": m_addId = " << m_addId
89  << "\n scenarioVec_standard = " << scenarioVec_standard
90  << "\n dataVec_transformed = " << dataVec_transformed
91  << "\n covMat_transformed_inv = " << covMat_transformed_inv
92  << std::endl;
93  }
94 
95  queso_require_less_msg(m_addId, m_paper_n, "too many adds...");
96 
99  m_covMats_transformed_inv[m_addId] = &covMat_transformed_inv;
102  m_addId++;
103 
104  if (m_addId == m_paper_n) {
105  if ((m_env.subDisplayFile()) && (m_env.displayVerbosity() >= 2)) {
106  *m_env.subDisplayFile() << "KEY In ExperimentStorage<S_V,S_M,D_V,D_M>::addExperiment()"
107  << ": m_addId = " << m_addId
108  << ", m_paper_n_y = " << m_paper_n_y
109  << std::endl;
110  }
111 
112  //***********************************************************************
113  // Form 'yVec_transformed', 'Wy' matrix, and compute its inverse
114  //***********************************************************************
115  m_y_space = new VectorSpace<D_V,D_M>(m_env, "m_y_exp_storage", m_paper_n_y, NULL),
117  m_yVec_transformed->cwSetConcatenated(m_dataVecs_transformed);
118 
119  if ((m_env.subDisplayFile()) && (m_env.displayVerbosity() >= 3)) {
120  *m_env.subDisplayFile() << "In ExperimentStorage<S_V,S_M,D_V,D_M>::addExperiment()"
121  << ": populated yVec_transformed of size = " << m_yVec_transformed->sizeLocal()
122  << "\n *m_yVec_transformed = " << *m_yVec_transformed
123  << std::endl;
124  }
125 
126  m_Wy = new D_M(m_y_space->zeroVector());
127  if ((m_env.subDisplayFile()) && (m_env.displayVerbosity() >= 2)) {
128  *m_env.subDisplayFile() << "In ExperimentStorage<S_V,S_M,D_V,D_M>::addExperiment()"
129  << ": key-debug"
130  << ", m_Wy just created (not yet populated)"
131  << ", numRowsLocal = " << m_Wy->numRowsLocal()
132  << ", numCols = " << m_Wy->numCols()
133  << std::endl;
134  }
135 
136  m_Wy->fillWithBlocksDiagonally(0,0,m_covMats_transformed_inv,true,true);
137  if ((m_env.subDisplayFile()) && (m_env.displayVerbosity() >= 2)) {
138  *m_env.subDisplayFile() << "In ExperimentStorage<S_V,S_M,D_V,D_M>::addExperiment()"
139  << ": key-debug"
140  << ", m_Wy just populated"
141  << std::endl;
142  }
143 
144  if ((m_env.subDisplayFile()) && (m_env.displayVerbosity() >= 3)) {
145  *m_env.subDisplayFile() << "In ExperimentStorage<S_V,S_M,D_V,D_M>::addExperiment()"
146  << ": m_Wy->lnDeterminant() = " << m_Wy->lnDeterminant()
147  << std::endl;
148  }
149  }
150 
151  if ((m_env.subDisplayFile()) && (m_env.displayVerbosity() >= 2)) {
152  *m_env.subDisplayFile() << "Leaving ExperimentStorage<S_V,S_M,D_V,D_M>::addExperiment()"
153  << ": m_addId = " << m_addId
154  << std::endl;
155  }
156 
157  return;
158 }
unsigned int displayVerbosity() const
Definition: Environment.C:396
const D_V & dataVec_transformed(unsigned int experimentId) const
std::vector< unsigned int > m_paper_n_ys_transformed
std::vector< const D_M * > m_covMats_transformed_inv
const V & zeroVector() const
Returns a vector filled with zeros.
Definition: VectorSpace.C:189
VectorSpace< D_V, D_M > * m_y_space
std::ofstream * subDisplayFile() const
Access function for m_subDisplayFile (displays file on stream).
Definition: Environment.C:274
#define queso_require_less_msg(expr1, expr2, msg)
Definition: asserts.h:87
std::vector< const D_V * > m_dataVecs_transformed
const S_V & scenarioVec_standard(unsigned int experimentId) const
std::vector< const S_V * > m_scenarioVecs_standard
const BaseEnvironment & m_env
template<class S_V , class S_M , class D_V , class D_M >
const D_V & QUESO::ExperimentStorage< S_V, S_M, D_V, D_M >::dataVec_transformed ( unsigned int  experimentId) const

Definition at line 208 of file ExperimentStorage.C.

References queso_require_less_msg, and queso_require_msg.

209 {
210  queso_require_less_msg(experimentId, m_dataVecs_transformed.size(), "experimentId is too large");
211 
212  queso_require_msg(m_dataVecs_transformed[experimentId], "vector is NULL");
213 
214  return *(m_dataVecs_transformed[experimentId]);
215 }
#define queso_require_msg(asserted, msg)
Definition: asserts.h:69
#define queso_require_less_msg(expr1, expr2, msg)
Definition: asserts.h:87
std::vector< const D_V * > m_dataVecs_transformed
template<class S_V , class S_M , class D_V , class D_M >
const BaseEnvironment & QUESO::ExperimentStorage< S_V, S_M, D_V, D_M >::env ( ) const

Definition at line 237 of file ExperimentStorage.C.

238 {
239  return m_env;
240 }
const BaseEnvironment & m_env
template<class S_V , class S_M , class D_V , class D_M >
unsigned int QUESO::ExperimentStorage< S_V, S_M, D_V, D_M >::n_y ( ) const

Definition at line 190 of file ExperimentStorage.C.

191 {
192  return m_paper_n_y;
193 }
template<class S_V , class S_M , class D_V , class D_M >
const std::vector< unsigned int > & QUESO::ExperimentStorage< S_V, S_M, D_V, D_M >::n_ys_transformed ( ) const

Definition at line 183 of file ExperimentStorage.C.

Referenced by QUESO::GpmsaComputerModel< S_V, S_M, D_V, D_M, P_V, P_M, Q_V, Q_M >::GpmsaComputerModel().

184 {
186 }
std::vector< unsigned int > m_paper_n_ys_transformed
template<class S_V , class S_M , class D_V , class D_M >
unsigned int QUESO::ExperimentStorage< S_V, S_M, D_V, D_M >::numExperiments ( ) const
template<class S_V , class S_M , class D_V , class D_M >
void QUESO::ExperimentStorage< S_V, S_M, D_V, D_M >::print ( std::ostream &  os) const

Definition at line 244 of file ExperimentStorage.C.

245 {
246  return;
247 }
template<class S_V , class S_M , class D_V , class D_M >
const VectorSpace< S_V, S_M > & QUESO::ExperimentStorage< S_V, S_M, D_V, D_M >::scenarioSpace ( ) const

Definition at line 176 of file ExperimentStorage.C.

Referenced by QUESO::GpmsaComputerModel< S_V, S_M, D_V, D_M, P_V, P_M, Q_V, Q_M >::GpmsaComputerModel().

177 {
178  return m_scenarioSpace;
179 }
const VectorSpace< S_V, S_M > & m_scenarioSpace
template<class S_V , class S_M , class D_V , class D_M >
const S_V & QUESO::ExperimentStorage< S_V, S_M, D_V, D_M >::scenarioVec_standard ( unsigned int  experimentId) const

Definition at line 197 of file ExperimentStorage.C.

References queso_require_less_msg, and queso_require_msg.

198 {
199  queso_require_less_msg(experimentId, m_scenarioVecs_standard.size(), "experimentId is too large");
200 
201  queso_require_msg(m_scenarioVecs_standard[experimentId], "vector is NULL");
202 
203  return *(m_scenarioVecs_standard[experimentId]);
204 }
#define queso_require_msg(asserted, msg)
Definition: asserts.h:69
#define queso_require_less_msg(expr1, expr2, msg)
Definition: asserts.h:87
std::vector< const S_V * > m_scenarioVecs_standard
template<class S_V , class S_M , class D_V , class D_M >
const D_M & QUESO::ExperimentStorage< S_V, S_M, D_V, D_M >::Wy ( ) const

Definition at line 228 of file ExperimentStorage.C.

References queso_require_msg.

Referenced by QUESO::GcmExperimentInfo< S_V, S_M, D_V, D_M, P_V, P_M >::GcmExperimentInfo().

229 {
230  queso_require_msg(m_Wy, "'m_Wy' is NULL");
231 
232  return *m_Wy;
233 }
#define queso_require_msg(asserted, msg)
Definition: asserts.h:69
template<class S_V , class S_M , class D_V , class D_M >
const std::vector< const S_V * > & QUESO::ExperimentStorage< S_V, S_M, D_V, D_M >::xs_standard ( ) const

Definition at line 162 of file ExperimentStorage.C.

Referenced by QUESO::ExperimentModel< S_V, S_M, D_V, D_M >::ExperimentModel().

163 {
165 }
std::vector< const S_V * > m_scenarioVecs_standard
template<class S_V , class S_M , class D_V , class D_M >
const D_V & QUESO::ExperimentStorage< S_V, S_M, D_V, D_M >::yVec_transformed ( ) const

Definition at line 219 of file ExperimentStorage.C.

References queso_require_msg.

Referenced by QUESO::GcmExperimentInfo< S_V, S_M, D_V, D_M, P_V, P_M >::GcmExperimentInfo().

220 {
221  queso_require_msg(m_yVec_transformed, "'m_yVec_transformed' is NULL");
222 
223  return *m_yVec_transformed;
224 }
#define queso_require_msg(asserted, msg)
Definition: asserts.h:69

Friends And Related Function Documentation

template<class S_V = GslVector, class S_M = GslMatrix, class D_V = GslVector, class D_M = GslMatrix>
std::ostream& operator<< ( std::ostream &  os,
const ExperimentStorage< S_V, S_M, D_V, D_M > &  obj 
)
friend

Definition at line 55 of file ExperimentStorage.h.

56  {
57  obj.print(os);
58  return os;
59  }

Member Data Documentation

template<class S_V = GslVector, class S_M = GslMatrix, class D_V = GslVector, class D_M = GslMatrix>
unsigned int QUESO::ExperimentStorage< S_V, S_M, D_V, D_M >::m_addId
private

Definition at line 70 of file ExperimentStorage.h.

template<class S_V = GslVector, class S_M = GslMatrix, class D_V = GslVector, class D_M = GslMatrix>
std::vector<const D_M* > QUESO::ExperimentStorage< S_V, S_M, D_V, D_M >::m_covMats_transformed_inv
private

Definition at line 73 of file ExperimentStorage.h.

template<class S_V = GslVector, class S_M = GslMatrix, class D_V = GslVector, class D_M = GslMatrix>
std::vector<const D_V* > QUESO::ExperimentStorage< S_V, S_M, D_V, D_M >::m_dataVecs_transformed
private

Definition at line 72 of file ExperimentStorage.h.

template<class S_V = GslVector, class S_M = GslMatrix, class D_V = GslVector, class D_M = GslMatrix>
const BaseEnvironment& QUESO::ExperimentStorage< S_V, S_M, D_V, D_M >::m_env
private
template<class S_V = GslVector, class S_M = GslMatrix, class D_V = GslVector, class D_M = GslMatrix>
unsigned int QUESO::ExperimentStorage< S_V, S_M, D_V, D_M >::m_paper_n
private
template<class S_V = GslVector, class S_M = GslMatrix, class D_V = GslVector, class D_M = GslMatrix>
unsigned int QUESO::ExperimentStorage< S_V, S_M, D_V, D_M >::m_paper_n_y
private

Definition at line 68 of file ExperimentStorage.h.

template<class S_V = GslVector, class S_M = GslMatrix, class D_V = GslVector, class D_M = GslMatrix>
std::vector<unsigned int> QUESO::ExperimentStorage< S_V, S_M, D_V, D_M >::m_paper_n_ys_transformed
private

Definition at line 67 of file ExperimentStorage.h.

template<class S_V = GslVector, class S_M = GslMatrix, class D_V = GslVector, class D_M = GslMatrix>
const VectorSpace<S_V,S_M>& QUESO::ExperimentStorage< S_V, S_M, D_V, D_M >::m_scenarioSpace
private

Definition at line 65 of file ExperimentStorage.h.

template<class S_V = GslVector, class S_M = GslMatrix, class D_V = GslVector, class D_M = GslMatrix>
std::vector<const S_V* > QUESO::ExperimentStorage< S_V, S_M, D_V, D_M >::m_scenarioVecs_standard
private

Definition at line 71 of file ExperimentStorage.h.

template<class S_V = GslVector, class S_M = GslMatrix, class D_V = GslVector, class D_M = GslMatrix>
D_M* QUESO::ExperimentStorage< S_V, S_M, D_V, D_M >::m_Wy
private

Definition at line 76 of file ExperimentStorage.h.

template<class S_V = GslVector, class S_M = GslMatrix, class D_V = GslVector, class D_M = GslMatrix>
VectorSpace<D_V,D_M>* QUESO::ExperimentStorage< S_V, S_M, D_V, D_M >::m_y_space
private

Definition at line 74 of file ExperimentStorage.h.

template<class S_V = GslVector, class S_M = GslMatrix, class D_V = GslVector, class D_M = GslMatrix>
D_V* QUESO::ExperimentStorage< S_V, S_M, D_V, D_M >::m_yVec_transformed
private

Definition at line 75 of file ExperimentStorage.h.


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

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