queso-0.53.0
Public Member Functions | Private Attributes | Friends | List of all members
QUESO::SimulationStorage< S_V, S_M, P_V, P_M, Q_V, Q_M > Class Template Reference

#include <SimulationStorage.h>

Collaboration diagram for QUESO::SimulationStorage< S_V, S_M, P_V, P_M, Q_V, Q_M >:
Collaboration graph
[legend]

Public Member Functions

 SimulationStorage (const VectorSpace< S_V, S_M > &scenarioSpace, const VectorSpace< P_V, P_M > &parameterSpace, const VectorSpace< Q_V, Q_M > &outputSpace, unsigned int numSimulations)
 
 ~SimulationStorage ()
 
void addSimulation (const S_V &scenarioVec, const P_V &parameterVec, const Q_V &outputVec)
 
unsigned int numSimulations () const
 
const std::vector< const S_V * > & xs_asterisks_original () const
 
const std::vector< const P_V * > & ts_asterisks_original () const
 
const VectorSpace< S_V, S_M > & scenarioSpace () const
 
const VectorSpace< P_V, P_M > & parameterSpace () const
 
const VectorSpace< Q_V, Q_M > & outputSpace () const
 
const S_V & scenarioVec_original (unsigned int simulationId) const
 
const P_V & parameterVec_original (unsigned int simulationId) const
 
const Q_V & outputVec_original (unsigned int simulationId) const
 
const Q_V & etaVec_original () const
 
const BaseEnvironmentenv () const
 
void print (std::ostream &os) const
 

Private Attributes

const BaseEnvironmentm_env
 
const VectorSpace< S_V, S_M > & m_scenarioSpace
 
const VectorSpace< P_V, P_M > & m_parameterSpace
 
const VectorSpace< Q_V, Q_M > & m_outputSpace
 
unsigned int m_paper_m
 
unsigned int m_paper_n_eta
 
unsigned int m_addId
 
std::vector< const S_V * > m_scenarioVecs_original
 
std::vector< const P_V * > m_parameterVecs_original
 
std::vector< const Q_V * > m_outputVecs_original
 
VectorSpace< Q_V, Q_M > * m_eta_space
 
Q_V * m_etaVec_original
 

Friends

std::ostream & operator<< (std::ostream &os, const SimulationStorage< S_V, S_M, P_V, P_M, Q_V, Q_M > &obj)
 

Detailed Description

template<class S_V = GslVector, class S_M = GslMatrix, class P_V = GslVector, class P_M = GslMatrix, class Q_V = GslVector, class Q_M = GslMatrix>
class QUESO::SimulationStorage< S_V, S_M, P_V, P_M, Q_V, Q_M >

Definition at line 37 of file SimulationStorage.h.

Constructor & Destructor Documentation

template<class S_V , class S_M , class P_V , class P_M , class Q_V , class Q_M >
QUESO::SimulationStorage< S_V, S_M, P_V, P_M, Q_V, Q_M >::SimulationStorage ( const VectorSpace< S_V, S_M > &  scenarioSpace,
const VectorSpace< P_V, P_M > &  parameterSpace,
const VectorSpace< Q_V, Q_M > &  outputSpace,
unsigned int  numSimulations 
)

Definition at line 32 of file SimulationStorage.C.

References QUESO::BaseEnvironment::displayVerbosity(), QUESO::SimulationStorage< S_V, S_M, P_V, P_M, Q_V, Q_M >::m_env, QUESO::SimulationStorage< S_V, S_M, P_V, P_M, Q_V, Q_M >::m_paper_m, QUESO::SimulationStorage< S_V, S_M, P_V, P_M, Q_V, Q_M >::m_paper_n_eta, and QUESO::BaseEnvironment::subDisplayFile().

37  :
38  m_env (scenarioSpace.env()),
39  m_scenarioSpace (scenarioSpace),
40  m_parameterSpace (parameterSpace),
41  m_outputSpace (outputSpace),
43  m_paper_n_eta (outputSpace.dimLocal()),
44  m_addId (0),
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),
48  m_eta_space (NULL),
49  m_etaVec_original (NULL)
50 {
51  if ((m_env.subDisplayFile()) && (m_env.displayVerbosity() >= 2)) {
52  *m_env.subDisplayFile() << "Entering SimulationStorage<S_V,S_M,P_V,P_M,Q_V,Q_M>::constructor()"
53  << "\n m_paper_m = " << m_paper_m
54  << "\n m_paper_n_eta = " << m_paper_n_eta
55  << std::endl;
56  }
57 
58  if ((m_env.subDisplayFile()) && (m_env.displayVerbosity() >= 2)) {
59  *m_env.subDisplayFile() << "Leaving SimulationStorage<S_V,S_M,P_V,P_M,Q_V,Q_M>::constructor()"
60  << std::endl;
61  }
62 }
unsigned int displayVerbosity() const
Definition: Environment.C:396
unsigned int dimLocal() const
Definition: VectorSpace.C:170
const VectorSpace< Q_V, Q_M > & m_outputSpace
const VectorSpace< S_V, S_M > & m_scenarioSpace
VectorSpace< Q_V, Q_M > * m_eta_space
std::vector< const P_V * > m_parameterVecs_original
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
const VectorSpace< P_V, P_M > & m_parameterSpace
std::vector< const Q_V * > m_outputVecs_original
std::vector< const S_V * > m_scenarioVecs_original
unsigned int numSimulations() const
const BaseEnvironment & m_env
template<class S_V , class S_M , class P_V , class P_M , class Q_V , class Q_M >
QUESO::SimulationStorage< S_V, S_M, P_V, P_M, Q_V, Q_M >::~SimulationStorage ( )

