queso-0.53.0
GcmExperimentInfo.C
Go to the documentation of this file.
1 //-----------------------------------------------------------------------bl-
2 //--------------------------------------------------------------------------
3 //
4 // QUESO - a library to support the Quantification of Uncertainty
5 // for Estimation, Simulation and Optimization
6 //
7 // Copyright (C) 2008-2015 The PECOS Development Team
8 //
9 // This library is free software; you can redistribute it and/or
10 // modify it under the terms of the Version 2.1 GNU Lesser General
11 // Public License as published by the Free Software Foundation.
12 //
13 // This library is distributed in the hope that it will be useful,
14 // but WITHOUT ANY WARRANTY; without even the implied warranty of
15 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 // Lesser General Public License for more details.
17 //
18 // You should have received a copy of the GNU Lesser General Public
19 // License along with this library; if not, write to the Free Software
20 // Foundation, Inc. 51 Franklin Street, Fifth Floor,
21 // Boston, MA 02110-1301 USA
22 //
23 //-----------------------------------------------------------------------el-
24 
25 #include <queso/GcmExperimentInfo.h>
26 #include <queso/GslVector.h>
27 #include <queso/GslMatrix.h>
28 
29 namespace QUESO {
30 
31 template <class S_V,class S_M,class D_V,class D_M,class P_V,class P_M>
33  const GpmsaComputerModelOptions& gcmOptionsObj,
34  bool allOutputsAreScalar,
35  const ExperimentStorage<S_V,S_M,D_V,D_M>& experimentStorage,
36  const ExperimentModel <S_V,S_M,D_V,D_M>& experimentModel,
37  const BaseVectorRV <P_V,P_M>& thetaPriorRv)
38  :
39  m_env (experimentStorage.env()),
40  m_experimentStorage (experimentStorage),
41  m_experimentModel (experimentModel),
42  m_paper_p_x (experimentStorage.scenarioSpace().dimLocal()),
43  m_paper_n (experimentStorage.numExperiments()),
44  m_paper_xs_standard (experimentStorage.xs_standard()),
45  m_paper_n_ys_transformed (experimentStorage.n_ys_transformed()),
46  m_paper_n_y (experimentStorage.n_y()),
47  m_paper_p_delta (experimentModel.numBasis()),
48  m_paper_F (experimentModel.numBasisGroups()),
49  m_paper_Gs (experimentModel.Gs()),
50  m_paper_n_space (m_env, "paper_n_", m_paper_n, NULL),
51  m_5lambdaYDim (MiscUintDebugMessage(1,NULL)), // "GcmExperimentInfo::consctructor(), m_5lambdaYDim")), // '1' in paper
52  m_5lambdaYSpace (m_env, "5lambdaY_", m_5lambdaYDim, NULL),
53  m_5lambdaYMins (m_env,m_5lambdaYSpace.map(),0.),
54  m_5lambdaYMaxs (m_env,m_5lambdaYSpace.map(),+INFINITY),
55  m_5lambdaYDomain ("5lambdaY_",m_5lambdaYSpace,m_5lambdaYMins,m_5lambdaYMaxs),
56  m_5lambdaYGammaAVec (m_env,m_5lambdaYSpace.map(),experimentModel.optionsObj().m_ov.m_a_y),
57  m_5lambdaYGammaBVec (m_env,m_5lambdaYSpace.map(),1./experimentModel.optionsObj().m_ov.m_b_y), // Yes, 1./...
58  m_5lambdaYPriorRv ("5lambdaY_",m_5lambdaYDomain,m_5lambdaYGammaAVec,m_5lambdaYGammaBVec),
59  m_like_previous5 (m_5lambdaYSpace.zeroVector()),
60  m_tmp_5lambdaYVec (m_5lambdaYSpace.zeroVector()),
61  m_6lambdaVDim (MiscUintDebugMessage(m_paper_F,NULL)), // "GcmExperimentInfo::consctructor(), m_6lambdaVDim")), // 'F' in paper
62  m_6lambdaVSpace (m_env, "6lambdaV_", m_6lambdaVDim, NULL),
63  m_6lambdaVMins (m_env,m_6lambdaVSpace.map(),0.),
64  m_6lambdaVMaxs (m_env,m_6lambdaVSpace.map(),+INFINITY),
65  m_6lambdaVDomain ("6lambdaV_",m_6lambdaVSpace,m_6lambdaVMins,m_6lambdaVMaxs),
66  m_6lambdaVGammaAVec (m_env,m_6lambdaVSpace.map(),experimentModel.optionsObj().m_ov.m_a_v),
67  m_6lambdaVGammaBVec (m_env,m_6lambdaVSpace.map(),1./experimentModel.optionsObj().m_ov.m_b_v), // Yes, 1./...
68  m_6lambdaVPriorRv ("6lambdaV_",m_6lambdaVDomain,m_6lambdaVGammaAVec,m_6lambdaVGammaBVec),
69  m_like_previous6 (m_6lambdaVSpace.zeroVector()),
70  m_tmp_6lambdaVVec (m_6lambdaVSpace.zeroVector()),
71  m_7rhoVDim (MiscUintDebugMessage(m_paper_F * m_paper_p_x,NULL)), // "GcmExperimentInfo::consctructor(), m_7lrhoVDim")), // 'F * p_x' in paper
72  m_7rhoVSpace (m_env, "7rhoV_", m_7rhoVDim, NULL),
73  m_7rhoVMins (m_env,m_7rhoVSpace.map(),0.),
74  m_7rhoVMaxs (m_env,m_7rhoVSpace.map(),1.),
75  m_7rhoVDomain ("7rhoV_",m_7rhoVSpace,m_7rhoVMins,m_7rhoVMaxs),
76  m_7rhoVBetaAVec (m_env,m_7rhoVSpace.map(),experimentModel.optionsObj().m_ov.m_a_rho_v),
77  m_7rhoVBetaBVec (m_env,m_7rhoVSpace.map(),experimentModel.optionsObj().m_ov.m_b_rho_v),
78  m_7rhoVPriorRv ("7rhoV_",m_7rhoVDomain,m_7rhoVBetaAVec,m_7rhoVBetaBVec),
79  m_like_previous7 (m_7rhoVSpace.zeroVector()),
80  m_tmp_7rhoVVec (m_7rhoVSpace.zeroVector()),
81  m_8thetaDim (MiscUintDebugMessage(thetaPriorRv.imageSet().vectorSpace().dimLocal(),NULL)), // "GcmExperimentInfo::consctructor(), m_8thetaDim")),
82  m_8thetaSpace (m_env, "8theta_", m_8thetaDim, NULL),
83  m_8thetaPriorRv (thetaPriorRv),
84  m_like_previous8 (m_8thetaSpace.zeroVector()),
85  m_tmp_8thetaVec (m_8thetaSpace.zeroVector()),
86  m_v_size (m_paper_n*m_paper_p_delta),
87  m_v_space (m_env, "v_", m_v_size, NULL),
88  m_unique_v_space (m_env, "unique_v_", m_paper_p_delta, NULL),
89  m_rho_v_space (m_env, "rho_v_", m_paper_p_x, NULL),
90  m_y_space (m_env, "n_y_", m_paper_n_y, NULL),
91  m_tmp_rho_v_vec (m_rho_v_space.zeroVector()),
92  m_Imat_v_i_spaces (m_paper_F, (VectorSpace<D_V,D_M>*) NULL), // to be deleted on destructor
93  m_Imat_v_is (m_paper_F, (D_M*) NULL), // to be deleted on destructor
94  m_Rmat_v_i_spaces (m_paper_F, (VectorSpace<D_V,D_M>*) NULL), // to be deleted on destructor
95  m_Rmat_v_is (m_paper_F, (D_M*) NULL), // to be deleted on destructor
96  m_Smat_v_i_spaces (m_paper_F, (VectorSpace<D_V,D_M>*) NULL), // to be deleted on destructor
97  m_Smat_v_is (m_paper_F, (D_M*) NULL), // to be deleted on destructor
98  m_Smat_v (m_v_space.zeroVector()),
99  m_Rmat_v_hat_v_asterisk_is (m_paper_p_delta, (D_M*) NULL), // to be deleted on destructor
100  m_Smat_v_hat_v_asterisk_is (m_paper_p_delta, (D_M*) NULL), // to be deleted on destructor
101  m_Smat_v_hat_v_asterisk (m_env, m_v_space.map(), m_paper_p_delta),
102  m_Smat_v_hat_v_asterisk_t (m_env, m_unique_v_space.map(), m_v_size),
103  m_PD (NULL), // to be deleted on destructor
104  m_Dmat_BlockDiag (NULL),
105  m_Dmat_BlockDiag_permut (NULL), // to be deleted on destructor
106  m_Wy (NULL),
107  m_Smat_v_asterisk_v_asterisk(m_unique_v_space.zeroVector())
108 {
109  if ((m_env.subDisplayFile()) && (m_env.displayVerbosity() >= 2)) {
110  *m_env.subDisplayFile() << "Entering GcmExperimentInfo<S_V,S_M,D_V,D_M,P_V,P_M>::constructor()"
111  << ": key-debug"
112  << ", some entities just created (not yet populated)"
113  << ", m_Smat_v.numRowsLocal() = " << m_Smat_v.numRowsLocal()
114  << ", m_Smat_v.numCols() = " << m_Smat_v.numCols()
115  << std::endl;
116  }
117 
118  std::set<unsigned int> tmpSet;
119  tmpSet.insert(m_env.subId());
120 
121  if (allOutputsAreScalar) {
122  // Do nothing
123  }
124  else {
125  m_PD = new D_M(m_v_space.zeroVector()); // to be deleted on destructor
126  if ((m_env.subDisplayFile()) && (m_env.displayVerbosity() >= 2)) {
127  *m_env.subDisplayFile() << "In GcmExperimentInfo<S_V,S_M,D_V,D_M,P_V,P_M>::constructor()"
128  << ": key-debug"
129  << ", m_PD just created (not yet populated)"
130  << ", numRowsLocal() = " << m_PD->numRowsLocal()
131  << ", numCols() = " << m_PD->numCols()
132  << std::endl;
133  }
134  m_Dmat_BlockDiag = &experimentModel.Dmat_BlockDiag();
135  m_Dmat_BlockDiag_permut = new D_M(m_env,m_y_space.map(),m_v_size); // to be deleted on destructor
136  if ((m_env.subDisplayFile()) && (m_env.displayVerbosity() >= 2)) {
137  *m_env.subDisplayFile() << "In GcmExperimentInfo<S_V,S_M,D_V,D_M,P_V,P_M>::constructor()"
138  << ": key-debug"
139  << ", m_Dmat_BlockDiag just created (not yet populated)"
140  << ", numRowsLocal() = " << m_Dmat_BlockDiag->numRowsLocal()
141  << ", numCols() = " << m_Dmat_BlockDiag->numCols()
142  << std::endl;
143  }
144  m_Wy = &experimentStorage.Wy();
145 
146  //********************************************************************************
147  // Print information
148  //********************************************************************************
149  if (gcmOptionsObj.m_ov.m_dataOutputAllowedSet.find(m_env.subId()) != gcmOptionsObj.m_ov.m_dataOutputAllowedSet.end()) {
150  m_Wy->subWriteContents("Wy",
151  "mat_Wy",
152  "m",
153  tmpSet);
154  }
155  if ((m_env.subDisplayFile()) && (m_env.displayVerbosity() >= 99)) {
156  D_M Wy_filtered(*m_Wy);
157  Wy_filtered.setPrintHorizontally(false);
158  Wy_filtered.filterSmallValues(1.e-6);
159  *m_env.subDisplayFile() << "In GcmExperimentInfo<S_V,S_M,D_V,D_M,P_V,P_M>::constructor()"
160  << ": Wy_filtered.numRowsLocal() = " << Wy_filtered.numRowsLocal()
161  << ", Wy_filtered.numCols() = " << Wy_filtered.numCols()
162  << ", Wy_filtered contents =\n" << Wy_filtered
163  << std::endl;
164  }
165 
166  //********************************************************************************
167  // Form 'P_D' matrix
168  //********************************************************************************
169  for (unsigned int i = 0; i < m_paper_p_delta; ++i) {
170  for (unsigned int j = 0; j < m_paper_n; ++j) {
171  unsigned int row = j + (m_paper_n*i);
172  unsigned int col = (j*m_paper_p_delta)+i;
173  (*m_PD)(row,col) = 1.;
174  }
175  }
176 
177  if (m_env.checkingLevel() >= 1) {
178  // Check transpose operation
179  D_M PDt(m_PD->transpose());
180  if (m_env.subDisplayFile()) {
181  *m_env.subDisplayFile() << "In GcmExperimentInfo<S_V,S_M,D_V,D_M,P_V,P_M,Q_V,Q_M>::constructor()"
182  << ", tests on m_PD"
183  << ": m_PD->numRowsLocal() = " << m_PD->numRowsLocal()
184  << ", m_PD->numCols() = " << m_PD->numCols()
185  << ": PDt.numRowsLocal() = " << PDt.numRowsLocal()
186  << ", PDt.numCols() = " << PDt.numCols()
187  << std::endl;
188  }
189 
190  D_M matShouldBeI1( *m_PD * PDt );
191  D_M matI1 (m_v_space.zeroVector());
192  for (unsigned int i = 0; i < matI1.numRowsLocal(); ++i) {
193  matI1(i,i) = 1.;
194  }
195  matShouldBeI1 -= matI1;
196  double auxNorm1 = matShouldBeI1.normFrob();
197 
198  D_M matShouldBeI2( PDt * *m_PD );
199  D_M matI2 (m_v_space.zeroVector());
200  for (unsigned int i = 0; i < matI2.numRowsLocal(); ++i) {
201  matI2(i,i) = 1.;
202  }
203  matShouldBeI2 -= matI2;
204  double auxNorm2 = matShouldBeI2.normFrob();
205 
206  if (m_env.subDisplayFile()) {
207  *m_env.subDisplayFile() << "In GcmExperimentInfo<S_V,S_M,D_V,D_M,P_V,P_M,Q_V,Q_M>::constructor()"
208  << ", tests on m_PD"
209  << ": matShouldBeI1.numRowsLocal() = " << matShouldBeI1.numRowsLocal()
210  << ", ||matI1||_2^2 = " << matI1.normFrob() * matI1.normFrob()
211  << ", ||matShouldBeI1 - matI1||_2^2 = " << auxNorm1 * auxNorm1
212  << "; matShouldBeI2.numRowsLocal() = " << matShouldBeI2.numRowsLocal()
213  << ", ||matI2||_2^2 = " << matI2.normFrob() * matI2.normFrob()
214  << ", ||matShouldBeI2 - matI2||_2^2 = " << auxNorm2 * auxNorm2
215  << std::endl;
216  }
217  }
218 
219  if ((m_env.subDisplayFile()) && (m_env.displayVerbosity() >= 3)) {
220  *m_env.subDisplayFile() << "In GcmExperimentInfo<S_V,S_M,D_V,D_M,P_V,P_M>::constructor()"
221  << ": finished forming 'P_D'"
222  << std::endl;
223  }
224 
225  //********************************************************************************
226  // Compute 'Dmat_BlockDiag_permut' matrix
227  //********************************************************************************
228  if ((m_env.subDisplayFile()) && (m_env.displayVerbosity() >= 3)) {
229  *m_env.subDisplayFile() << "In GcmExperimentInfo<S_V,S_M,D_V,D_M,P_V,P_M>::constructor()"
230  << ": m_Dmat_BlockDiag->numRowsLocal() = " << m_Dmat_BlockDiag->numRowsLocal()
231  << ", m_Dmat_BlockDiag->numCols() = " << m_Dmat_BlockDiag->numCols()
232  << ", m_PD->numRowsLocal() = " << m_PD->numRowsLocal()
233  << ", m_PD->numCols() = " << m_PD->numCols()
234  << std::endl;
235  }
236 
237  *m_Dmat_BlockDiag_permut = *m_Dmat_BlockDiag * (m_PD->transpose());
238 
239  if ((m_env.subDisplayFile()) && (m_env.displayVerbosity() >= 3)) {
240  *m_env.subDisplayFile() << "In GcmExperimentInfo<S_V,S_M,D_V,D_M,P_V,P_M>::constructor()"
241  << ": finished computing 'm_Dmat_BlockDiag_permut'"
242  << std::endl;
243  }
244  } // if (allOutputsAreScalar)
245 
246  //********************************************************************************
247  // Instantiate Smat spaces
248  //********************************************************************************
249  for (unsigned int i = 0; i < m_Imat_v_i_spaces.size(); ++i) {
250  if ((m_env.subDisplayFile()) && (m_env.displayVerbosity() >= 3)) {
251  *m_env.subDisplayFile() << "In GcmExperimentInfo<S_V,S_M,D_V,D_M,P_V,P_M>::constructor()"
252  << ": before instantiating a m_Imat_v_i space"
253  << ", m_paper_Gs[" << i << "] = " << m_paper_Gs[i]
254  << std::endl;
255  }
256  m_Imat_v_i_spaces[i] = new VectorSpace<D_V,D_M>(m_env, "Imat_v_i_spaces_", m_paper_Gs[i], NULL); // to be deleted on destructor
257  D_V unitVec(m_Imat_v_i_spaces[i]->zeroVector());
258  unitVec.cwSet(1.);
259  m_Imat_v_is[i] = new D_M(unitVec); // to be deleted on destructor
260  }
261 
262  if ((m_env.subDisplayFile()) && (m_env.displayVerbosity() >= 3)) {
263  *m_env.subDisplayFile() << "In GcmExperimentInfo<S_V,S_M,D_V,D_M,P_V,P_M>::constructor()"
264  << ": before instantiating the m_Rmat_v_i spaces"
265  << ", m_paper_n = " << m_paper_n
266  << std::endl;
267  }
268  for (unsigned int i = 0; i < m_Rmat_v_i_spaces.size(); ++i) {
269  m_Rmat_v_i_spaces[i] = new VectorSpace<D_V,D_M>(m_env, "Smat_v_i_spaces_", m_paper_n, NULL); // to be deleted on destructor
270  m_Rmat_v_is[i] = new D_M(m_Rmat_v_i_spaces[i]->zeroVector()); // to be deleted on destructor
271  }
272 
273  unsigned int sumDims = 0;
274  for (unsigned int i = 0; i < m_Smat_v_i_spaces.size(); ++i) {
275  if ((m_env.subDisplayFile()) && (m_env.displayVerbosity() >= 3)) {
276  *m_env.subDisplayFile() << "In GcmExperimentInfo<S_V,S_M,D_V,D_M,P_V,P_M>::constructor()"
277  << ": before instantiating a m_Smat_v_i space"
278  << ", m_paper_Gs[" << i << "] = " << m_paper_Gs[i]
279  << std::endl;
280  }
281  m_Smat_v_i_spaces[i] = new VectorSpace<D_V,D_M>(m_env, "Smat_v_i_spaces_", m_paper_n*m_paper_Gs[i], NULL); // to be deleted on destructor
282  sumDims += m_paper_n*m_paper_Gs[i];
283  m_Smat_v_is[i] = new D_M(m_Smat_v_i_spaces[i]->zeroVector()); // to be deleted on destructor
284  }
285  if ((m_env.subDisplayFile()) && (m_env.displayVerbosity() >= 3)) {
286  *m_env.subDisplayFile() << "In GcmExperimentInfo<S_V,S_M,D_V,D_M,P_V,P_M>::constructor()"
287  << ": finished instantiating the m_Smat_v_i spaces"
288  << ", m_paper_n = " << m_paper_n
289  << ", m_paper_p_delta = " << m_paper_p_delta
290  << ", sumDims = " << sumDims
291  << std::endl;
292  }
293  queso_require_equal_to_msg(sumDims, m_v_size, "'sumDims' and 'm_v_size' should be equal");
294 
295  //********************************************************************************
296  // Instantiate 'v_hat_v_asterisk' matrices
297  //********************************************************************************
298  unsigned int sumNumRows = 0;
299  unsigned int sumNumCols = 0;
300  for (unsigned int i = 0; i < m_Smat_v_hat_v_asterisk_is.size(); ++i) {
301  m_Rmat_v_hat_v_asterisk_is[i] = new D_M(m_env, m_paper_n_space.map(), (unsigned int) 1); // to be deleted on destructor; Yes, only 1 column
302  m_Smat_v_hat_v_asterisk_is[i] = new D_M(m_env, m_paper_n_space.map(), (unsigned int) 1); // to be deleted on destructor; Yes, only 1 column
303  sumNumRows += m_paper_n_space.dimLocal();
304  sumNumCols += 1;
305  }
306  if ((m_env.subDisplayFile()) && (m_env.displayVerbosity() >= 3)) {
307  *m_env.subDisplayFile() << "In GcmExperimentInfo<S_V,S_M,D_V,D_M,P_V,P_M>::constructor()"
308  << ": finished instantiating the m_Smat_v_hat_v_asterisk_i matrices"
309  << std::endl;
310  }
311  queso_require_equal_to_msg(sumNumRows, m_v_size, "'sumNumRows' and 'm_v_size' should be equal");
312  queso_require_equal_to_msg(sumNumCols, m_paper_p_delta, "'sumNumCols' and 'm_paper_p_delta' should be equal");
313 
314  //********************************************************************************
315  // Display information
316  //********************************************************************************
317  if ((m_env.subDisplayFile()) && (m_env.displayVerbosity() >= 2)) {
318  *m_env.subDisplayFile() << "KEY In GcmExperimentInfo<S_V,S_M,D_V,D_M,P_V,P_M>::constructor()"
319  << "\n KEY m_paper_p_x = " << m_paper_p_x
320  << "\n KEY m_paper_n = " << m_paper_n
321  << "\n KEY m_paper_n_ys_transformed.size() = " << m_paper_n_ys_transformed.size()
322  << "\n KEY m_paper_n_ys_transformed =";
323  for (unsigned int i = 0; i < m_paper_n_ys_transformed.size(); ++i) {
325  }
326  *m_env.subDisplayFile() << "\n KEY m_paper_n_y = " << m_paper_n_y
327  << "\n KEY m_paper_p_delta = " << m_paper_p_delta
328  << "\n KEY m_paper_F = " << m_paper_F
329  << "\n KEY m_paper_Gs.size() = " << m_paper_Gs.size()
330  << "\n KEY m_paper_Gs =";
331  for (unsigned int i = 0; i < m_paper_Gs.size(); ++i) {
332  *m_env.subDisplayFile() << " " << m_paper_Gs[i];
333  }
334  *m_env.subDisplayFile() << "\n KEY m_5lambdaYDim = " << m_5lambdaYDim
335  << ", m_5lambdaYGammaAVec = " << m_5lambdaYGammaAVec
336  << ", m_5lambdaYGammaBVec = " << m_5lambdaYGammaBVec
337  << "\n KEY m_6lambdaVDim = " << m_6lambdaVDim
338  << ", m_6lambdaVGammaAVec = " << m_6lambdaVGammaAVec
339  << ", m_6lambdaVGammaBVec = " << m_6lambdaVGammaBVec
340  << "\n KEY m_7rhoVDim = " << m_7rhoVDim
341  << ", m_7rhoVBetaAVec = " << m_7rhoVBetaAVec
342  << ", m_7rhoVBetaBVec = " << m_7rhoVBetaBVec
343  << "\n KEY m_8thetaDim = " << m_8thetaDim
344  << "\n KEY full 'y' vector size = " << m_paper_n_y // = experimentStorage->yVec_transformed().sizeLocal()
345  << std::endl;
346  }
347 
348  //********************************************************************************
349  // Make checks
350  //********************************************************************************
351  queso_require_equal_to_msg(experimentStorage.yVec_transformed().sizeLocal(), m_paper_n_y, "incompatible calculations for 'y' vector size");
352 
353  queso_require_equal_to_msg(m_paper_n, m_paper_n_ys_transformed.size(), "'m_paper_n' and 'm_paper_n_ys_transformed.size()' should be equal");
354 
355  queso_require_equal_to_msg(m_paper_F, m_paper_Gs.size(), "'m_paper_F' and 'm_paper_Gs.size()' should be equal");
356 
357  unsigned int sumGs = 0;
358  for (unsigned int i = 0; i < m_paper_F; ++i) {
359  if ((m_env.subDisplayFile()) && (m_env.displayVerbosity() >= 3)) {
360  *m_env.subDisplayFile() << "In GcmExperimentInfo<S_V,S_M,D_V,D_M,P_V,P_M>::constructor()"
361  << ": m_paper_Gs[" << i << "] = " << m_paper_Gs[i]
362  << std::endl;
363  }
364  sumGs += m_paper_Gs[i];
365  }
366  if ((m_env.subDisplayFile()) && (m_env.displayVerbosity() >= 3)) {
367  *m_env.subDisplayFile() << "In GcmExperimentInfo<S_V,S_M,D_V,D_M,P_V,P_M>::constructor()"
368  << ": sumGs = " << sumGs
369  << std::endl;
370  }
371  queso_require_equal_to_msg(m_paper_p_delta, sumGs, "'m_paper_p_delta' and 'sumGs' should be equal");
372 
373  if ((m_env.subDisplayFile()) && (m_env.displayVerbosity() >= 2)) {
374  *m_env.subDisplayFile() << "Leaving GcmExperimentInfo<S_V,S_M,D_V,D_M,P_V,P_M>::constructor()"
375  << std::endl;
376  }
377 }
378 
379 template <class S_V,class S_M,class D_V,class D_M,class P_V,class P_M>
381 {
382  for (unsigned int i = 0; i < m_Smat_v_hat_v_asterisk_is.size(); ++i) {
383  delete m_Smat_v_hat_v_asterisk_is[i]; // to be deleted on destructor
384  m_Smat_v_hat_v_asterisk_is[i] = NULL;
385  delete m_Rmat_v_hat_v_asterisk_is[i]; // to be deleted on destructor
386  m_Rmat_v_hat_v_asterisk_is[i] = NULL;
387  }
388 
389  for (unsigned int i = 0; i < m_Smat_v_i_spaces.size(); ++i) {
390  delete m_Smat_v_is[i]; // to be deleted on destructor
391  m_Smat_v_is[i] = NULL;
392  delete m_Smat_v_i_spaces[i]; // to be deleted on destructor
393  m_Smat_v_i_spaces[i] = NULL;
394 
395  delete m_Rmat_v_is[i]; // to be deleted on destructor
396  m_Rmat_v_is[i] = NULL;
397  delete m_Rmat_v_i_spaces[i]; // to be deleted on destructor
398  m_Rmat_v_i_spaces[i] = NULL;
399 
400  delete m_Imat_v_is[i]; // to be deleted on destructor
401  m_Imat_v_is[i] = NULL;
402  delete m_Imat_v_i_spaces[i]; // to be deleted on destructor
403  m_Imat_v_i_spaces[i] = NULL;
404  }
405 
406  delete m_Dmat_BlockDiag_permut;
407  delete m_PD;
408 }
409 
410 } // End namespace QUESO
411 
unsigned int displayVerbosity() const
Definition: Environment.C:396
std::vector< unsigned int > m_paper_n_ys_transformed
unsigned int dimLocal() const
Definition: VectorSpace.C:170
std::vector< D_M * > m_Smat_v_is
std::vector< D_M * > m_Smat_v_hat_v_asterisk_is
std::vector< VectorSpace< D_V, D_M > * > m_Imat_v_i_spaces
const Map & map() const
Map.
Definition: VectorSpace.C:157
std::vector< VectorSpace< D_V, D_M > * > m_Smat_v_i_spaces
const BaseEnvironment & m_env
std::set< unsigned int > m_dataOutputAllowedSet
const V & zeroVector() const
Returns a vector filled with zeros.
Definition: VectorSpace.C:189
GcmExperimentInfo(const GpmsaComputerModelOptions &gcmOptionsObj, bool allOutputsAreScalar, const ExperimentStorage< S_V, S_M, D_V, D_M > &experimentStorage, const ExperimentModel< S_V, S_M, D_V, D_M > &experimentModel, const BaseVectorRV< P_V, P_M > &thetaPriorRv)
VectorSpace< D_V, D_M > m_v_space
#define queso_require_equal_to_msg(expr1, expr2, msg)
Definition: asserts.h:85
std::ofstream * subDisplayFile() const
Access function for m_subDisplayFile (displays file on stream).
Definition: Environment.C:274
unsigned int MiscUintDebugMessage(unsigned int value, const char *message)
std::vector< D_M * > m_Rmat_v_is
unsigned int subId() const
Access function to the number of each sub-environment Id: m_subId.
Definition: Environment.C:295
VectorSpace< P_V, P_M > m_paper_n_space
const D_V & yVec_transformed() const
std::vector< D_M * > m_Imat_v_is
VectorSpace< D_V, D_M > m_y_space
unsigned int checkingLevel() const
Access function to private attribute m_checkingLevel.
Definition: Environment.C:410
const D_M & Dmat_BlockDiag() const
std::vector< unsigned int > m_paper_Gs
A class representing a vector space.
Definition: VectorSet.h:49
std::vector< VectorSpace< D_V, D_M > * > m_Rmat_v_i_spaces
std::vector< D_M * > m_Rmat_v_hat_v_asterisk_is
const D_M & Wy() const

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