Re: [eigen] Assignment of product to X.noalias() does not resize X |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/eigen Archives
]
- To: eigen@xxxxxxxxxxxxxxxxxxx
- Subject: Re: [eigen] Assignment of product to X.noalias() does not resize X
- From: Gael Guennebaud <gael.guennebaud@xxxxxxxxx>
- Date: Tue, 1 Sep 2009 13:35:26 +0200
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=ZFNV8/21M9OyvXbPbzV0LgEKd2TeoNTxYiTAIeiNh7c=; b=H+uaYlaIKutg4rUPsAsGdTAgEFE7B/jGQpryNpb9iIEs+Ilg2iZQb12jwkDS2/1U8N MIfj0Yi+SiN0tGIisE8diMOvcMv5O0IQXSWIGGLDpljyC/nrkEdo/FyWpb9ofXCamwv0 fMJkUCcbkunUS882Oe2c6Isw/VtPPeoxoK+9s=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=nbZn9lQd/2+xH5NAJwGJvho8VOgkeUTpYtI0/u+o/bGPppx32sGdNQAcoh1yzKDUT9 NV55FUVDQX7nLRIzMbOnUToChi9sWUC0sBM+x4GoIw194NqPUBkOdp8IzngJY9RvAqpq st1utP6sGDPuKM2FvwhtKqnpoG8kLTgWwBPj4=
yes, Hauke found this bug yesterday, problem fixed now.
cheers,
gael.
On Tue, Sep 1, 2009 at 11:43 AM, Jitse Niesen<jitse@xxxxxxxxxxxxxxxxx> wrote:
> Hello,
>
> What is the reason behind the following inconsistency (using the current
> revision of the development branch)?
>
> -------------
> #include <Eigen/Core>
> #include <Eigen/Array>
>
> using namespace Eigen;
>
> int main()
> {
> MatrixXf A = MatrixXf::Random(12,12);
> MatrixXf A2;
> A2 = A * A; // works
> std::cout << A2(1,1) << std::endl;
> MatrixXf A3(12,12);
> A3.noalias() = A * A; // works
> std::cout << A3(1,1) << std::endl;
> MatrixXf A4;
> A4.noalias() = A * A; // does NOT work
> std::cout << A4(1,1) << std::endl;
> }
> -------------
>
> The assignment to A4 complains (via a run-time assertion) that A4 has the
> wrong dimension. Yet when we leave out the noalias(), as in the assignment
> to A2, it does resize the matrix to the correct dimension.
>
> In the 2.0 branch, A4 = (A * A).lazy() does resize the matrix A4.
>
> Cheers,
> Jitse
>
>
>