Definition at line 65 of file SimulationStorage.C.

66 {
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()..."
69  << std::endl;
70  }
71 
72  delete m_etaVec_original;
73  delete m_eta_space;
74 
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()"
77  << std::endl;
78  }
79 }
unsigned int displayVerbosity() const
Definition: Environment.C:396
VectorSpace< Q_V, Q_M > * m_eta_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 P_V , class P_M , class Q_V , class Q_M >
void QUESO::SimulationStorage< S_V, S_M, P_V, P_M, Q_V, Q_M >::addSimulation ( const S_V &  scenarioVec,
const P_V &  parameterVec,
const Q_V &  outputVec 
)

Definition at line 83 of file SimulationStorage.C.

References queso_require_less_msg.

84 {
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
88  << std::endl;
89  }
90 
91  queso_require_less_msg(m_addId, m_paper_m, "too many adds...");
92 
93  m_scenarioVecs_original [m_addId] = &scenarioVec;
94  m_parameterVecs_original[m_addId] = &parameterVec;
95  m_outputVecs_original [m_addId] = &outputVec;
96  m_addId++;
97 
98  if (m_addId == m_paper_m) {
99  //***********************************************************************
100  // Form 'etaVec_original'
101  //***********************************************************************
102  m_eta_space = new VectorSpace<Q_V,Q_M>(m_env, "m_eta_simul_storage", m_paper_m * m_paper_n_eta, NULL),
104  m_etaVec_original->cwSetConcatenated(m_outputVecs_original);
105 
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()
110  //<< ", m_etaVec_original = " << m_etaVec_original
111  //<< ", *m_etaVec_original = " << *m_etaVec_original
112  << std::endl;
113  }
114  }
115 
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
119  << std::endl;
120  }
121 
122  return;
123 }
unsigned int displayVerbosity() const
Definition: Environment.C:396
VectorSpace< Q_V, Q_M > * m_eta_space
std::vector< const P_V * > m_parameterVecs_original
const V & zeroVector() const
Returns a vector filled with zeros.
Definition: VectorSpace.C:189
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 Q_V * > m_outputVecs_original
std::vector< const S_V * > m_scenarioVecs_original
const BaseEnvironment & m_env
template<class S_V , class S_M , class P_V , class P_M , class Q_V , class Q_M >
const BaseEnvironment & QUESO::SimulationStorage< S_V, S_M, P_V, P_M, Q_V, Q_M >::env ( ) const

Definition at line 223 of file SimulationStorage.C.

224 {
225  return m_env;
226 }
const BaseEnvironment & m_env
template<class S_V , class S_M , class P_V , class P_M , class Q_V , class Q_M >
const Q_V & QUESO::SimulationStorage< S_V, S_M, P_V, P_M, Q_V, Q_M >::etaVec_original ( ) const

Definition at line 202 of file SimulationStorage.C.

References queso_require_msg.

203 {
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
207  << std::endl;
208  }
209 
210  queso_require_msg(m_etaVec_original, "'m_etaVec_original' is NULL");
211 
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
215  << std::endl;
216  }
217 
218  return *m_etaVec_original;
219 }
unsigned int displayVerbosity() const
Definition: Environment.C:396
#define queso_require_msg(asserted, msg)
Definition: asserts.h:69
std::ofstream * subDisplayFile() const
Access function for m_subDisplayFile (displays file on stream).
Definition: Environment.C:274
const BaseEnvironment & m_env
template<class S_V , class S_M , class P_V , class P_M , class Q_V , class Q_M >
unsigned int QUESO::SimulationStorage< S_V, S_M, P_V, P_M, Q_V, Q_M >::numSimulations ( ) const

Definition at line 127 of file SimulationStorage.C.

