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

About Alignment problem

Tags: None
(comma "," separated)
hw102050
Registered Member
Posts
1
Karma
0

About Alignment problem  Topic is solved

Mon Oct 21, 2013 12:26 pm
Hello every one :

I had some problems with Alignment problem ,and I've seen the link:http://eigen.tuxfamily.org/dox/group__DenseMatrixManipulation__Alignement.html
I follow the guidance attempt to modify, but the problem is not being solved.
Please help me....thx

This my code

>>human_activity_sim.h
Code: Select all
#include "Eigen/Dense"
#include "Eigen/StdVector"

#define _USE_MATH_DEFINES
#include <cmath>
#include <vector>

using namespace std;
using namespace Eigen;

namespace human activity
{
   inline float Euc_Dis(const Vector2d&, const Vector2d&);   //Compute 2 Ponint Distance
   struct Hum_PInfo
   {
      EIGEN_MAKE_ALIGNED_OPERATOR_NEW

      Vector2d P_XY;   //Human Position on MAP
      int      P_Type;   //Human type
      float    P_active;  //Human active
   } ;

   class   Hum_Sim
   {
      public:   EIGEN_MAKE_ALIGNED_OPERATOR_NEW   //For Eigen Structures Problem
      public:
         //~~Variable~~
         vector<Hum_PInfo> Hum_Data;   
         //>
      protected:
         void P2P_EucDis( void );   //Point to Point Euclidean_Distance
         //>
      private:
         vector<Vector2d> Hum_Pos_XY;   //Human Position on MAP
   };
}



>>human_activity_sim.cpp
Code: Select all
using namespace human activity;
inline float Euc_Dis(const Vector2d& P1, const Vector2d& P2)   //Compute 2 Ponint Distance
{
   Vector2d tvec = (P1 - P2);
   return sqrtf( tvec(0)*tvec(0)+tvec(1)*tvec(1) );
}

void Hum_Sim ::P2P_EucDis( void )
{
   float tDis;
   for (int i=0; i<HumData_XY.size(); i++)
   {
      tDis = Euc_DisHum( Data_XYat(i-1), HumData_XYat(i) );
      P2P_Dis.push_back( tDis );
   }
}



After compile, I got several errors.....

error C2719: '_Val': formal parameter with __declspec(align('16')) won't be aligned (Struct having Eigen objects as members?)

error LNK2019: unresolved external symbol "float __cdecl Curvature_Extract::Euc_Dis(class Eigen::Matrix<double,2,1,0,2,1> const &,class Eigen::Matrix<double,2,1,0,2,1> const &)" (?Euc_Dis@Curvature_Extract@@YAMABV?$Matrix@N$01$00$0A@$01$00@Eigen@@0@Z) referenced in function "protected: void __thiscall Curvature_Extract::Curve_Feature::P2P_EucDis(void)" (?P2P_EucDis@Curve_Feature@Curvature_Extract@@IAEXXZ) (I forgot include any library?)


Please help me....thx :'(
My Platform
Windows 7(X64)
VC 2010
Eigen 3.2.0

////////////////////////////////////////////////////////////////////
2013/10/22

Thank you all
my friend to help me solve the problem
Web has a solution but I did not notice :<


Bookmarks



Who is online

Registered users: Bing [Bot], Google [Bot], Yahoo [Bot]