Re: [eigen] Strange initialization

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


On 07/10/10 11:34:15, Benoit Jacob wrote:
> 2010/7/10 Helmut Jarausch <jarausch@xxxxxxxxxxxxxxxxxxx>:
> > Could someone please explain why the second initialization
> > below is accepted and what it is doing?
> >
> > Many thanks,
> > Helmut.
> >
> >
> > #include <iostream>
> > #include <Eigen/Core>
> >
> > using Eigen::Matrix2i;   using Eigen::Map;
> >
> > int main() {
> >  int data[4] = {1, 2, 3, 4};
> > // This works as documented
> >  Map<Matrix2i> m2x2(data,2,2);
> >  std::cout << m2x2 << std::endl;
> >
> > // but what happens here ?
> >  Matrix2i mat2x2(data);  // accepted but
> >  std::cout << mat2x2 << std::endl;
> > /* output    0  3
> >             0  4
> > */
> > }
> 
> I can't reproduce this with gcc 4.4, for me your test program always
> prints as expected:
> 
> 1 3
> 2 4
> 1 3
> 2 4
> 
> I have tried
>  - eigen2 and eigen3
>  - with and without vectorization
>  - with and without -O2
> 
> What compiler and command line are you using?

Sorry for the noise,

I've tested it yesterday but I can't reproduce it either.
I've just recompiled with gcc-4.4.4 and
-O3 -mtune=native -mmmx  -msse  -msse2 -msse3  -msse4a -m3dnow 
with Eigen3 (hg-version, yesterday)

Sorry for the noise,
thanks,
Helmut.



-- 
Helmut Jarausch

Lehrstuhl fuer Numerische Mathematik
RWTH - Aachen University
D 52056 Aachen, Germany




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