25 #include <queso/GcmZTildeInfo.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_Cmat_tilde (m_env,jj.m_omega_space.map(),z.m_Cmat_rank),
39 m_z_tilde_space (m_env,
"z_tilde_", z.m_Cmat_rank, NULL),
40 m_Lmat (m_env,m_z_tilde_space.map(),z.m_Cmat->numCols()),
41 m_Lmat_t (m_env,z.m_z_space.map(),z.m_Cmat_rank),
42 m_Zvec_tilde_hat (m_z_tilde_space.zeroVector()),
43 m_tmp_Smat_z_tilde (m_z_tilde_space.zeroVector()),
44 m_tmp_Smat_extra_tilde (m_z_tilde_space.zeroVector()),
45 m_tmp_Smat_z_tilde_hat (m_z_tilde_space.zeroVector()),
46 m_tmp_Smat_z_tilde_hat_inv(m_z_tilde_space.zeroVector())
49 *
m_env.
subDisplayFile() <<
"Entering GcmZTildeInfo<S_V,S_M,D_V,D_M,P_V,P_M,Q_V,Q_M>::constructor(1)"
53 std::set<unsigned int> tmpSet;
57 D_M matU(z.
m_Cmat->svdMatU());
58 unsigned int uMatRank = matU.rank(0.,1.e-8 );
59 unsigned int uMatRank14 = matU.rank(0.,1.e-14);
61 *
m_env.
subDisplayFile() <<
"In GcmZTildeInfo<S_V,S_M,D_V,D_M,P_V,P_M,Q_V,Q_M>::constructor(1)"
62 <<
": matU.numRowsLocal() = " << matU.numRowsLocal()
63 <<
", matU.numCols() = " << matU.numCols()
64 <<
", matU.rank(0.,1.e-8) = " << uMatRank
65 <<
", matU.rank(0.,1.e-14) = " << uMatRank14
73 for (
unsigned int i = 0; i < matU.numCols(); ++i) {
74 matU.getColumn(i,vecI);
75 for (
unsigned int j = i; j < matU.numCols(); ++j) {
76 matU.getColumn(j,vecJ);
80 matUcheck.setPrintHorizontally(
false);
82 *
m_env.
subDisplayFile() <<
"In GcmZTildeInfo<S_V,S_M,D_V,D_M,P_V,P_M,Q_V,Q_M>::constructor(1)"
84 <<
", matUcheck.numRowsLocal() = " << matUcheck.numRowsLocal()
85 <<
", matUcheck.numCols() = " << matUcheck.numCols()
86 <<
", matUcheck =\n" << matUcheck
93 matU.getColumn(j,vecJ);
104 *
m_env.
subDisplayFile() <<
"In GcmZTildeInfo<S_V,S_M,D_V,D_M,P_V,P_M,Q_V,Q_M>::constructor(1)"
105 <<
": m_Cmat_tilde formed (2)"
115 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>
124 m_Cmat_tilde (m_env,jj.m_omega_space.map(),z.m_Cmat_rank),
125 m_z_tilde_space (m_env,
"z_tilde_", z.m_Cmat_rank, NULL),
126 m_Lmat (m_env,m_z_tilde_space.map(),z.m_Cmat->numCols()),
127 m_Lmat_t (m_env,z.m_z_space.map(),z.m_Cmat_rank),
128 m_Zvec_tilde_hat (m_z_tilde_space.zeroVector()),
129 m_tmp_Smat_z_tilde (m_z_tilde_space.zeroVector()),
130 m_tmp_Smat_extra_tilde (m_z_tilde_space.zeroVector()),
131 m_tmp_Smat_z_tilde_hat (m_z_tilde_space.zeroVector()),
132 m_tmp_Smat_z_tilde_hat_inv(m_z_tilde_space.zeroVector())
135 *
m_env.
subDisplayFile() <<
"Entering GcmZTildeInfo<S_V,S_M,D_V,D_M,P_V,P_M,Q_V,Q_M>::constructor(2)"
139 std::set<unsigned int> tmpSet;
152 *
m_env.
subDisplayFile() <<
"In GcmZTildeInfo<S_V,S_M,D_V,D_M,P_V,P_M,Q_V,Q_M>::constructor(2)"
153 <<
": m_Cmat_tilde formed (1)"
160 m_Lmat.subWriteContents(
"Lmat",
166 *
m_env.
subDisplayFile() <<
"In GcmZTildeInfo<S_V,S_M,D_V,D_M,P_V,P_M,Q_V,Q_M>::constructor(2)"
167 <<
": m_Lmat_tilde formed"
176 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>
181 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>
183 GcmZTildeInfo<S_V,S_M,D_V,D_M,P_V,P_M,Q_V,Q_M>::commonConstructor(
const GcmZInfo<S_V,S_M,D_V,D_M,P_V,P_M,Q_V,Q_M>& z)
185 unsigned int cMatTildeRank = m_Cmat_tilde.rank(0.,1.e-8 );
186 unsigned int cMatTildeRank14 = m_Cmat_tilde.rank(0.,1.e-14);
187 if (m_env.subDisplayFile()) {
188 *m_env.subDisplayFile() <<
"In GcmZTildeInfo<S_V,S_M,D_V,D_M,P_V,P_M,Q_V,Q_M>::constructor()"
189 <<
": m_Cmat_tilde.numRowsLocal() = " << m_Cmat_tilde.numRowsLocal()
190 <<
", m_Cmat_tilde.numCols() = " << m_Cmat_tilde.numCols()
191 <<
", m_Cmat_tilde.rank(0.,1.e-8) = " << cMatTildeRank
192 <<
", m_Cmat_tilde.rank(0.,1.e-14) = " << cMatTildeRank14
197 queso_require_less_msg(m_Lmat.numRowsGlobal(), m_Lmat.numCols(),
"'m_Lmat' should be a 'horizontal' rectangular matrix");
202 m_Lmat_t.fillWithTranspose(0,0,m_Lmat,
true,
true);
203 unsigned int lMatRank = m_Lmat_t.rank(0.,1.e-8 );
204 unsigned int lMatRank14 = m_Lmat_t.rank(0.,1.e-14);
205 if (m_env.subDisplayFile()) {
206 *m_env.subDisplayFile() <<
"In GcmZTildeInfo<S_V,S_M,D_V,D_M,P_V,P_M,Q_V,Q_M>::commonConstructor()"
207 <<
": m_Lmat.numRowsLocal() = " << m_Lmat.numRowsLocal()
208 <<
", m_Lmat.numCols() = " << m_Lmat.numCols()
209 <<
", m_Lmat.rank(0.,1.e-8) = " << lMatRank
210 <<
", m_Lmat.rank(0.,1.e-14) = " << lMatRank14
216 if (m_env.checkingLevel() >= 1) {
218 D_M tmpCmat(m_Cmat_tilde * m_Lmat);
220 double cDiffNorm = tmpCmat.normFrob();
221 if (m_env.subDisplayFile()) {
222 *m_env.subDisplayFile() <<
"In GcmZTildeInfo<S_V,S_M,D_V,D_M,P_V,P_M,Q_V,Q_M>::commonConstructor()"
223 <<
": ||tmpC - C||_2 = " << cDiffNorm
const BaseEnvironment & m_env
GcmZTildeInfo(const GpmsaComputerModelOptions &gcmOptionsObj, const GcmJointInfo< S_V, S_M, D_V, D_M, P_V, P_M, Q_V, Q_M > &jj, const GcmZInfo< S_V, S_M, D_V, D_M, P_V, P_M, Q_V, Q_M > &z)
std::set< unsigned int > m_dataOutputAllowedSet
const V & zeroVector() const
Returns a vector filled with zeros.
#define queso_require_equal_to_msg(expr1, expr2, msg)
double scalarProduct(const GslVector &x, const GslVector &y)
VectorSpace< D_V, D_M > m_z_space
std::ofstream * subDisplayFile() const
Access function for m_subDisplayFile (displays file on stream).
#define queso_require_less_msg(expr1, expr2, msg)
unsigned int subId() const
Access function to the number of each sub-environment Id: m_subId.
VectorSpace< D_V, D_M > m_omega_space
unsigned int checkingLevel() const
Access function to private attribute m_checkingLevel.
void commonConstructor(const GcmZInfo< S_V, S_M, D_V, D_M, P_V, P_M, Q_V, Q_M > &z)