25 #include <queso/ExperimentStorage.h>
26 #include <queso/GslVector.h>
27 #include <queso/GslMatrix.h>
31 template<
class S_V,
class S_M,
class D_V,
class D_M>
34 unsigned int numExperiments)
36 m_env (scenarioSpace.env()),
37 m_scenarioSpace (scenarioSpace),
38 m_paper_n (numExperiments),
39 m_paper_n_ys_transformed (m_paper_n,0),
42 m_scenarioVecs_standard (m_paper_n, (S_V*) NULL),
43 m_dataVecs_transformed (m_paper_n, (D_V*) NULL),
44 m_covMats_transformed_inv(m_paper_n, (D_M*) NULL),
46 m_yVec_transformed (NULL),
61 template<
class S_V,
class S_M,
class D_V,
class D_M>
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()..."
70 delete m_yVec_transformed;
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()"
79 template<
class S_V,
class S_M,
class D_V,
class D_M>
82 const S_V& scenarioVec_standard,
83 const D_V& dataVec_transformed,
84 const D_M& covMat_transformed_inv)
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
97 m_scenarioVecs_standard [m_addId] = &scenarioVec_standard;
98 m_dataVecs_transformed [m_addId] = &dataVec_transformed;
99 m_covMats_transformed_inv[m_addId] = &covMat_transformed_inv;
100 m_paper_n_ys_transformed[m_addId] = dataVec_transformed.sizeLocal();
101 m_paper_n_y += m_paper_n_ys_transformed[m_addId];
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
116 m_yVec_transformed =
new D_V(m_y_space->zeroVector());
117 m_yVec_transformed->cwSetConcatenated(m_dataVecs_transformed);
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
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()"
130 <<
", m_Wy just created (not yet populated)"
131 <<
", numRowsLocal = " << m_Wy->numRowsLocal()
132 <<
", numCols = " << m_Wy->numCols()
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()"
140 <<
", m_Wy just populated"
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()
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
160 template<
class S_V,
class S_M,
class D_V,
class D_M>
161 const std::vector<const S_V* >&
164 return m_scenarioVecs_standard;
167 template<
class S_V,
class S_M,
class D_V,
class D_M>
174 template<
class S_V,
class S_M,
class D_V,
class D_M>
178 return m_scenarioSpace;
181 template<
class S_V,
class S_M,
class D_V,
class D_M>
182 const std::vector<unsigned int>&
185 return m_paper_n_ys_transformed;
188 template<
class S_V,
class S_M,
class D_V,
class D_M>
195 template<
class S_V,
class S_M,
class D_V,
class D_M>
203 return *(m_scenarioVecs_standard[experimentId]);
206 template<
class S_V,
class S_M,
class D_V,
class D_M>
214 return *(m_dataVecs_transformed[experimentId]);
217 template<
class S_V,
class S_M,
class D_V,
class D_M>
223 return *m_yVec_transformed;
226 template<
class S_V,
class S_M,
class D_V,
class D_M>
235 template<
class S_V,
class S_M,
class D_V,
class D_M>
242 template<
class S_V,
class S_M,
class D_V,
class D_M>
unsigned int displayVerbosity() const
void addExperiment(const S_V &scenarioVec_standard, const D_V &dataVec_transformed, const D_M &covMat_transformed_inv)
unsigned int numExperiments() const
ExperimentStorage(const VectorSpace< S_V, S_M > &scenarioSpace, unsigned int numExperiments)
const D_V & dataVec_transformed(unsigned int experimentId) const
#define queso_require_msg(asserted, msg)
std::ofstream * subDisplayFile() const
Access function for m_subDisplayFile (displays file on stream).
#define queso_require_less_msg(expr1, expr2, msg)
const std::vector< const S_V * > & xs_standard() const
This (virtual) class sets up the environment underlying the use of the QUESO library by an executable...
const S_V & scenarioVec_standard(unsigned int experimentId) const
const D_V & yVec_transformed() const
const std::vector< unsigned int > & n_ys_transformed() const
const BaseEnvironment & env() const
const BaseEnvironment & m_env
void print(std::ostream &os) const
const VectorSpace< S_V, S_M > & scenarioSpace() const