Re: [eigen] Shortcomings of asDiagonal()?

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


Yes, we are aware of that. This issue depends on bug 520 + the fact
that Identity() returns a dense expression while it should return a
DiagonalWrapper of a constant vector.

#520 is actually not difficult to address: in DiagonalBase, add the
missing binary operators, apply the respective operation on the
".diagonal()" and wrap the result back into a DiagonalWrapper (as in
DiagonalBase::inverse()).

gael

On Wed, Jun 5, 2013 at 7:54 PM, Rhys Ulerich <rhys.ulerich@xxxxxxxxx> wrote:
> Hi all,
>
> Should I expect the following to compile on 3.1.3?
>
> #include <Eigen/Core>
>
> int main()
> {
>     using namespace Eigen;
>
>     // Works as expected
>     Matrix3d A1;
>     Matrix3d B1 = Matrix3d::Identity() * A1;
>     Matrix3d C1 = Matrix3d::Identity() + A1;
>     Matrix3d D1 = Matrix3d::Identity() - A1;
>
>     // Does not work but I expect that it should
>     Vector3d A2;
>     Matrix3d B2 = Matrix3d::Identity() * A2.asDiagonal();
>     Matrix3d C2 = Matrix3d::Identity() + A2.asDiagonal();
>     Matrix3d D2 = Matrix3d::Identity() - A2.asDiagonal();
>
>     return 0;
> }
>
> http://eigen.tuxfamily.org/bz/buglist.cgi?quicksearch=asDiagonal&list_id=2521
> turns up nothing sounding similar but
> http://eigen.tuxfamily.org/bz/show_bug.cgi?id=520 sounds similar in
> spirit.  Should I file something with 520 as a prerequisite?
>
> Thanks,
> Rhys
>
>



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