[eigen] symmetrize the eigne way |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/eigen Archives
]
Suppose i want to create a selfadjoint matrix this way:
for (j = 0; j < n; ++j)
for (i = j+1; i < n; ++i)
s(i,j) = s(j,i);
How could i do that using Eigen? I've thought about :
s.template triangularView<StrictlyLower>() = s.template triangularView<StrictlyUpper>().transpose();
But this wont compile:
Eigen/src/Core/TriangularMatrix.h:425: error: no matching function for call to ‘Eigen::Matrix<double, 33331, 33331, 0, 33331, 33331>::copyCoeff(int&, int&, const Eigen::TriangularView<Eigen::Transpose<Eigen::Matrix<double, 33331, 33331, 0, 33331, 33331> >, 9u>&)’
++
--
Thomas Capricelli <orzel@xxxxxxxxxxxxxxx>
http://www.freehackers.org/thomas