30 : dimension(full.rows()) {
31 assert(full.rows() == full.cols() &&
"Input matrix not quadratic");
33 for (
Index i = 0; i < full.rows(); ++i) {
34 for (
Index j = 0; j <= i; ++j) {
44 for (
Index j = 0; j <= i; ++j) {
57 assert(
data.size() == a.
data.size() &&
"Matrices do not have same size");
65 const Index start = (i * (i + 1)) / 2;
66 for (
Index j = 0; j < i; ++j) {
67 result += 2 *
data[start + j] * a.
data[start + j];
74 double factor)
const {
75 for (
Index j = 0; j < full.cols(); ++j) {
76 const Index start = (j * (j + 1)) / 2;
77 for (
Index i = 0; i <= j; ++i) {
78 full(i, j) += factor *
data[start + i];
81 for (
Index i = j + 1; i < full.rows(); ++i) {
90 Eigen::SelfAdjointView<Eigen::MatrixXd, Eigen::Upper>& upper,
91 double factor)
const {
92 for (
Index j = 0; j < upper.cols(); ++j) {
93 const Index start = (j * (j + 1)) / 2;
94 for (
Index i = 0; i <= j; ++i) {
95 upper(i, j) += factor *
data[start + i];
103 for (
Index j = 0; j < result.cols(); ++j) {
104 const Index start = (j * (j + 1)) / 2;
105 for (
Index i = 0; i <= j; ++i) {
106 result(i, j) =
data[start + i];
109 for (
Index i = j + 1; i < result.rows(); ++i) {
119 for (
Index j = 0; j < result.cols(); ++j) {
120 const Index start = (j * (j + 1)) / 2;
121 for (
Index i = 0; i <= j; ++i) {
122 result(i, j) =
data[start + i];
131 index = (i * (i + 1)) / 2 + j;
133 index = (j * (j + 1)) / 2 + i;
Index index(Index i, Index j) const
void AddtoEigenUpperMatrix(Eigen::SelfAdjointView< Eigen::MatrixXd, Eigen::Upper > &upper, double factor=1.0) const
Symmetric_Matrix()=default
double TraceofProd(const Symmetric_Matrix &a) const
Eigen::MatrixXd FullMatrix() const
double & operator()(Index i, Index j)
std::vector< double > data
void AddtoEigenMatrix(Eigen::MatrixXd &full, double factor=1.0) const
Eigen::MatrixXd UpperMatrix() const
base class for all analysis tools