Re: [eigen] "May be used uninitialized" warning... |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/eigen Archives
]
- To: eigen@xxxxxxxxxxxxxxxxxxx
- Subject: Re: [eigen] "May be used uninitialized" warning...
- From: Gael Guennebaud <gael.guennebaud@xxxxxxxxx>
- Date: Fri, 10 Dec 2010 08:29:22 +0100
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:mime-version:received:in-reply-to :references:from:date:message-id:subject:to:content-type :content-transfer-encoding; bh=8UYIe9Cj3ZSWkXdLPtAdlpejKP8xt7O2oIjKsDKCvLs=; b=ko1muXVnh+FBMfwahKm7b8rTsuna+R/gYfsOvnWOCyvFcqynsXoLu4ytUJzde6zMtv ZsnwHD9oI5hdMwbGYZfVG8jRtXJmvnmUvcFcE5ijcapNvF/cQ3WcYHOzHzTTWsvlO84Z kwmBGnsU2L5H4My1Q9Te0O/pjfWBxV50c5aRw=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type:content-transfer-encoding; b=PFTNzYl4NE6vau3zUyh5xiWRmAS6pVS3+izF+mQs2a1BQTN+qo5m5NsAg6s9mG9Wz3 IJYGFaRCrrukOA1TEOe6Xm7f3z439z65w645GZDfAAAE/kjMrefByjKKpUwLehfJ+BxT NU+TrVqPVjCR64U3Bf3VVTor84BZqhqwONY4k=
I cannot reproduce. Tested with gcc 4.5, 4.4, 4.3, and 4.1
gael
On Fri, Dec 10, 2010 at 12:05 AM, Jose Luis Blanco
<joseluisblancoc@xxxxxxxxx> wrote:
> Hi Benoit,
>
> Mmm... sorry for the bad example. Of course I found the issue on
> properly initialized matrices, and the same warnings come out.
> Instead of the previous example, take this one:
>
> int main()
> {
> Eigen::Matrix<double,4,4> M = Eigen::Matrix<double,4,4>::Random();
> Eigen::EigenSolver< Eigen::Matrix<double,4,4> > es(M, true);
> cout << "M: "<< M << endl << endl;
> cout << "evecs: "<< es.eigenvectors() << endl;
> cout << "evals: "<< es.eigenvalues() << endl;
> return 0;
> }
>
> The warnings also appear there (for -Wall -DNDEBUG), and the output is
> apparently OK:
>
>
> ============== OUTPUT ===================
> M: 0.680375 0.823295 -0.444451 -0.270431
> -0.211234 -0.604897 0.10794 0.0268018
> 0.566198 -0.329554 -0.0452059 0.904459
> 0.59688 0.536459 0.257742 0.83239
>
> evecs: (0.349378,0.540657) (0.349378,-0..540657)
> (-0.0377618,-0.222364) (-0.0377618,0.222364)
> (-0.0630065,-0.0993635) (-0.0630065,0.0993635)
> (-0.179376,0.000711027) (-0.179376,-0.000711027)
> (0.313002,-0.372126) (0.313002,0.372126)
> (-0.594828,-0.663136) (-0.594828,0.663136)
> (0.252229,-0.521263) (0.252229,0.521263)
> (0.212017,0.280057) (0.212017,-0.280057)
> evals: (0.754819,0.527518)
> (0.754819,-0.527518)
> (-0.323488,0.0964571)
> (-0.323488,-0.0964571)
> ============== END OF OUTPUT ===================
>
>
> Perhaps that's a silly GCC warning, but just wanted to let you know!
>
> Best,
> JL
>
>
> On Thu, Dec 9, 2010 at 10:48 PM, Benoit Jacob <jacob.benoit.1@xxxxxxxxx> wrote:
>>> that one gets compiling something like:
>>>
>>> int main()
>>> {
>>> Eigen::Matrix<double,4,4> M;
>>> Eigen::EigenSolver< Eigen::Matrix<double,4,4> > es(M, true);
>>> return 0;
>>> }
>>
>> This code is computing the eigendecomposition of an uninitialized
>> matrix M. Eigen Matrix default constructors leave the coefficients
>> uninitialized. So of course this warning is legitimate, but the
>> problem is in your code!
>>
>> Benoit
>>
>
>
>