This forum has been archived. All content is frozen. Please use KDE Discuss instead.

Alignment issues with Matrix4d

Tags: None
(comma "," separated)
linello
Registered Member
Posts
56
Karma
0
OS

Alignment issues with Matrix4d

Fri Dec 10, 2010 8:10 am
Hi you guys,

I'm working on a geometric framework using Eigen heavily. I faced the famous unaligned assert

This is my class ReferenceFrame

Code: Select all
class ReferenceFrame
{
   public:
      EIGEN_MAKE_ALIGNED_OPERATOR_NEW   //for alignment issues
      Matrix4d transformation;
      
      Vector3d translation;

      Matrix3d axes;
      
      Matrix3d rotation;
      
      ReferenceFrame();
      ReferenceFrame( const ReferenceFrame &);


      void setAxes(const Matrix3d &);
      void setTranslation(const Vector3d &);
      void setReferenceFrame(const Matrix3d&, const Point3D&);
      void updateTransformation(const ReferenceFrame &);
      void setRandomAxes();
      void setRandomRotation();
      void setRandomTranslation();
      bool isSet;
      friend ostream &operator<<(ostream &output, const ReferenceFrame &);
};


As you suggest, I used the EIGEN_MAKE_ALIGNED_OPERATOR_NEW.
I had no problem till I added the Matrix4d, which causes the alignment issue.

From gdb I backtraced the origin of the assert is in the constructor:

Code: Select all
ReferenceFrame::ReferenceFrame()
{
   axes = Matrix3d::Identity();
   rotation = Matrix3d::Identity();
   translation = Vector3d::Zero();
   transformation = Matrix4d::Identity();
}


Some suggestions? It's an alignment issue?


Ubuntu 10.10
Eigen 3.0 beta2
g++-4.5
Code compiled with no optimizations, only with debug symbols
User avatar
bjacob
Registered Member
Posts
658
Karma
3

Re: Alignment issues with Matrix4d

Mon Dec 13, 2010 8:31 am
The assert page lists 4 known causes for this assertion, you have to go over them and check if they may apply in your case. For example, are you using STL containers, are you passing objects by value...


Join us on Eigen's IRC channel: #eigen on irc.freenode.net
Have a serious interest in Eigen? Then join the mailing list!


Bookmarks



Who is online

Registered users: Bing [Bot], Evergrowing, Google [Bot], rockscient