[eigen] Compile error with nested arrays in Eigen 3.3

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

I’ve encountered some cases involving some nested arrays where code that used to compile in Eigen 3.2 no longer compiles in 3.3, and I’m wondering if there’s something I’m doing wrong or if support for this was intentionally removed.  Here’s an example:


    Eigen::Array<Eigen::Array3d,Eigen::Dynamic,1> a(7), b(7), c;

    for(int i = 0; i < 7; ++i) {

        a[i] = Eigen::Array3d::Random();

        b[i] = Eigen::Array3d::Random();


    c = a + b; // this line no longer compiles in 3.3


The marked line causes a compiler error complaining that the + operator cannot be unambiguously resolved.  It looks like there is a NumTraits specialization for Eigen::Array, so it *seems* like this sort of operation is supposed work, but it’s admittedly a bit non-standard so perhaps there’s something I’m missing.


Obviously I could rewrite the above code to avoid nested arrays, but it would be convenient for me is there was a way to keep the nested arrays but fix the compiler error.  Any suggestions? 


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