[eigen] Structures Having Eigen Members questions

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


I hit the bug, so read the page:

http://eigen.tuxfamily.org/api/UnalignedArrayAssert.html

 

I have a few questions that should be added to the page.

 

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.

 

class Base
{ 
public:
  EIGEN_MAKE_ALIGNED_OPERATOR_NEW
};
 
class Foo : public Base
{
  Eigen::Vector2d v;
};
 

This is for http://eigen.tuxfamily.org/api/StructHavingEigenMembers.html

 

 

2. Is EIGEN_MAKE_ALIGNED_OPERATOR_NEW needed in structs as well as classes?

 

struct foo
{
  EIGEN_MAKE_ALIGNED_OPERATOR_NEW
  Eigen::Vector2d v;
};

 

This is for http://eigen.tuxfamily.org/api/StructHavingEigenMembers.html

 

3. Returning Eigen types is ok and passing a pointer to an Eigen type instead of by const reference is also ok.  You should make a note of it on: http://eigen.tuxfamily.org/api/PassingByValue.html

 

-Ben

 



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