9 #ifndef EVENTPRIMITIVES_EVENTPRIMITIVESCOVARIANCEHELPERS_H
10 #define EVENTPRIMITIVES_EVENTPRIMITIVESCOVARIANCEHELPERS_H
14 #include <Eigen/Cholesky>
65 return !(std::isnan(ele) || std::isinf(ele) ||
66 std::abs(ele) > upper_covariance_cutoff);
74 constexpr
int dim =
N;
75 for (
int i = 0;
i <
dim; ++
i) {
84 for (
int i = 0;
i <
dim; ++
i) {
98 constexpr
int dim =
N;
99 for (
int i = 0;
i <
dim; ++
i) {
108 for (
int i = 0;
i <
dim; ++
i) {
124 return (ldltCov.info() == Eigen::Success && ldltCov.isPositive());
131 Eigen::LDLT<Amg::MatrixX> ldltCov(
mat);
132 return (ldltCov.info() == Eigen::Success && ldltCov.isPositive());
144 return (lltCov.info() == Eigen::Success);
151 Eigen::LLT<Amg::MatrixX> lltCov(
mat);
152 return (lltCov.info() == Eigen::Success);
164 auto res = eigensolver.eigenvalues();
165 for (
size_t i = 0;
i <
N; ++
i) {
177 Eigen::SelfAdjointEigenSolver<Amg::MatrixX> eigensolver(
mat);
178 auto res = eigensolver.eigenvalues();
180 for (
int i = 0;
i <
dim; ++
i) {
194 auto res = eigensolver.eigenvalues();
195 for (
size_t i = 0;
i <
N; ++
i) {
207 Eigen::SelfAdjointEigenSolver<Amg::MatrixX> eigensolver(
mat);
208 auto res = eigensolver.eigenvalues();
210 for (
int i = 0;
i <
dim; ++
i) {
220 template <
typename T,
typename U>