diff --git a/vcg/complex/trimesh/geodesic.h b/vcg/complex/trimesh/geodesic.h index 6f9bba74..2593720b 100644 --- a/vcg/complex/trimesh/geodesic.h +++ b/vcg/complex/trimesh/geodesic.h @@ -125,7 +125,7 @@ class Geo{ ScalarType ec_w1 = (w1_c).Norm(); ScalarType alpha,alpha_, beta,beta_,theta,h,delta,s,a,b; - alpha = acos((w_c*w1_c)/(ew_c*ec_w1)); + alpha = acos((w_c.dot(w1_c))/(ew_c*ec_w1)); s = (d_curr + d_pw1+ec_w1)/2; a = s/ec_w1; b = a*s; @@ -136,7 +136,7 @@ class Geo{ }else { beta_ = 2*acos ( math::Min(1.0,sqrt( (b- a* d_curr)/d_pw1))); - beta = acos((w_w1)*(-w1_c)/(ew_w1*ec_w1)); + beta = acos((w_w1).dot(-w1_c)/(ew_w1*ec_w1)); if ( beta+beta_ > M_PI) curr_d = d_pw1 + ew_w1; diff --git a/vcg/math/eigen.h b/vcg/math/eigen.h index 1565a43a..b29fa03a 100644 --- a/vcg/math/eigen.h +++ b/vcg/math/eigen.h @@ -25,7 +25,7 @@ #define EIGEN_VCGLIB // TODO enable the vectorization -//#define EIGEN_DONT_VECTORIZE +#define EIGEN_DONT_VECTORIZE #define EIGEN_MATRIXBASE_PLUGIN #define EIGEN_MATRIX_PLUGIN @@ -286,7 +286,7 @@ inline typename Eigen::ei_traits::Scalar Norm( const Eigen::MatrixBase template inline typename Eigen::ei_traits::Scalar SquaredNorm( const Eigen::MatrixBase& p) -{ return p.norm2(); } +{ return p.squaredNorm(); } template inline typename Eigen::ei_traits::Scalar @@ -296,7 +296,7 @@ Distance(const Eigen::MatrixBase& p1, const Eigen::MatrixBase inline typename Eigen::ei_traits::Scalar SquaredDistance(const Eigen::MatrixBase& p1, const Eigen::MatrixBase & p2) -{ return (p1-p2).norm2(); } +{ return (p1-p2).squaredNorm(); } template inline const Eigen::CwiseUnaryOp::Scalar>, Derived> diff --git a/vcg/math/eigen_matrixbase_addons.h b/vcg/math/eigen_matrixbase_addons.h index 7ea9d023..72453e51 100644 --- a/vcg/math/eigen_matrixbase_addons.h +++ b/vcg/math/eigen_matrixbase_addons.h @@ -187,9 +187,6 @@ EIGEN_DEPRECATED void Dump() printf("\n"); } -// norm2 will be renamed squaredNorm() in Eigen -// inline Scalar squaredNorm() const { return norm2(); }; - /** \deprecated use norm() */ EIGEN_DEPRECATED inline Scalar Norm() const { return norm(); }; /** \deprecated use squaredNorm() */