Re: [eigen] Shortcomings of asDiagonal()? |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/eigen Archives
]
- To: eigen <eigen@xxxxxxxxxxxxxxxxxxx>
- Subject: Re: [eigen] Shortcomings of asDiagonal()?
- From: Gael Guennebaud <gael.guennebaud@xxxxxxxxx>
- Date: Thu, 6 Jun 2013 00:21:12 +0200
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; bh=3jQ+hVBebd+wPX1etL4uwGduaHkEqnMrEx8JQk9LWYE=; b=jtR5I9Tl0lmPBTEoi9O6AL/Aa6Ruw1fKGadc300RjPs7wxNEhfDEwXNLhX/WlLwWCf nut4P1Qu5dyfaGwCF+PZTG9vWwUMWx8iTehwAlgtLySqv+iyLWGfShHxEKdfkq+3hAGh QLSDYSUk4pVd+yLgaeHnPU6Gij+T76DA1MogpNP9CcExDD9r6Z1EHqjvhg+yBQE1k4+4 9FJ91vw5SFt/+Rn47brK0xkSVBg4i2L3zFyen/1yotW2zb3HkmzRFNymfGmcMrEX00lK 7d8KW5ZCdZFgoYebW9uGqa4ZdP+F+rgQ48Yme+I+TQyBichVkenNb+lWbD13qi/ObSz4 cXNg==
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
>
>