25 #include <queso/GcmJointInfo.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,
class P_V,
class P_M,
class Q_V,
class Q_M>
34 bool allOutputsAreScalar,
39 m_unique_u_space (m_env,
"unique_u_", s.m_paper_p_eta, NULL),
40 m_Smat_u_asterisk_u_asterisk (m_unique_u_space.zeroVector()),
41 m_u_size (e.m_paper_n * s.m_paper_p_eta),
42 m_u_space (m_env,
"u_", m_u_size, NULL),
43 m_Rmat_u_is (s.m_paper_p_eta, (D_M*) NULL),
44 m_Smat_u_is (s.m_paper_p_eta, (D_M*) NULL),
45 m_Rmat_uw_is (s.m_paper_p_eta, (D_M*) NULL),
46 m_Smat_uw_is (s.m_paper_p_eta, (D_M*) NULL),
47 m_Smat_uw (m_env, m_u_space.map(),s.m_w_size),
48 m_Smat_uw_t (m_env,s.m_w_space.map(), m_u_size),
49 m_Rmat_u_hat_u_asterisk_is (s.m_paper_p_eta, (D_M*) NULL),
50 m_Smat_u_hat_u_asterisk_is (s.m_paper_p_eta, (D_M*) NULL),
51 m_Smat_u_hat_u_asterisk (m_env, m_u_space.map(), s.m_paper_p_eta),
52 m_Smat_u_hat_u_asterisk_t (m_env, m_unique_u_space.map(), m_u_size),
53 m_Rmat_w_hat_u_asterisk_is (s.m_paper_p_eta, (D_M*) NULL),
54 m_Smat_w_hat_u_asterisk_is (s.m_paper_p_eta, (D_M*) NULL),
55 m_Smat_w_hat_u_asterisk (m_env, s.m_w_space.map(), s.m_paper_p_eta),
56 m_Smat_w_hat_u_asterisk_t (m_env, m_unique_u_space.map(), s.m_w_size),
57 m_vu_size (e.m_v_size + m_u_size),
58 m_vu_space (m_env,
"vu_", m_vu_size, NULL),
59 m_unique_vu_space (m_env,
"unique_vu_", e.m_paper_p_delta + s.m_paper_p_eta, NULL),
61 m_predVU_summingRVs_unique_vu_meanVec (m_unique_vu_space.zeroVector()),
62 m_predVU_summingRVs_mean_of_unique_vu_covMatrices(m_unique_vu_space.zeroVector()),
63 m_predVU_summingRVs_covMatrix_of_unique_vu_means (m_unique_vu_space.zeroVector()),
64 m_predVU_summingRVs_corrMatrix_of_unique_vu_means(m_unique_vu_space.zeroVector()),
65 m_omega_size (e.m_paper_n_y + s.m_eta_size),
66 m_omega_space (m_env,
"omega_", m_omega_size, NULL),
67 m_Zvec_hat_vu (m_vu_space.zeroVector()),
68 m_Smat_u (m_u_space.zeroVector()),
69 m_Bmat_with_permut (NULL),
70 m_Bmat_without_permut (NULL),
72 m_Bwp_t__Wy__Bwp (NULL),
73 m_Bop_t__Wy__Bop (NULL),
74 m_Bwp_t__Wy__Bwp__inv (NULL),
75 m_Bop_t__Wy__Bop__inv (NULL),
80 *
m_env.
subDisplayFile() <<
"Entering GcmJointInfo<S_V,S_M,D_V,D_M,P_V,P_M,Q_V,Q_M>::constructor()"
81 <<
": allOutputsAreScalar = " << allOutputsAreScalar
83 <<
", some entities just created (not yet populated)"
84 <<
", m_Smat_uw.numRowsLocal() = " <<
m_Smat_uw.numRowsLocal()
85 <<
", m_Smat_uw.numCols() = " <<
m_Smat_uw.numCols()
86 <<
", m_Smat_uw_t.numRowsLocal() = " <<
m_Smat_uw_t.numRowsLocal()
87 <<
", m_Smat_uw_t.numCols() = " <<
m_Smat_uw_t.numCols()
88 <<
", m_Zvec_hat_vu.sizeLocal() = " <<
m_Zvec_hat_vu.sizeLocal()
89 <<
", m_Smat_u.numRowsLocal() = " <<
m_Smat_u.numRowsLocal()
90 <<
", m_Smat_u.numCols() = " <<
m_Smat_u.numCols()
94 std::set<unsigned int> tmpSet;
97 if (allOutputsAreScalar) {
107 for (
unsigned int j = 0; j < e.
m_paper_n; ++j) {
116 D_M PKt(PK.transpose());
118 *
m_env.
subDisplayFile() <<
"In GcmJointInfo<S_V,S_M,D_V,D_M,P_V,P_M,Q_V,Q_M>::constructor()"
120 <<
": PK.numRowsLocal() = " << PK.numRowsLocal()
121 <<
", PK.numCols() = " << PK.numCols()
122 <<
": PKt.numRowsLocal() = " << PKt.numRowsLocal()
123 <<
", PKt.numCols() = " << PKt.numCols()
127 D_M matShouldBeI1( PK * PKt );
129 for (
unsigned int i = 0; i < matI1.numRowsLocal(); ++i) {
132 matShouldBeI1 -= matI1;
133 double auxNorm1 = matShouldBeI1.normFrob();
135 D_M matShouldBeI2( PKt * PK );
137 for (
unsigned int i = 0; i < matI2.numRowsLocal(); ++i) {
140 matShouldBeI2 -= matI2;
141 double auxNorm2 = matShouldBeI2.normFrob();
144 *
m_env.
subDisplayFile() <<
"In GcmJointInfo<S_V,S_M,D_V,D_M,P_V,P_M,Q_V,Q_M>::constructor()"
146 <<
": matShouldBeI1.numRowsLocal() = " << matShouldBeI1.numRowsLocal()
147 <<
", ||matI1||_2^2 = " << matI1.normFrob() * matI1.normFrob()
148 <<
", ||matShouldBeI1 - matI1||_2^2 = " << auxNorm1 * auxNorm1
149 <<
"; matShouldBeI2.numRowsLocal() = " << matShouldBeI2.numRowsLocal()
150 <<
", ||matI2||_2^2 = " << matI2.normFrob() * matI2.normFrob()
151 <<
", ||matShouldBeI2 - matI2||_2^2 = " << auxNorm2 * auxNorm2
157 *
m_env.
subDisplayFile() <<
"In GcmJointInfo<S_V,S_M,D_V,D_M,P_V,P_M,Q_V,Q_M>::constructor()"
158 <<
": finished forming 'P_K'"
169 *
m_env.
subDisplayFile() <<
"In GcmJointInfo<S_V,S_M,D_V,D_M,P_V,P_M,Q_V,Q_M>::constructor()"
170 <<
": Kmat_interp_BlockDiag.numRowsLocal() = " << Kmat_interp_BlockDiag.numRowsLocal()
171 <<
", Kmat_interp_BlockDiag.numCols() = " << Kmat_interp_BlockDiag.numCols()
175 Kmat_interp_BlockDiag.fillWithBlocksDiagonally(0,0,e.
m_experimentModel.Kmats_interp(),
true,
true);
178 *
m_env.
subDisplayFile() <<
"In GcmJointInfo<S_V,S_M,D_V,D_M,P_V,P_M,Q_V,Q_M>::constructor()"
179 <<
": finished forming 'Kmat_interp_BlockDiag'"
184 Kmat_interp_BlockDiag.subWriteContents(
"Kmat_interp_BlockDiag",
185 "mat_Kmat_interp_BlockDiag",
193 Kmat_interp_BlockDiag_permut = Kmat_interp_BlockDiag * (PK.transpose());
196 *
m_env.
subDisplayFile() <<
"In GcmJointInfo<S_V,S_M,D_V,D_M,P_V,P_M,Q_V,Q_M>::constructor()"
197 <<
": finished computing 'Kmat_interp_BlockDiag_permut'"
206 *
m_env.
subDisplayFile() <<
"In GcmJointInfo<S_V,S_M,D_V,D_M,P_V,P_M,Q_V,Q_M>::constructor()"
208 <<
", m_Bmat_with_permut just created (not yet populated)"
217 *
m_env.
subDisplayFile() <<
"In GcmJointInfo<S_V,S_M,D_V,D_M,P_V,P_M,Q_V,Q_M>::constructor()"
219 <<
", m_Bwp_t__Wy__Bwp just created (not yet populated)"
220 <<
", numRowsLocal() = " << m_Bwp_t__Wy__Bwp->numRowsLocal()
221 <<
", numCols() = " << m_Bwp_t__Wy__Bwp->numCols()
229 *
m_env.
subDisplayFile() <<
"In GcmJointInfo<S_V,S_M,D_V,D_M,P_V,P_M,Q_V,Q_M>::constructor():"
234 <<
"\n m_PD->numRowsLocal() = " << e.
m_PD->numRowsLocal()
235 <<
"\n m_PD->numCols() = " << e.
m_PD->numCols()
236 <<
"\n Kmat_interp_BlockDiag_permut.numRowsLocal() = " << Kmat_interp_BlockDiag_permut.numRowsLocal()
237 <<
"\n Kmat_interp_BlockDiag_permut.numCols() = " << Kmat_interp_BlockDiag_permut.numCols()
238 <<
"\n PK.numRowsLocal() = " << PK.numRowsLocal()
239 <<
"\n PK.numCols() = " << PK.numCols()
245 std::vector<const P_M* > twoMats(2, (P_M*) NULL);
248 twoMats[1] = &Kmat_interp_BlockDiag_permut;
252 twoMats[1] = &Kmat_interp_BlockDiag;
271 Btt.fillWithTranspose(0,0,Bwp_t,
true,
true);
273 double btDiffNorm = Btt.normFrob();
275 *
m_env.
subDisplayFile() <<
"In GcmJointInfo<S_V,S_M,D_V,D_M,P_V,P_M,Q_V,Q_M>::constructor()"
276 <<
": ||Btt - B||_2 = " << btDiffNorm
287 m_Bmat_rank = Bwp_t.rank(0.,1.e-8);
288 bRank14 = Bwp_t.rank(0.,1.e-14);
292 *
m_env.
subDisplayFile() <<
"In GcmJointInfo<S_V,S_M,D_V,D_M,P_V,P_M,Q_V,Q_M>::constructor()"
293 <<
": finished forming 'm_Bmat'"
296 <<
", m_Bmat_with_permut->rank(0.,1.e-8) = " << m_Bmat_rank
297 <<
", m_Bmat_with_permut->rank(0.,1.e-14) = " << bRank14
308 Bmat_filtered.setPrintHorizontally(
false);
309 Bmat_filtered.filterSmallValues(1.e-6);
310 *
m_env.
subDisplayFile() <<
"In GcmJointInfo<S_V,S_M,D_V,D_M,P_V,P_M,Q_V,Q_M>::constructor()"
311 <<
": Bmat_filtered.numRowsLocal() = " << Bmat_filtered.numRowsLocal()
312 <<
", Bmat_filtered.numCols() = " << Bmat_filtered.numCols()
313 <<
", Bmat_filtered contents =\n" << Bmat_filtered
321 *
m_env.
subDisplayFile() <<
"In GcmJointInfo<S_V,S_M,D_V,D_M,P_V,P_M,Q_V,Q_M>::constructor():"
322 <<
"\n m_Bwp_t__Wy__Bwp->numRowsLocal() = " << m_Bwp_t__Wy__Bwp->numRowsLocal()
323 <<
"\n m_Bwp_t__Wy__Bwp->numCols() = " << m_Bwp_t__Wy__Bwp->numCols()
324 <<
"\n Bwp_t.numRowsLocal() = " << Bwp_t.numRowsLocal()
325 <<
"\n Bwp_t.numCols() = " << Bwp_t.numCols()
326 <<
"\n m_Wy->numRowsLocal() = " << e.
m_Wy->numRowsLocal()
327 <<
"\n m_Wy->numCols() = " << e.
m_Wy->numCols()
335 *
m_env.
subDisplayFile() <<
"In GcmJointInfo<S_V,S_M,D_V,D_M,P_V,P_M,Q_V,Q_M>::constructor()"
336 <<
": finished computing 'm_Bwp_t__Wy__Bwp'"
340 m_Bwp_t__Wy__Bwp->subWriteContents(
"Bwp_t__Wy__Bwp",
341 "mat_Bwp_t__Wy__Bwp",
347 double Bwp_t__Wy__Bwp__LnDeterminant = m_Bwp_t__Wy__Bwp->lnDeterminant();
348 unsigned int Bwp_t__Wy__Bwp__Rank = m_Bwp_t__Wy__Bwp->rank(0.,1.e-8 );
349 unsigned int Bwp_t__Wy__Bwp__Rank14 = m_Bwp_t__Wy__Bwp->rank(0.,1.e-14);
351 *
m_env.
subDisplayFile() <<
"In GcmJointInfo<S_V,S_M,D_V,D_M,P_V,P_M,Q_V,Q_M>::constructor()"
352 <<
": m_Bwp_t__Wy__Bwp->numRowsLocal() = " << m_Bwp_t__Wy__Bwp->numRowsLocal()
353 <<
", m_Bwp_t__Wy__Bwp->numCols() = " << m_Bwp_t__Wy__Bwp->numCols()
354 <<
", m_Bwp_t__Wy__Bwp->lnDeterminant() = " << Bwp_t__Wy__Bwp__LnDeterminant
355 <<
", m_Bwp_t__Wy__Bwp->rank(0.,1.e-8) = " << Bwp_t__Wy__Bwp__Rank
356 <<
", m_Bwp_t__Wy__Bwp->rank(0.,1.e-14) = " << Bwp_t__Wy__Bwp__Rank14
364 *m_Bwp_t__Wy__Bwp__inv = m_Bwp_t__Wy__Bwp->inverse();
366 double Bwp_t__Wy__Bwp__inv__LnDeterminant = m_Bwp_t__Wy__Bwp__inv->lnDeterminant();
368 *
m_env.
subDisplayFile() <<
"In GcmJointInfo<S_V,S_M,D_V,D_M,P_V,P_M,Q_V,Q_M>::constructor()"
369 <<
": finished computing 'm_Bwp_t__Wy__Bwp__inv'"
370 <<
", m_Bwp_t__Wy__Bwp__inv->lnDeterminant() = " << Bwp_t__Wy__Bwp__inv__LnDeterminant
375 m_Bwp_t__Wy__Bwp__inv->subWriteContents(
"Bwp_t__Wy__Bwp__inv",
376 "mat_Bwp_t__Wy__Bwp__inv",
382 double Bwp_t__Wy__Bwp__InvLnDeterminant = m_Bwp_t__Wy__Bwp__inv->lnDeterminant();
383 unsigned int Bwp_t__Wy__Bwp__InvRank = m_Bwp_t__Wy__Bwp__inv->rank(0.,1.e-8 );
384 unsigned int Bwp_t__Wy__Bwp__InvRank14 = m_Bwp_t__Wy__Bwp__inv->rank(0.,1.e-14);
386 *
m_env.
subDisplayFile() <<
"In GcmJointInfo<S_V,S_M,D_V,D_M,P_V,P_M,Q_V,Q_M>::constructor()"
387 <<
", m_Bwp_t__Wy__Bwp__inv->numRowsLocal() = " << m_Bwp_t__Wy__Bwp__inv->numRowsLocal()
388 <<
", m_Bwp_t__Wy__Bwp__inv->numCols() = " << m_Bwp_t__Wy__Bwp__inv->numCols()
389 <<
": m_Bwp_t__Wy__Bwp__inv->lnDeterminant() = " << Bwp_t__Wy__Bwp__InvLnDeterminant
390 <<
": m_Bwp_t__Wy__Bwp__inv->rank(0.,1.e-8) = " << Bwp_t__Wy__Bwp__InvRank
391 <<
": m_Bwp_t__Wy__Bwp__inv->rank(0.,1.e-14) = " << Bwp_t__Wy__Bwp__InvRank14
398 D_M matShouldBeI1(*m_Bwp_t__Wy__Bwp * *m_Bwp_t__Wy__Bwp__inv);
399 D_M matShouldBeI2(*m_Bwp_t__Wy__Bwp__inv * *m_Bwp_t__Wy__Bwp );
401 for (
unsigned int i = 0; i < matI.numRowsLocal(); ++i) {
404 matShouldBeI1 -= matI;
405 double auxNorm1 = matShouldBeI1.normFrob();
406 matShouldBeI2 -= matI;
407 double auxNorm2 = matShouldBeI2.normFrob();
409 *
m_env.
subDisplayFile() <<
"In GcmJointInfo<S_V,S_M,D_V,D_M,P_V,P_M,Q_V,Q_M>::constructor()"
410 <<
", tests on m_Bt_Wy_B"
411 <<
": matShouldBeI1.numRowsLocal() = " << matShouldBeI1.numRowsLocal()
414 <<
", ||matI||_2^2 = " << matI.normFrob() * matI.normFrob()
415 <<
", ||matShouldBeI1 - matI||_2^2 = " << auxNorm1 * auxNorm1
416 <<
", ||matShouldBeI2 - matI||_2^2 = " << auxNorm2 * auxNorm2
431 *
m_env.
subDisplayFile() <<
"In GcmJointInfo<S_V,S_M,D_V,D_M,P_V,P_M,Q_V,Q_M>::constructor():"
432 <<
"\n m_Bop_t__Wy__Bop->numRowsLocal() = " <<
m_Bop_t__Wy__Bop->numRowsLocal()
434 <<
"\n Bop_t.numRowsLocal() = " << Bop_t.numRowsLocal()
435 <<
"\n Bop_t.numCols() = " << Bop_t.numCols()
436 <<
"\n m_Wy->numRowsLocal() = " << e.
m_Wy->numRowsLocal()
437 <<
"\n m_Wy->numCols() = " << e.
m_Wy->numCols()
445 *
m_env.
subDisplayFile() <<
"In GcmJointInfo<S_V,S_M,D_V,D_M,P_V,P_M,Q_V,Q_M>::constructor()"
446 <<
": finished computing 'm_Bop_t__Wy__Bop before nugget'"
450 m_Bop_t__Wy__Bop->subWriteContents(
"Bop_t__Wy__Bop__beforePermut_beforeNugget",
451 "mat_Bop_t__Wy__Bop__beforePermut_beforeNugget",
458 double Bop_t__Wy__Bop__beforeNugget__LnDeterminant =
m_Bop_t__Wy__Bop->lnDeterminant();
459 unsigned int Bop_t__Wy__Bop__beforeNugget__Rank =
m_Bop_t__Wy__Bop->rank(0.,1.e-8 );
460 unsigned int Bop_t__Wy__Bop__beforeNugget__Rank14 =
m_Bop_t__Wy__Bop->rank(0.,1.e-14);
462 *
m_env.
subDisplayFile() <<
"In GcmJointInfo<S_V,S_M,D_V,D_M,P_V,P_M,Q_V,Q_M>::constructor()"
463 <<
", m_Bop_t__Wy__Bop__beforeNugget.numRowsLocal() = " <<
m_Bop_t__Wy__Bop->numRowsLocal()
464 <<
", m_Bop_t__Wy__Bop__beforeNugget.numCols() = " <<
m_Bop_t__Wy__Bop->numCols()
465 <<
": m_Bop_t__Wy__Bop__beforeNugget.lnDeterminant() = " << Bop_t__Wy__Bop__beforeNugget__LnDeterminant
466 <<
", m_Bop_t__Wy__Bop__beforeNugget.rank(0.,1.e-8) = " << Bop_t__Wy__Bop__beforeNugget__Rank
467 <<
", m_Bop_t__Wy__Bop__beforeNugget.rank(0.,1.e-14) = " << Bop_t__Wy__Bop__beforeNugget__Rank14
478 matP.fillWithBlocksDiagonally(0,0,twoMats,
true,
true);
482 *
m_env.
subDisplayFile() <<
"In GcmJointInfo<S_V,S_M,D_V,D_M,P_V,P_M,Q_V,Q_M>::constructor()"
483 <<
": finished computing 'm_Bop_t__Wy__Bop after permutation'"
487 m_Bop_t__Wy__Bop->subWriteContents(
"Bop_t__Wy__Bop__afterPermut_beforeNugget",
488 "mat_Bop_t__Wy__Bop__afterPermut_beforeNugget",
498 *
m_env.
subDisplayFile() <<
"In GcmJointInfo<S_V,S_M,D_V,D_M,P_V,P_M,Q_V,Q_M>::constructor()"
499 <<
": m_Bop_t__Wy__Bop->numRowsLocal() = " <<
m_Bop_t__Wy__Bop->numRowsLocal()
501 <<
", m_Bop_t__Wy__Bop->lnDeterminant() = " << Bop_t__Wy__Bop__LnDeterminant
502 <<
", m_Bop_t__Wy__Bop->rank(0.,1.e-8) = " << Bop_t__Wy__Bop__Rank
503 <<
", m_Bop_t__Wy__Bop->rank(0.,1.e-14) = " << Bop_t__Wy__Bop__Rank14
517 *
m_env.
subDisplayFile() <<
"In GcmJointInfo<S_V,S_M,D_V,D_M,P_V,P_M,Q_V,Q_M>::constructor()"
518 <<
": finished computing 'm_Bop_t__Wy__Bop after permutation and after nugget'"
522 m_Bop_t__Wy__Bop->subWriteContents(
"Bop_t__Wy__Bop__afterPermut_afterNugget",
523 "mat_Bop_t__Wy__Bop__afterPermut_afterNugget",
530 double Bop_t__Wy__Bop__afterNugget__LnDeterminant =
m_Bop_t__Wy__Bop->lnDeterminant();
531 unsigned int Bop_t__Wy__Bop__afterNugget__Rank =
m_Bop_t__Wy__Bop->rank(0.,1.e-8 );
532 unsigned int Bop_t__Wy__Bop__afterNugget__Rank14 =
m_Bop_t__Wy__Bop->rank(0.,1.e-14);
534 *
m_env.
subDisplayFile() <<
"In GcmJointInfo<S_V,S_M,D_V,D_M,P_V,P_M,Q_V,Q_M>::constructor()"
535 <<
", m_Bop_t__Wy__Bop__afterNugget.numRowsLocal() = " <<
m_Bop_t__Wy__Bop->numRowsLocal()
536 <<
", m_Bop_t__Wy__Bop__afterNugget.numCols() = " <<
m_Bop_t__Wy__Bop->numCols()
537 <<
": m_Bop_t__Wy__Bop__afterNugget.lnDeterminant() = " << Bop_t__Wy__Bop__afterNugget__LnDeterminant
538 <<
", m_Bop_t__Wy__Bop__afterNugget.rank(0.,1.e-8) = " << Bop_t__Wy__Bop__afterNugget__Rank
539 <<
", m_Bop_t__Wy__Bop__afterNugget.rank(0.,1.e-14) = " << Bop_t__Wy__Bop__afterNugget__Rank14
550 double Bop_t__Wy__Bop__inv__beforeNugget__LnDeterminant = m_Bop_t__Wy__Bop__inv->lnDeterminant();
551 unsigned int Bop_t__Wy__Bop__beforeNugget__InvRank = m_Bop_t__Wy__Bop__inv->rank(0.,1.e-8 );
552 unsigned int Bop_t__Wy__Bop__beforeNugget__InvRank14 = m_Bop_t__Wy__Bop__inv->rank(0.,1.e-14);
554 *
m_env.
subDisplayFile() <<
"In GcmJointInfo<S_V,S_M,D_V,D_M,P_V,P_M,Q_V,Q_M>::constructor()"
555 <<
", m_Bop_t__Wy__Bop__inv__beforeNugget.numRowsLocal() = " << m_Bop_t__Wy__Bop__inv->numRowsLocal()
556 <<
", m_Bop_t__Wy__Bop__inv__beforeNugget.numCols() = " << m_Bop_t__Wy__Bop__inv->numCols()
557 <<
": m_Bop_t__Wy__Bop__inv__beforeNugget.lnDeterminant() = " << Bop_t__Wy__Bop__inv__beforeNugget__LnDeterminant
558 <<
", m_Bop_t__Wy__Bop__inv__beforeNugget.rank(0.,1.e-8) = " << Bop_t__Wy__Bop__beforeNugget__InvRank
559 <<
", m_Bop_t__Wy__Bop__inv__beforeNugget.rank(0.,1.e-14) = " << Bop_t__Wy__Bop__beforeNugget__InvRank14
565 m_Bop_t__Wy__Bop__inv->subWriteContents(
"Bop_t__Wy__Bop__inv__beforeNuggetForInv",
566 "mat_Bop_t__Wy__Bop__inv__beforeNuggetForInv",
573 for (
unsigned int i = 0; i < m_Bop_t__Wy__Bop__inv->numRowsLocal(); ++i) {
579 double Bop_t__Wy__Bop__inv__afterNugget__LnDeterminant = m_Bop_t__Wy__Bop__inv->lnDeterminant();
580 unsigned int Bop_t__Wy__Bop__afterNugget__InvRank = m_Bop_t__Wy__Bop__inv->rank(0.,1.e-8 );
581 unsigned int Bop_t__Wy__Bop__afterNugget__InvRank14 = m_Bop_t__Wy__Bop__inv->rank(0.,1.e-14);
583 *
m_env.
subDisplayFile() <<
"In GcmJointInfo<S_V,S_M,D_V,D_M,P_V,P_M,Q_V,Q_M>::constructor()"
584 <<
", m_Bop_t__Wy__Bop__inv__afterNugget.numRowsLocal() = " << m_Bop_t__Wy__Bop__inv->numRowsLocal()
585 <<
", m_Bop_t__Wy__Bop__inv__afterNugget.numCols() = " << m_Bop_t__Wy__Bop__inv->numCols()
586 <<
": m_Bop_t__Wy__Bop__inv__afterNugget.lnDeterminant() = " << Bop_t__Wy__Bop__inv__afterNugget__LnDeterminant
587 <<
", m_Bop_t__Wy__Bop__inv__afterNugget.rank(0.,1.e-8) = " << Bop_t__Wy__Bop__afterNugget__InvRank
588 <<
", m_Bop_t__Wy__Bop__inv__afterNugget.rank(0.,1.e-14) = " << Bop_t__Wy__Bop__afterNugget__InvRank14
594 m_Bop_t__Wy__Bop__inv->subWriteContents(
"Bop_t__Wy__Bop__inv__afterNuggetForInv",
595 "mat_Bop_t__Wy__Bop__inv__afterNuggetForInv",
605 for (
unsigned int i = 0; i < matI.numRowsLocal(); ++i) {
608 matShouldBeI1 -= matI;
609 double auxNorm1 = matShouldBeI1.normFrob();
610 matShouldBeI2 -= matI;
611 double auxNorm2 = matShouldBeI2.normFrob();
613 *
m_env.
subDisplayFile() <<
"In GcmJointInfo<S_V,S_M,D_V,D_M,P_V,P_M,Q_V,Q_M>::constructor()"
614 <<
", tests on m_Bt_Wy_B"
615 <<
": matShouldBeI1.numRowsLocal() = " << matShouldBeI1.numRowsLocal()
618 <<
", ||matI||_2^2 = " << matI.normFrob() * matI.normFrob()
619 <<
", ||matShouldBeI1 - matI||_2^2 = " << auxNorm1 * auxNorm1
620 <<
", ||matShouldBeI2 - matI||_2^2 = " << auxNorm2 * auxNorm2
630 *
m_env.
subDisplayFile() <<
"In GcmJointInfo<S_V,S_M,D_V,D_M,P_V,P_M,Q_V,Q_M>::constructor()"
637 *
m_env.
subDisplayFile() <<
"In GcmJointInfo<S_V,S_M,D_V,D_M,P_V,P_M,Q_V,Q_M>::constructor()"
638 <<
": m_Zvec_hat_vu.sizeLocal() = " <<
m_Zvec_hat_vu.sizeLocal()
639 <<
", m_Bop_t__Wy__Bop__inv->numRowsLocal() = " << m_Bop_t__Wy__Bop__inv->numRowsLocal()
640 <<
", m_Bop_t__Wy__Bop__inv->numCols() = " << m_Bop_t__Wy__Bop__inv->numCols()
641 <<
", Bop_t.numRowsLocal() = " << Bop_t.numRowsLocal()
642 <<
", Bop_t.numCols() = " << Bop_t.numCols()
643 <<
", m_Wy->numRowsLocal() = " << e.
m_Wy->numRowsLocal()
644 <<
", m_Wy->numCols() = " << e.
m_Wy->numCols()
645 <<
", yVec_transformed.sizeLocal() = " << yVec_transformed.sizeLocal()
657 *
m_env.
subDisplayFile() <<
"In GcmJointInfo<S_V,S_M,D_V,D_M,P_V,P_M,Q_V,Q_M>::constructor()"
658 <<
", yVec_transformed = " << yVec_transformed.sizeLocal()
659 <<
", m_Zvec_hat_vu = " << m_Zvec_hat_vu
660 <<
", tmpVec2 (initial) = " << tmpVec2
664 tmpVec2 = *e.
m_Wy * tmpVec2;
667 *
m_env.
subDisplayFile() <<
"In GcmJointInfo<S_V,S_M,D_V,D_M,P_V,P_M,Q_V,Q_M>::constructor()"
668 <<
": tmpVec2 (final) = " << tmpVec2
677 unsigned int sumDims = 0;
678 for (
unsigned int i = 0; i <
m_Smat_u_is.size(); ++i) {
684 *
m_env.
subDisplayFile() <<
"In GcmJointInfo<S_V,S_M,D_V,D_M,P_V,P_M,Q_V,Q_M>::constructor()"
685 <<
": finished instantiating the m_Smat_u_i spaces"
690 unsigned int sumNumRows = 0;
691 unsigned int sumNumCols = 0;
692 for (
unsigned int i = 0; i <
m_Smat_uw_is.size(); ++i) {
699 *
m_env.
subDisplayFile() <<
"In GcmJointInfo<S_V,S_M,D_V,D_M,P_V,P_M,Q_V,Q_M>::constructor()"
700 <<
": finished instantiating the m_Smat_uw_i matrices"
718 *
m_env.
subDisplayFile() <<
"In GcmJointInfo<S_V,S_M,D_V,D_M,P_V,P_M,Q_V,Q_M>::constructor()"
719 <<
": finished instantiating the m_Smat_u_hat_u_asterisk_i matrices"
737 *
m_env.
subDisplayFile() <<
"In GcmJointInfo<S_V,S_M,D_V,D_M,P_V,P_M,Q_V,Q_M>::constructor()"
738 <<
": finished instantiating the m_Smat_w_hat_u_asterisk_i matrices"
745 *
m_env.
subDisplayFile() <<
"Leaving GcmJointInfo<S_V,S_M,D_V,D_M,P_V,P_M,Q_V,Q_M>::constructor()"
750 template <
class S_V,
class S_M,
class D_V,
class D_M,
class P_V,
class P_M,
class Q_V,
class Q_M>
753 for (
unsigned int i = 0; i < m_Smat_w_hat_u_asterisk_is.size(); ++i) {
754 delete m_Smat_w_hat_u_asterisk_is[i];
755 m_Smat_w_hat_u_asterisk_is[i] = NULL;
756 delete m_Rmat_w_hat_u_asterisk_is[i];
757 m_Rmat_w_hat_u_asterisk_is[i] = NULL;
760 for (
unsigned int i = 0; i < m_Smat_u_hat_u_asterisk_is.size(); ++i) {
761 delete m_Smat_u_hat_u_asterisk_is[i];
762 m_Smat_u_hat_u_asterisk_is[i] = NULL;
763 delete m_Rmat_u_hat_u_asterisk_is[i];
764 m_Rmat_u_hat_u_asterisk_is[i] = NULL;
767 for (
unsigned int i = 0; i < m_Smat_uw_is.size(); ++i) {
768 delete m_Smat_uw_is[i];
769 m_Smat_uw_is[i] = NULL;
770 delete m_Rmat_uw_is[i];
771 m_Rmat_uw_is[i] = NULL;
774 for (
unsigned int i = 0; i < m_Smat_u_is.size(); ++i) {
775 delete m_Smat_u_is[i];
776 m_Smat_u_is[i] = NULL;
777 delete m_Rmat_u_is[i];
778 m_Rmat_u_is[i] = NULL;
781 delete m_Bop_t__Wy__Bop__inv;
782 delete m_Bwp_t__Wy__Bwp__inv;
783 delete m_Bop_t__Wy__Bop;
784 delete m_Bwp_t__Wy__Bwp;
785 delete m_Bmat_without_permut;
786 delete m_Bmat_with_permut;
unsigned int displayVerbosity() const
std::vector< D_M * > m_Rmat_uw_is
unsigned int dimLocal() const
std::vector< D_M * > m_Smat_w_hat_u_asterisk_is
const Map & map() const
Map.
std::vector< D_M * > m_Smat_uw_is
D_M * m_Dmat_BlockDiag_permut
std::vector< D_M * > m_Rmat_u_hat_u_asterisk_is
std::set< unsigned int > m_dataOutputAllowedSet
double m_nuggetValueForBtWyB
const V & zeroVector() const
Returns a vector filled with zeros.
std::vector< D_M * > m_Smat_u_is
#define queso_require_equal_to_msg(expr1, expr2, msg)
unsigned int m_paper_p_eta
const ExperimentStorage< S_V, S_M, D_V, D_M > & m_experimentStorage
double scalarProduct(const GslVector &x, const GslVector &y)
VectorSpace< D_V, D_M > m_vu_space
D_M * m_Bmat_without_permut
std::ofstream * subDisplayFile() const
Access function for m_subDisplayFile (displays file on stream).
VectorSpace< D_V, D_M > m_u_space
std::vector< D_M * > m_Rmat_w_hat_u_asterisk_is
unsigned int MiscUintDebugMessage(unsigned int value, const char *message)
GcmJointInfo(const GpmsaComputerModelOptions &gcmOptionsObj, bool allOutputsAreScalar, const GcmSimulationInfo< S_V, S_M, P_V, P_M, Q_V, Q_M > &s, const GcmExperimentInfo< S_V, S_M, D_V, D_M, P_V, P_M > &e)
std::vector< D_M * > m_Rmat_u_is
const ExperimentModel< S_V, S_M, D_V, D_M > & m_experimentModel
VectorSpace< P_V, P_M > m_paper_m_space
D_M * m_Bop_t__Wy__Bop__inv
unsigned int subId() const
Access function to the number of each sub-environment Id: m_subId.
D_M * m_Bwp_t__Wy__Bwp__inv
VectorSpace< P_V, P_M > m_paper_n_space
const BaseEnvironment & m_env
const D_M * m_Dmat_BlockDiag
VectorSpace< D_V, D_M > m_y_space
std::vector< D_M * > m_Smat_u_hat_u_asterisk_is
unsigned int checkingLevel() const
Access function to private attribute m_checkingLevel.
double m_nuggetValueForBtWyBInv