Re: [eigen] Dynamic memory allocation with Matrix::corner ?

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


2010/1/21  <hamelin.philippe@xxxxxxx>:
> Hello,
>
> I just want to make sure that this code doesn't generate dynamic memory
> allocation :
>
>
> Matrix<double, 6, 6> large;
> Matrix<double, 3, 3> small;
>
> large.corner(Eigen::TopLeft, 3, 3) = small;

Indeed, this code doesn't generate a dynamic memory allocation.

To ensure this, you can define the EIGEN_NO_MALLOC and compile your
program with assertions enabled (don't define NDEBUG). Your program
will then crash if Eigen tries to do any dynamic memory allocation.

Benoit


>
>
> Thank you,
>
> Philippe Hamelin, ing. jr, M. Ing
> Chercheur / Researcher
>
> Tel: (450) 652-8499 x2198
> Fax: (450) 652-1316
>
> Institut de recherche d'Hydro-Québec
> Unité robotique et civil
> 1740, boul. Lionel-Boulet
> Varennes (QC) J1X 1S1, Canada
>
>



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