23 auto titleguard =
MSGUser()->StartTitleWithGuard(
"PCATool::SetObservable");
24 if (index < 0 || index >=
Size)
26 MSGUser()->MSG_ERROR(
"Observable index out of range: ", index);
34 auto titleguard =
MSGUser()->StartTitleWithGuard(
"PCATool::SetCovariance");
35 if (index_i < 0 || index_i >=
Size)
37 MSGUser()->MSG_ERROR(
"Observable index out of range: ", index_i);
40 if (index_j < 0 || index_j >=
Size)
42 MSGUser()->MSG_ERROR(
"Observable index out of range: ", index_j);
45 if (index_i > index_j)
55 auto titleguard =
MSGUser()->StartTitleWithGuard(
"PCATool::SetUncertainty");
61 auto titleguard =
MSGUser()->StartTitleWithGuard(
"PCATool::Process");
63 MSGUser()->MSG_INFO(
"Calculate Eigen Values");
65 if (eigensolver.info() != Eigen::Success)
68 MSGUser()->MSG_INFO(
"Calculate Eigen Vectors");
70 MSGUser()->MSG_INFO(
"Calculate New Correlation Matrix");
72 MSGUser()->MSG_INFO(
"Calculate Rotated Observables");
75 MSGUser()->MSG_INFO(
"Calculate Inverse Transform Matrix");
77 MSGUser()->MSG_INFO(
"Calculate New Variations");
78 MSGUser()->MSG_INFO(
"Decide NVariations");
79 MatrixXd m_Covariance_Matrix(
Size,
Size);
80 for (
int i = 0; i <
Size; i++)
81 for (
int j = 0; j <
Size; j++)
82 m_Covariance_Matrix(i, j) = 0;
84 for (
int i = 0; i <
Size; i++)
86 for (
int j = 0; j < 2; j++)
97 VectorXd newvar = TransMatrix_Inv * RotatedNewVariation;
104 for (
int j = 0; j <
Size; j++)
106 for (
int k = 0; k <
Size; k++)
111 m_Covariance_Matrix(j, k) = m_Covariance_Matrix(j, k) + diff_j * diff_k;
117 for (
int j = 0; j <
Size; j++)
122 double m_unc = sqrt(m_Covariance_Matrix(j, j));
125 int iunc = factor * unc;
126 while (iunc < 10 || iunc >= 100)
130 factor = factor * 10;
134 factor = factor / 10;
139 int imunc = factor * m_unc;
169 auto titleguard =
MSGUser()->StartTitleWithGuard(
"PCATool::GetPCAResult");
170 if (ivar < 0 || ivar >=
Size)
172 MSGUser()->MSG_ERROR(
"Variation Index not in range: ", ivar);
175 if (index < 0 || index >=
Size)
177 MSGUser()->MSG_ERROR(
"Observable Index not in range: ", index);
186 MSGUser()->MSG_ERROR(
"Variation Index larger than NVariation: ", ivar);
204 auto titleguard =
MSGUser()->StartTitleWithGuard(
"PCATool::GetPCAResult");
205 if (index < 0 || index >=
Size)
207 MSGUser()->MSG_ERROR(
"Observable Index not in range: ", index);
227 if (ivar < 0 || ivar >=
Size)
229 MSGUser()->MSG_ERROR(
"Variation Index not in range: ", ivar);