Re: [eigen] malloc in Scalar x Matrix Matrix

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


Hi,

thanks a lot! This was the problem. I never thought that the matrix
sizes matter so my minimal working example I tried had different matrix
sizes (10x10 and not 10x2; in production, it is more 20000x200) such
that I could not detect it.

Btw, set_is_malloc_allowed should also work in an OMP parallel
environment, right?

Best,

Henrik

PS: Sorry for posting twice. I somehow did not get the mail and just saw
the mails on the online archive.


> 
> 
> Looks like this:
> https://stackoverflow.com/questions/51043842/call-eigen-gemm-over-externally-allocated-data
> 
> It has been fixed a year ago on the devel-branch, but apparently not backported to 3.3:
> 
> http://eigen.tuxfamily.org/bz/show_bug.cgi?id=1562
> 
> 
> If you know the sizes of your matrices at compile time, you should write
> 
>   const Map<const Matrix<double, 2, 10> > A( _A.data());
>   const Map<const Matrix<double, 10, 2> > B( _B.data());
>   Map<Matrix2d> C( _C.data());
>   double v = 2.0;
>   C.noalias() = v * A * B;
> 
> If you know can't upgrade to the devel branch, but know that your matrices are small (but with unknown size at compile time), you can write this as a workaround:
> 
> 
>   C.noalias() = v * A.lazyProduct(B);
> 
> 
> Generally, if you fail to produce a minimal example from scratch, you can start with (a copy of) your code and remove everything which does not let the error disappear, hopefully leaving just a few lines.
> 
> 
> Cheers,
> Christoph



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