128 {
129  return m_paper_m;
130 }
template<class S_V , class S_M , class P_V , class P_M , class Q_V , class Q_M >
const VectorSpace< Q_V, Q_M > & QUESO::SimulationStorage< S_V, S_M, P_V, P_M, Q_V, Q_M >::outputSpace ( ) const

Definition at line 162 of file SimulationStorage.C.

163 {
164  return m_outputSpace;
165 }
const VectorSpace< Q_V, Q_M > & m_outputSpace
template<class S_V , class S_M , class P_V , class P_M , class Q_V , class Q_M >
const Q_V & QUESO::SimulationStorage< S_V, S_M, P_V, P_M, Q_V, Q_M >::outputVec_original ( unsigned int  simulationId) const

Definition at line 191 of file SimulationStorage.C.

References queso_require_less_msg, and queso_require_msg.

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

192 {
193  queso_require_less_msg(simulationId, m_outputVecs_original.size(), "simulationId is too large");
194 
195  queso_require_msg(m_outputVecs_original[simulationId], "vector is NULL");
196 
197  return *(m_outputVecs_original[simulationId]);
198 }
#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 Q_V * > m_outputVecs_original
template<class S_V , class S_M , class P_V , class P_M , class Q_V , class Q_M >
const VectorSpace< P_V, P_M > & QUESO::SimulationStorage< S_V, S_M, P_V, P_M, Q_V, Q_M >::parameterSpace ( ) const

Definition at line 155 of file SimulationStorage.C.

156 {
157  return m_parameterSpace;
158 }
const VectorSpace< P_V, P_M > & m_parameterSpace
template<class S_V , class S_M , class P_V , class P_M , class Q_V , class Q_M >
const P_V & QUESO::SimulationStorage< S_V, S_M, P_V, P_M, Q_V, Q_M >::parameterVec_original ( unsigned int  simulationId) const

Definition at line 180 of file SimulationStorage.C.

References queso_require_less_msg, and queso_require_msg.

181 {
182  queso_require_less_msg(simulationId, m_parameterVecs_original.size(), "simulationId is too large");
183 
184  queso_require_msg(m_parameterVecs_original[simulationId], "vector is NULL");
185 
186  return *(m_parameterVecs_original[simulationId]);
187 }
std::vector< const P_V * > m_parameterVecs_original
#define queso_require_msg(asserted, msg)
Definition: asserts.h:69
#define queso_require_less_msg(expr1, expr2, msg)
Definition: asserts.h:87
template<class S_V , class S_M , class P_V , class P_M , class Q_V , class Q_M >
void QUESO::SimulationStorage< S_V, S_M, P_V, P_M, Q_V, Q_M >::print ( std::ostream &  os) const

Definition at line 230 of file SimulationStorage.C.

231 {
232  return;
233 }
template<class S_V , class S_M , class P_V , class P_M , class Q_V , class Q_M >
const VectorSpace< S_V, S_M > & QUESO::SimulationStorage< S_V, S_M, P_V, P_M, Q_V, Q_M >::scenarioSpace ( ) const

Definition at line 148 of file SimulationStorage.C.

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

149 {
150  return m_scenarioSpace;
151 }
const VectorSpace< S_V, S_M > & m_scenarioSpace
template<class S_V , class S_M , class P_V , class P_M , class Q_V , class Q_M >
const S_V & QUESO::SimulationStorage< S_V, S_M, P_V, P_M, Q_V, Q_M >::scenarioVec_original ( unsigned int  simulationId) const

Definition at line 169 of file SimulationStorage.C.

References queso_require_less_msg, and queso_require_msg.

170 {
171  queso_require_less_msg(simulationId, m_scenarioVecs_original.size(), "simulationId is too large");
172 
173  queso_require_msg(m_scenarioVecs_original[simulationId], "vector is NULL");
174 
175  return *(m_scenarioVecs_original[simulationId]);
176 }
#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_original
template<class S_V , class S_M , class P_V , class P_M , class Q_V , class Q_M >
const std::vector< const P_V * > & QUESO::SimulationStorage< S_V, S_M, P_V, P_M, Q_V, Q_M >::ts_asterisks_original ( ) const

Definition at line 141 of file SimulationStorage.C.

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

142 {
144 }
std::vector< const P_V * > m_parameterVecs_original
template<class S_V , class S_M , class P_V , class P_M , class Q_V , class Q_M >
const std::vector< const S_V * > & QUESO::SimulationStorage< S_V, S_M, P_V, P_M, Q_V, Q_M >::xs_asterisks_original ( ) const

Definition at line 134 of file SimulationStorage.C.

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

135 {
137 }
std::vector< const S_V * > m_scenarioVecs_original

Friends And Related Function Documentation

template<class S_V = GslVector, class S_M = GslMatrix, class P_V = GslVector, class P_M = GslMatrix, class Q_V = GslVector, class Q_M = GslMatrix>
std::ostream& operator<< ( std::ostream &  os,
const SimulationStorage< S_V, S_M, P_V, P_M, Q_V, Q_M > &  obj 
)
friend

