Re: [eigen] Dynamic memory allocation with Matrix::corner ? |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/eigen Archives
]
- To: eigen@xxxxxxxxxxxxxxxxxxx
- Subject: Re: [eigen] Dynamic memory allocation with Matrix::corner ?
- From: Benoit Jacob <jacob.benoit.1@xxxxxxxxx>
- Date: Thu, 21 Jan 2010 11:47:44 -0500
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=A4kqZSMaoaab738XTghLMhWVKjDTVoziQei8zPxKNmA=; b=B83FZFstJZPp0UdIunbCcH2QZzyfU/kx95dzwWyfxMdx+mTr05oD5HhcKUli7iQX5B h9mnIIfYAlEXNeRxKsTMVHAB0QYMVNybgw1kyiP0w56yG1kRwDgfPtbYACqrUT3kUggB p+rfeTrJAych6czBkrW+nCt8OYJJdZSNzfDLk=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=xw9kikW9zZySbXzTTi7JbGc6SX49eqVYfzGrSQDcTgnu/+zhGHppRQKzQRnLA4SJcB E+r9nm1D+KSduvq26uz3kuRSJQ0SdV6Wlg9meB7aRFnhPh62bv+NWdmcvnjyT2VyloxX TZHISRNi+lyYyTRBF7WghOfRzQ8QTEJdXCBlg=
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
>
>