← Back to team overview

yade-dev team mailing list archive

[Branch ~yade-dev/yade/trunk] Rev 2798: Fix Eigen3-Eigen2 detection variables.

 

------------------------------------------------------------
revno: 2798
committer: Anton Gladky <gladky.anton@xxxxxxxxx>
branch nick: yade
timestamp: Thu 2011-03-24 22:38:33 +0100
message:
  Fix Eigen3-Eigen2 detection variables.
modified:
  lib/base/Math.hpp
  pkg/common/Gl1_NormPhys.cpp
  pkg/dem/DomainLimiter.cpp
  pkg/dem/L3Geom.cpp


--
lp:yade
https://code.launchpad.net/~yade-dev/yade/trunk

Your team Yade developers is subscribed to branch lp:yade.
To unsubscribe from this branch go to https://code.launchpad.net/~yade-dev/yade/trunk/+edit-subscription
=== modified file 'lib/base/Math.hpp'
--- lib/base/Math.hpp	2010-11-22 17:58:56 +0000
+++ lib/base/Math.hpp	2011-03-24 21:38:33 +0000
@@ -38,8 +38,7 @@
 #define EIGEN_NO_DEBUG
 #include<Eigen/Core>
 #include<Eigen/Geometry>
-	#if EIGEN_MAJOR_VERSION<20		//Eigen3 definition, while it is not realized
-
+	#if EIGEN_WORLD_VERSION==2
 		#include<Eigen/Array>
 	#endif
 #include<Eigen/QR>
@@ -142,10 +141,9 @@
 template<typename MatrixT>
 void Matrix_computeUnitaryPositive(const MatrixT& in, MatrixT* unitary, MatrixT* positive){
 	assert(unitary); assert(positive); 
-	#if EIGEN_MAJOR_VERSION<20		//Eigen3 definition, while it is not realized
-	
+	#if EIGEN_WORLD_VERSION==2
 		Eigen::SVD<MatrixT>(in).computeUnitaryPositive(unitary,positive);
-	#else
+	#elif EIGEN_WORLD_VERSION==3 
 		Eigen::JacobiSVD<MatrixT> svd(in, Eigen::ComputeThinU | Eigen::ComputeThinV);
 		MatrixT mU, mV, mS;
 		mU = svd.matrixU();

=== modified file 'pkg/common/Gl1_NormPhys.cpp'
--- pkg/common/Gl1_NormPhys.cpp	2011-02-27 13:54:43 +0000
+++ pkg/common/Gl1_NormPhys.cpp	2011-03-24 21:38:33 +0000
@@ -87,9 +87,9 @@
 		glTranslatef(p1[0],p1[1],p1[2]);
 		Quaternionr q(Quaternionr().setFromTwoVectors(Vector3r(0,0,1),relPos/dist /* normalized */));
 		// using Transform with OpenGL: http://eigen.tuxfamily.org/dox/TutorialGeometry.html
-		#if EIGEN_MAJOR_VERSION<20              //Eigen3 definition, while it is not realized
+		#if EIGEN_WORLD_VERSION==2
 			glMultMatrixd(Eigen::Transform3d(q).data());
-		#else
+		#elif EIGEN_WORLD_VERSION==3
 			glMultMatrixd(Eigen::Affine3d(q).data());
 		#endif
 		glColor3v(color);

=== modified file 'pkg/dem/DomainLimiter.cpp'
--- pkg/dem/DomainLimiter.cpp	2011-02-15 11:36:29 +0000
+++ pkg/dem/DomainLimiter.cpp	2011-03-24 21:38:33 +0000
@@ -241,9 +241,9 @@
 
 	// switch to local coordinates
 	glTranslatev(tester->contPt);
-	#if EIGEN_MAJOR_VERSION<20              //Eigen3 definition, while it is not realized
+	#if EIGEN_WORLD_VERSION==2
  		glMultMatrixd(Eigen::Transform3d(tester->trsf.transpose()).data());
-	#else
+	#elif EIGEN_WORLD_VERSION==3
  		glMultMatrixd(Eigen::Affine3d(tester->trsf.transpose()).data());
 	#endif
 

=== modified file 'pkg/dem/L3Geom.cpp'
--- pkg/dem/L3Geom.cpp	2011-02-15 11:36:29 +0000
+++ pkg/dem/L3Geom.cpp	2011-03-24 21:38:33 +0000
@@ -338,15 +338,15 @@
 	const L3Geom& g(ig->cast<L3Geom>());
 	glTranslatev(g.contactPoint);
 	#ifdef L3_TRSF_QUATERNION
-		#if EIGEN_MAJOR_VERSION<30
+		#if EIGEN_WORLD_VERSION==2
  			glMultMatrixd(Eigen::Transform3d(Matrix3r(g.trsf).transpose()).data());
-		#else
+		#elif EIGEN_WORLD_VERSION==3
  			glMultMatrixd(Eigen::Affine3d(Matrix3r(g.trsf).transpose()).data());
 		#endif
 	#else
-		#if EIGEN_MAJOR_VERSION<30
+		#if EIGEN_WORLD_VERSION==2
  			glMultMatrixd(Eigen::Transform3d(g.trsf.transpose()).data());
-		#else
+		#elif EIGEN_WORLD_VERSION==3
  			glMultMatrixd(Eigen::Affine3d(g.trsf.transpose()).data());
 		#endif
 	#endif