Definition at line 60 of file SimulationStorage.h.

61  {
62  obj.print(os);
63 
64  return os;
65  }

Member Data Documentation

template<class S_V = GslVector, class S_M = GslMatrix, class P_V = GslVector, class P_M = GslMatrix, class Q_V = GslVector, class Q_M = GslMatrix>
unsigned int QUESO::SimulationStorage< S_V, S_M, P_V, P_M, Q_V, Q_M >::m_addId
private

Definition at line 78 of file SimulationStorage.h.

template<class S_V = GslVector, class S_M = GslMatrix, class P_V = GslVector, class P_M = GslMatrix, class Q_V = GslVector, class Q_M = GslMatrix>
const BaseEnvironment& QUESO::SimulationStorage< S_V, S_M, P_V, P_M, Q_V, Q_M >::m_env
private
template<class S_V = GslVector, class S_M = GslMatrix, class P_V = GslVector, class P_M = GslMatrix, class Q_V = GslVector, class Q_M = GslMatrix>
VectorSpace<Q_V,Q_M>* QUESO::SimulationStorage< S_V, S_M, P_V, P_M, Q_V, Q_M >::m_eta_space
private

Definition at line 83 of file SimulationStorage.h.

template<class S_V = GslVector, class S_M = GslMatrix, class P_V = GslVector, class P_M = GslMatrix, class Q_V = GslVector, class Q_M = GslMatrix>
Q_V* QUESO::SimulationStorage< S_V, S_M, P_V, P_M, Q_V, Q_M >::m_etaVec_original
private

Definition at line 84 of file SimulationStorage.h.

template<class S_V = GslVector, class S_M = GslMatrix, class P_V = GslVector, class P_M = GslMatrix, class Q_V = GslVector, class Q_M = GslMatrix>
const VectorSpace<Q_V,Q_M>& QUESO::SimulationStorage< S_V, S_M, P_V, P_M, Q_V, Q_M >::m_outputSpace
private

Definition at line 73 of file SimulationStorage.h.

template<class S_V = GslVector, class S_M = GslMatrix, class P_V = GslVector, class P_M = GslMatrix, class Q_V = GslVector, class Q_M = GslMatrix>
std::vector<const Q_V* > QUESO::SimulationStorage< S_V, S_M, P_V, P_M, Q_V, Q_M >::m_outputVecs_original
private

Definition at line 81 of file SimulationStorage.h.

template<class S_V = GslVector, class S_M = GslMatrix, class P_V = GslVector, class P_M = GslMatrix, class Q_V = GslVector, class Q_M = GslMatrix>
unsigned int QUESO::SimulationStorage< S_V, S_M, P_V, P_M, Q_V, Q_M >::m_paper_m
private
template<class S_V = GslVector, class S_M = GslMatrix, class P_V = GslVector, class P_M = GslMatrix, class Q_V = GslVector, class Q_M = GslMatrix>
unsigned int QUESO::SimulationStorage< S_V, S_M, P_V, P_M, Q_V, Q_M >::m_paper_n_eta
private
template<class S_V = GslVector, class S_M = GslMatrix, class P_V = GslVector, class P_M = GslMatrix, class Q_V = GslVector, class Q_M = GslMatrix>
const VectorSpace<P_V,P_M>& QUESO::SimulationStorage< S_V, S_M, P_V, P_M, Q_V, Q_M >::m_parameterSpace
private

Definition at line 72 of file SimulationStorage.h.

template<class S_V = GslVector, class S_M = GslMatrix, class P_V = GslVector, class P_M = GslMatrix, class Q_V = GslVector, class Q_M = GslMatrix>
std::vector<const P_V* > QUESO::SimulationStorage< S_V, S_M, P_V, P_M, Q_V, Q_M >::m_parameterVecs_original
private

Definition at line 80 of file SimulationStorage.h.

template<class S_V = GslVector, class S_M = GslMatrix, class P_V = GslVector, class P_M = GslMatrix, class Q_V = GslVector, class Q_M = GslMatrix>
const VectorSpace<S_V,S_M>& QUESO::SimulationStorage< S_V, S_M, P_V, P_M, Q_V, Q_M >::m_scenarioSpace
private

Definition at line 71 of file SimulationStorage.h.

template<class S_V = GslVector, class S_M = GslMatrix, class P_V = GslVector, class P_M = GslMatrix, class Q_V = GslVector, class Q_M = GslMatrix>
std::vector<const S_V* > QUESO::SimulationStorage< S_V, S_M, P_V, P_M, Q_V, Q_M >::m_scenarioVecs_original
private

Definition at line 79 of file SimulationStorage.h.


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

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