25 #include <queso/SimulationStorage.h>
26 #include <queso/GslVector.h>
27 #include <queso/GslMatrix.h>
31 template<
class S_V,
class S_M,
class P_V,
class P_M,
class Q_V,
class Q_M>
36 unsigned int numSimulations)
38 m_env (scenarioSpace.env()),
39 m_scenarioSpace (scenarioSpace),
40 m_parameterSpace (parameterSpace),
41 m_outputSpace (outputSpace),
42 m_paper_m (numSimulations),
43 m_paper_n_eta (outputSpace.dimLocal()),
45 m_scenarioVecs_original (m_paper_m, (S_V*) NULL),
46 m_parameterVecs_original(m_paper_m, (P_V*) NULL),
47 m_outputVecs_original (m_paper_m, (Q_V*) NULL),
49 m_etaVec_original (NULL)
52 *
m_env.
subDisplayFile() <<
"Entering SimulationStorage<S_V,S_M,P_V,P_M,Q_V,Q_M>::constructor()"
59 *
m_env.
subDisplayFile() <<
"Leaving SimulationStorage<S_V,S_M,P_V,P_M,Q_V,Q_M>::constructor()"
64 template<
class S_V,
class S_M,
class P_V,
class P_M,
class Q_V,
class Q_M>
67 if ((m_env.subDisplayFile()) && (m_env.displayVerbosity() >= 2)) {
68 *m_env.subDisplayFile() <<
"Entering SimulationStorage<S_V,S_M,P_V,P_M,Q_V,Q_M>::destructor()..."
72 delete m_etaVec_original;
75 if ((m_env.subDisplayFile()) && (m_env.displayVerbosity() >= 2)) {
76 *m_env.subDisplayFile() <<
"Leaving SimulationStorage<S_V,S_M,P_V,P_M,Q_V,Q_M>::destructor()"
81 template<
class S_V,
class S_M,
class P_V,
class P_M,
class Q_V,
class Q_M>
85 if ((m_env.subDisplayFile()) && (m_env.displayVerbosity() >= 2)) {
86 *m_env.subDisplayFile() <<
"Entering SimulationStorage<S_V,S_M,P_V,P_M,Q_V,Q_M>::addSimulation()"
87 <<
": m_addId = " << m_addId
93 m_scenarioVecs_original [m_addId] = &scenarioVec;
94 m_parameterVecs_original[m_addId] = ¶meterVec;
95 m_outputVecs_original [m_addId] = &outputVec;
98 if (m_addId == m_paper_m) {
102 m_eta_space =
new VectorSpace<Q_V,Q_M>(m_env,
"m_eta_simul_storage", m_paper_m * m_paper_n_eta, NULL),
103 m_etaVec_original =
new Q_V(m_eta_space->zeroVector());
104 m_etaVec_original->cwSetConcatenated(m_outputVecs_original);
106 if ((m_env.subDisplayFile()) && (m_env.displayVerbosity() >= 2)) {
107 *m_env.subDisplayFile() <<
"KEY In SimulationStorage<S_V,S_M,D_V,D_M>::addSimulation()"
108 <<
": m_addId = " << m_addId
109 <<
", populated etaVec_original of size " << m_etaVec_original->sizeLocal()
116 if ((m_env.subDisplayFile()) && (m_env.displayVerbosity() >= 2)) {
117 *m_env.subDisplayFile() <<
"Leaving SimulationStorage<S_V,S_M,P_V,P_M,Q_V,Q_M>::addSimulation()"
118 <<
": m_addId = " << m_addId
125 template<
class S_V,
class S_M,
class P_V,
class P_M,
class Q_V,
class Q_M>
132 template<
class S_V,
class S_M,
class P_V,
class P_M,
class Q_V,
class Q_M>
133 const std::vector<const S_V* >&
136 return m_scenarioVecs_original;
139 template<
class S_V,
class S_M,
class P_V,
class P_M,
class Q_V,
class Q_M>
140 const std::vector<const P_V* >&
143 return m_parameterVecs_original;
146 template<
class S_V,
class S_M,
class P_V,
class P_M,
class Q_V,
class Q_M>
150 return m_scenarioSpace;
153 template<
class S_V,
class S_M,
class P_V,
class P_M,
class Q_V,
class Q_M>
157 return m_parameterSpace;
160 template<
class S_V,
class S_M,
class P_V,
class P_M,
class Q_V,
class Q_M>
164 return m_outputSpace;
167 template<
class S_V,
class S_M,
class P_V,
class P_M,
class Q_V,
class Q_M>
175 return *(m_scenarioVecs_original[simulationId]);
178 template<
class S_V,
class S_M,
class P_V,
class P_M,
class Q_V,
class Q_M>
186 return *(m_parameterVecs_original[simulationId]);
189 template<
class S_V,
class S_M,
class P_V,
class P_M,
class Q_V,
class Q_M>
197 return *(m_outputVecs_original[simulationId]);
200 template<
class S_V,
class S_M,
class P_V,
class P_M,
class Q_V,
class Q_M>
204 if ((m_env.subDisplayFile()) && (m_env.displayVerbosity() >= 99)) {
205 *m_env.subDisplayFile() <<
"Entering SimulationStorage<S_V,S_M,P_V,P_M,Q_V,Q_M>::etaVec_original()"
206 <<
": m_etaVec_original = " << m_etaVec_original
212 if ((m_env.subDisplayFile()) && (m_env.displayVerbosity() >= 99)) {
213 *m_env.subDisplayFile() <<
"In SimulationStorage<S_V,S_M,P_V,P_M,Q_V,Q_M>::etaVec_original()"
214 <<
": *m_etaVec_original = " << *m_etaVec_original
218 return *m_etaVec_original;
221 template<
class S_V,
class S_M,
class P_V,
class P_M,
class Q_V,
class Q_M>
228 template<
class S_V,
class S_M,
class P_V,
class P_M,
class Q_V,
class Q_M>
unsigned int displayVerbosity() const
const Q_V & etaVec_original() const
const std::vector< const S_V * > & xs_asterisks_original() const
const VectorSpace< S_V, S_M > & scenarioSpace() const
void addSimulation(const S_V &scenarioVec, const P_V ¶meterVec, const Q_V &outputVec)
unsigned int m_paper_n_eta
const VectorSpace< Q_V, Q_M > & outputSpace() const
const P_V & parameterVec_original(unsigned int simulationId) const
void print(std::ostream &os) const
SimulationStorage(const VectorSpace< S_V, S_M > &scenarioSpace, const VectorSpace< P_V, P_M > ¶meterSpace, const VectorSpace< Q_V, Q_M > &outputSpace, unsigned int numSimulations)
const S_V & scenarioVec_original(unsigned int simulationId) 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 BaseEnvironment & env() const
This (virtual) class sets up the environment underlying the use of the QUESO library by an executable...
const std::vector< const P_V * > & ts_asterisks_original() const
const VectorSpace< P_V, P_M > & parameterSpace() const
const Q_V & outputVec_original(unsigned int simulationId) const
unsigned int numSimulations() const
const BaseEnvironment & m_env