Re: [eigen] Structures Having Eigen Members questions |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/eigen Archives
]
- To: eigen@xxxxxxxxxxxxxxxxxxx
- Subject: Re: [eigen] Structures Having Eigen Members questions
- From: Benoit Jacob <jacob.benoit.1@xxxxxxxxx>
- Date: Fri, 23 Jan 2009 19:55:36 +0100
- 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=oVe2rWPGv796OLCvELYBiA0nzKcjlRe56bZjCsew1sQ=; b=Rn1jm/43EVubw6hzJksn2ELB312mnr/lsa8pELpNr6mLppP1LmONYMwjYMZuNuTni0 BhJbuxFF1nPHddxMgdAZhO7etTqhdSN+KrtFXP7sMtSSEbdYslecHM2nHASmJer0AHl1 40xrPT3VKxuf9DxEaA1Gwe5mhX73Rne1BHJTk=
- 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=nnV55f2sO96dD5XQLf+6bsrhjYGFB/Y1NkebtP5i0C2QRrUBiTHzaKHBjyovMrejeH N8j+d2XmnC7ll6b4IF/kbsl7+KLpoHTUqtEp7mkuB531fkxJqctg95huRhBqjMpgDhfB N5NKhh9BIsvpdJKeMMPXrkRn8menloBMtUvKU=
2009/1/23 Ben Axelrod <baxelrod@xxxxxxxxxxxx>:
> 1. Base classes. When is EIGEN_MAKE_ALIGNED_OPERATOR_NEW needed with
> respect to class hierarchies? It seems that if you put
> EIGEN_MAKE_ALIGNED_OPERATOR_NEW in a base class, and the Eigen types are in
> a derived class, then it does not work.
It should really work: overloaded operator new is inherited in derived classes.
Here, it does work (with your example code even). And there are many
people relying on that already.
One idea: did you forgot to specify public inheritance? "class
Derived: public Base".
Please, can you try to make a small self contained test case? And tell
me with which compiler you get the failure?
> 2. Is EIGEN_MAKE_ALIGNED_OPERATOR_NEW needed in structs as well as classes?
Of course, in C++ structs are the same thing as classes, the only
difference is that they default to public members and public
inheritance.
> 3. Returning Eigen types is ok
That we already mention in this page, at the end ;) perhaps we should
make that more prominent then.
> and passing a pointer to an Eigen type
> instead of by const reference is also ok.
OK i'll try to remember about adding that. At low level passing by
pointer or by reference is exactly the same thing.
Cheers,
Benoit