Re: [eigen] symmetrize the eigne way

[ Thread Index | Date Index | More lists.tuxfamily.org/eigen Archives ]


2010/1/25 Thomas Capricelli <orzel@xxxxxxxxxxxxxxx>:
>
> 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>&)’

OK how about:

  s.template triangularView<StrictlyLower>() = s.transpose();

I think the more general problem with what you tried is that we don't
support syntax using triangular views on both sides. IIRC?

Benoit

>
> ++
> --
> Thomas Capricelli <orzel@xxxxxxxxxxxxxxx>
> http://www.freehackers.org/thomas
>
>
>
>



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/