compilation fixes with eigen (norm2=>squaredNorm, a*b => a.dot(b))

This commit is contained in:
Paolo Cignoni 2009-01-23 16:58:47 +00:00
parent f4ec24c552
commit 3d5ccb47f9
3 changed files with 5 additions and 8 deletions

View File

@ -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<ScalarType>(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;

View File

@ -25,7 +25,7 @@
#define EIGEN_VCGLIB
// TODO enable the vectorization
//#define EIGEN_DONT_VECTORIZE
#define EIGEN_DONT_VECTORIZE
#define EIGEN_MATRIXBASE_PLUGIN <vcg/math/eigen_matrixbase_addons.h>
#define EIGEN_MATRIX_PLUGIN <vcg/math/eigen_matrix_addons.h>
@ -286,7 +286,7 @@ inline typename Eigen::ei_traits<Derived1>::Scalar Norm( const Eigen::MatrixBase
template<typename Derived1>
inline typename Eigen::ei_traits<Derived1>::Scalar SquaredNorm( const Eigen::MatrixBase<Derived1>& p)
{ return p.norm2(); }
{ return p.squaredNorm(); }
template<typename Derived1, typename Derived2>
inline typename Eigen::ei_traits<Derived1>::Scalar
@ -296,7 +296,7 @@ Distance(const Eigen::MatrixBase<Derived1>& p1, const Eigen::MatrixBase<Derived2
template<typename Derived1, typename Derived2>
inline typename Eigen::ei_traits<Derived1>::Scalar
SquaredDistance(const Eigen::MatrixBase<Derived1>& p1, const Eigen::MatrixBase<Derived2> & p2)
{ return (p1-p2).norm2(); }
{ return (p1-p2).squaredNorm(); }
template<typename Derived>
inline const Eigen::CwiseUnaryOp<Eigen::ei_scalar_abs_op<typename Eigen::ei_traits<Derived>::Scalar>, Derived>

View File

@ -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() */