25 #include <queso/GcmJointTildeInfo.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>
38 m_Bmat_tilde (m_env,e.m_y_space.map(),jj.m_Bmat_rank),
39 m_Bmat_tilde_rank (0),
40 m_vu_tilde_space (m_env,
"vu_tilde_", jj.m_Bmat_rank, NULL),
41 m_Lbmat (m_env,m_vu_tilde_space.map(),jj.m_Bmat_with_permut->numCols()),
42 m_Btildet_Wy_Btilde (m_vu_tilde_space.zeroVector()),
43 m_Btildet_Wy_Btilde_inv(m_vu_tilde_space.zeroVector()),
44 m_Zvec_tilde_hat_vu (m_vu_tilde_space.zeroVector()),
45 m_a_y_modifier_tilde (0),
46 m_b_y_modifier_tilde (0)
48 std::set<unsigned int> tmpSet;
58 unsigned int buMatRank = matbU.rank(0.,1.e-8 );
59 unsigned int buMatRank14 = matbU.rank(0.,1.e-14);
61 *
m_env.
subDisplayFile() <<
"In GcmJointTildeInfo<S_V,S_M,D_V,D_M,P_V,P_M,Q_V,Q_M>::constructor()"
62 <<
": matbU.numRowsLocal() = " << matbU.numRowsLocal()
63 <<
", matbU.numCols() = " << matbU.numCols()
64 <<
", matbU.rank(0.,1.e-8) = " << buMatRank
65 <<
", matbU.rank(0.,1.e-14) = " << buMatRank14
73 for (
unsigned int i = 0; i < matbU.numCols(); ++i) {
74 matbU.getColumn(i,vecI);
75 for (
unsigned int j = i; j < matbU.numCols(); ++j) {
76 matbU.getColumn(j,vecJ);
80 matbUcheck.setPrintHorizontally(
false);
82 *
m_env.
subDisplayFile() <<
"In GcmJointTildeInfo<S_V,S_M,D_V,D_M,P_V,P_M,Q_V,Q_M>::constructor()"
86 <<
", matbU.numRowsLocal() = " << matbU.numRowsLocal()
87 <<
", matbU.numCols() = " << matbU.numCols()
88 <<
", buMatrank(0.,1.e-8) = " << buMatRank
89 <<
", buMatrank(0.,1.e-14) = " << buMatRank14
90 <<
", matbUcheck.numRowsLocal() = " << matbUcheck.numRowsLocal()
91 <<
", matbUcheck.numCols() = " << matbUcheck.numCols()
92 <<
", matbUcheck =\n" << matbUcheck
99 matbU.getColumn(j,vecbJ);
109 *
m_env.
subDisplayFile() <<
"In GcmJointTildeInfo<S_V,S_M,D_V,D_M,P_V,P_M,Q_V,Q_M>::constructor()"
110 <<
": m_Bmat_tilde computed (1)"
119 matbV = Bmat_t.svdMatV();
120 unsigned int bvMatRank = matbV.rank(0.,1.e-8);
121 unsigned int bvMatRank14 = matbV.rank(0.,1.e-14);
123 *
m_env.
subDisplayFile() <<
"In GcmJointTildeInfo<S_V,S_M,D_V,D_M,P_V,P_M,Q_V,Q_M>::constructor()"
124 <<
": matbV.numRowsLocal() = " << matbV.numRowsLocal()
125 <<
", matbV.numCols() = " << matbV.numCols()
126 <<
", matbV.rank(0.,1.e-8) = " << bvMatRank
127 <<
", matbV.rank(0.,1.e-14) = " << bvMatRank14
135 for (
unsigned int i = 0; i < matbV.numCols(); ++i) {
136 matbV.getColumn(i,vecI);
137 for (
unsigned int j = i; j < matbV.numCols(); ++j) {
138 matbV.getColumn(j,vecJ);
142 matbVcheck.setPrintHorizontally(
false);
144 *
m_env.
subDisplayFile() <<
"In GcmJointTildeInfo<S_V,S_M,D_V,D_M,P_V,P_M,Q_V,Q_M>::constructor()"
148 <<
", matbV.numRowsLocal() = " << matbV.numRowsLocal()
149 <<
", matbV.numCols() = " << matbV.numCols()
150 <<
", bvMatrank(0.,1.e-8) = " << bvMatRank
151 <<
", bvMatrank(0.,1.e-14) = " << bvMatRank14
152 <<
", matbVcheck.numRowsLocal() = " << matbVcheck.numRowsLocal()
153 <<
", matbVcheck.numCols() = " << matbVcheck.numCols()
154 <<
", matbVcheck =\n" << matbVcheck
160 for (
unsigned int j = 0; j < jj.
m_Bmat_rank; ++j) {
161 matbV.getColumn(j,vecbJ);
171 *
m_env.
subDisplayFile() <<
"In GcmJointTildeInfo<S_V,S_M,D_V,D_M,P_V,P_M,Q_V,Q_M>::constructor()"
172 <<
": m_Bmat_tilde computed (2)"
178 *
m_env.
subDisplayFile() <<
"In GcmJointTildeInfo<S_V,S_M,D_V,D_M,P_V,P_M,Q_V,Q_M>::constructor()"
179 <<
": finished forming 'm_Bmat_tilde'"
180 <<
", m_Bmat_tilde.numRowsLocal() = " <<
m_Bmat_tilde.numRowsLocal()
181 <<
", m_Bmat_tilde.numCols() = " <<
m_Bmat_tilde.numCols()
187 m_Lbmat.subWriteContents(
"Lbmat",
193 *
m_env.
subDisplayFile() <<
"In GcmJointTildeInfo<S_V,S_M,D_V,D_M,P_V,P_M,Q_V,Q_M>::constructor()"
194 <<
": m_Lbmat_tilde computed"
207 Btildett.fillWithTranspose(0,0,Btildet,
true,
true);
209 double btDiffNorm = Btildett.normFrob();
211 *
m_env.
subDisplayFile() <<
"In GcmJointTildeInfo<S_V,S_M,D_V,D_M,P_V,P_M,Q_V,Q_M>::constructor()"
212 <<
": ||Btildett - Btilde||_2 = " << btDiffNorm
220 double bTildeRank14 = 0.;
227 bTildeRank14 = Btildet.rank(0.,1.e-14);
231 *
m_env.
subDisplayFile() <<
"In GcmJointTildeInfo<S_V,S_M,D_V,D_M,P_V,P_M,Q_V,Q_M>::constructor()"
232 <<
": m_Bmat_tilde.numRowsLocal() = " <<
m_Bmat_tilde.numRowsLocal()
233 <<
", m_Bmat_tilde.numCols() = " <<
m_Bmat_tilde.numCols()
235 <<
", m_Bmat_tilde.rank(0.,1.e-14) = " << bTildeRank14
245 *
m_env.
subDisplayFile() <<
"In GcmJointTildeInfo<S_V,S_M,D_V,D_M,P_V,P_M,Q_V,Q_M>::constructor()"
246 <<
": finished computing 'm_Btildet_Wy_Btilde'"
256 *
m_env.
subDisplayFile() <<
"In GcmJointTildeInfo<S_V,S_M,D_V,D_M,P_V,P_M,Q_V,Q_M>::constructor()"
257 <<
": m_Btildet_Wy_Btilde computed"
265 *
m_env.
subDisplayFile() <<
"In GcmJointTildeInfo<S_V,S_M,D_V,D_M,P_V,P_M,Q_V,Q_M>::constructor()"
268 <<
", m_Btildet_Wy_Btilde.lnDeterminant() = " << btildetWyBtildeLnDeterminant
269 <<
": m_Btildet_Wy_Btilde.rank(0.,1.e-8) = " << btildetWyBtildeRank
270 <<
": m_Btildet_Wy_Btilde.rank(0.,1.e-14) = " << btildetWyBtildeRank14
276 *
m_env.
subDisplayFile() <<
"In GcmJointTildeInfo<S_V,S_M,D_V,D_M,P_V,P_M,Q_V,Q_M>::constructor()"
277 <<
": finished computing 'm_Btildet_Wy_Btilde_inv'"
283 "Btildet_Wy_Btilde_inv",
288 *
m_env.
subDisplayFile() <<
"In GcmJointTildeInfo<S_V,S_M,D_V,D_M,P_V,P_M,Q_V,Q_M>::constructor()"
289 <<
": m_Btildet_Wy_Btilde_inv computed"
297 *
m_env.
subDisplayFile() <<
"In GcmJointTildeInfo<S_V,S_M,D_V,D_M,P_V,P_M,Q_V,Q_M>::constructor()"
300 <<
": m_Btildet_Wy_Btilde_inv.lnDeterminant() = " << btildetWyBtildeInvLnDeterminant
301 <<
": m_Btildet_Wy_Btilde_inv.rank(0.,1.e-8) = " << btildetWyBtildeInvRank
302 <<
": m_Btildet_Wy_Btilde_inv.rank(0.,1.e-14) = " << btildetWyBtildeInvRank14
311 *
m_env.
subDisplayFile() <<
"In GcmJointTildeInfo<S_V,S_M,D_V,D_M,P_V,P_M,Q_V,Q_M>::constructor()"
318 *
m_env.
subDisplayFile() <<
"In GcmJointTildeInfo<S_V,S_M,D_V,D_M,P_V,P_M,Q_V,Q_M>::constructor()"
322 <<
", Btildet.numRowsLocal() = " << Btildet.numRowsLocal()
323 <<
", Btildet.numCols() = " << Btildet.numCols()
324 <<
", m_Wy->numRowsLocal() = " << e.
m_Wy->numRowsLocal()
325 <<
", m_Wy->numCols() = " << e.
m_Wy->numCols()
326 <<
", yVec_transformed.sizeLocal() = " << yVec_transformed.sizeLocal()
331 tmpVec2 = *e.
m_Wy * tmpVec2;
335 *
m_env.
subDisplayFile() <<
"In GcmJointTildeInfo<S_V,S_M,D_V,D_M,P_V,P_M,Q_V,Q_M>::constructor()"
341 *
m_env.
subDisplayFile() <<
"In GcmJointTildeInfo<S_V,S_M,D_V,D_M,P_V,P_M,Q_V,Q_M>::constructor()"
342 <<
": finished computing 'tilde' exponent modifiers"
347 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>
const BaseEnvironment & m_env
const Map & map() const
Map.
VectorSpace< D_V, D_M > m_vu_tilde_space
std::set< unsigned int > m_dataOutputAllowedSet
const V & zeroVector() const
Returns a vector filled with zeros.
unsigned int dimGlobal() const
#define queso_require_equal_to_msg(expr1, expr2, msg)
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_Btildet_Wy_Btilde_inv
std::ofstream * subDisplayFile() const
Access function for m_subDisplayFile (displays file on stream).
GcmJointTildeInfo(const GpmsaComputerModelOptions &gcmOptionsObj, const GcmExperimentInfo< S_V, S_M, D_V, D_M, P_V, P_M > &e, const GcmJointInfo< S_V, S_M, D_V, D_M, P_V, P_M, Q_V, Q_M > &jj)
unsigned int m_b_y_modifier_tilde
unsigned int subId() const
Access function to the number of each sub-environment Id: m_subId.
VectorSpace< D_V, D_M > m_y_space
unsigned int checkingLevel() const
Access function to private attribute m_checkingLevel.
unsigned int m_a_y_modifier_tilde
unsigned int m_Bmat_tilde_rank