Merged eigen/eigen into default

This commit is contained in:
Nicolas Mellado
2015-07-11 19:33:43 +02:00
17 changed files with 435 additions and 129 deletions

View File

@@ -69,6 +69,20 @@ public:
/** \returns a read-write reference to the rotation angle */
inline Scalar& angle() { return m_angle; }
/** \returns the rotation angle in [0,2pi] */
inline Scalar smallestPositiveAngle() const {
Scalar tmp = fmod(m_angle,Scalar(2)*EIGEN_PI);
return tmp<Scalar(0) ? tmp + Scalar(2)*EIGEN_PI : tmp;
}
/** \returns the rotation angle in [-pi,pi] */
inline Scalar smallestAngle() const {
Scalar tmp = fmod(m_angle,Scalar(2)*EIGEN_PI);
if(tmp>Scalar(EIGEN_PI)) tmp -= Scalar(2)*Scalar(EIGEN_PI);
else if(tmp<-Scalar(EIGEN_PI)) tmp += Scalar(2)*Scalar(EIGEN_PI);
return tmp;
}
/** \returns the inverse rotation */
inline Rotation2D inverse() const { return Rotation2D(-m_angle); }
@@ -93,7 +107,10 @@ public:
* parameter \a t. It is in fact equivalent to a linear interpolation.
*/
inline Rotation2D slerp(const Scalar& t, const Rotation2D& other) const
{ return Rotation2D(m_angle * (1-t) + other.angle() * t); }
{
Scalar dist = Rotation2D(other.m_angle-m_angle).smallestAngle();
return Rotation2D(m_angle + dist*t);
}
/** \returns \c *this with scalar type casted to \a NewScalarType
*
@@ -119,6 +136,7 @@ public:
* \sa MatrixBase::isApprox() */
bool isApprox(const Rotation2D& other, const typename NumTraits<Scalar>::Real& prec = NumTraits<Scalar>::dummy_precision()) const
{ return internal::isApprox(m_angle,other.m_angle, prec); }
};
/** \ingroup Geometry_Module

View File

@@ -165,7 +165,7 @@ void sparselu_gemm(Index m, Index n, Index d, const Scalar* A, Index lda, const
Bc1 += RK;
} // peeled loop on k
} // peeled loop on the columns j
// process the last column (we now perform a matrux-vector product)
// process the last column (we now perform a matrix-vector product)
if((n-n_end)>0)
{
const Scalar* Bc0 = B+(n-1)*ldb;