mirror of
https://gitlab.com/libeigen/eigen.git
synced 2024-12-15 07:10:37 +08:00
compilation fixes for sun CC
This commit is contained in:
parent
d8bfd151d1
commit
2e9f7f80bf
@ -62,11 +62,13 @@ struct ei_traits<Homogeneous<MatrixType,Direction> >
|
|||||||
template<typename MatrixType,typename Lhs> struct ei_homogeneous_left_product_impl;
|
template<typename MatrixType,typename Lhs> struct ei_homogeneous_left_product_impl;
|
||||||
template<typename MatrixType,typename Rhs> struct ei_homogeneous_right_product_impl;
|
template<typename MatrixType,typename Rhs> struct ei_homogeneous_right_product_impl;
|
||||||
|
|
||||||
template<typename MatrixType,int Direction> class Homogeneous
|
template<typename MatrixType,int _Direction> class Homogeneous
|
||||||
: public MatrixBase<Homogeneous<MatrixType,Direction> >
|
: public MatrixBase<Homogeneous<MatrixType,_Direction> >
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
enum { Direction = _Direction };
|
||||||
|
|
||||||
EIGEN_GENERIC_PUBLIC_INTERFACE(Homogeneous)
|
EIGEN_GENERIC_PUBLIC_INTERFACE(Homogeneous)
|
||||||
|
|
||||||
inline Homogeneous(const MatrixType& matrix)
|
inline Homogeneous(const MatrixType& matrix)
|
||||||
|
@ -25,8 +25,9 @@
|
|||||||
#ifndef EIGEN_ROTATIONBASE_H
|
#ifndef EIGEN_ROTATIONBASE_H
|
||||||
#define EIGEN_ROTATIONBASE_H
|
#define EIGEN_ROTATIONBASE_H
|
||||||
|
|
||||||
// this file aims to contains the various representations of rotation/orientation
|
// forward declaration
|
||||||
// in 2D and 3D space excepted Matrix and Quaternion.
|
template<typename RotationDerived, typename MatrixType, bool IsVector=MatrixType::IsVectorAtCompileTime>
|
||||||
|
struct ei_rotation_base_generic_product_selector;
|
||||||
|
|
||||||
/** \class RotationBase
|
/** \class RotationBase
|
||||||
*
|
*
|
||||||
@ -47,25 +48,6 @@ class RotationBase
|
|||||||
typedef Matrix<Scalar,Dim,Dim> RotationMatrixType;
|
typedef Matrix<Scalar,Dim,Dim> RotationMatrixType;
|
||||||
typedef Matrix<Scalar,Dim,1> VectorType;
|
typedef Matrix<Scalar,Dim,1> VectorType;
|
||||||
|
|
||||||
protected:
|
|
||||||
template<typename MatrixType, bool IsVector=MatrixType::IsVectorAtCompileTime>
|
|
||||||
struct generic_product_selector
|
|
||||||
{
|
|
||||||
typedef RotationMatrixType ReturnType;
|
|
||||||
inline static RotationMatrixType run(const Derived& r, const MatrixType& m)
|
|
||||||
{ return r.toRotationMatrix() * m; }
|
|
||||||
};
|
|
||||||
|
|
||||||
template<typename OtherVectorType>
|
|
||||||
struct generic_product_selector<OtherVectorType,true>
|
|
||||||
{
|
|
||||||
typedef VectorType ReturnType;
|
|
||||||
inline static VectorType run(const Derived& r, const OtherVectorType& v)
|
|
||||||
{
|
|
||||||
return r._transformVector(v);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
inline const Derived& derived() const { return *static_cast<const Derived*>(this); }
|
inline const Derived& derived() const { return *static_cast<const Derived*>(this); }
|
||||||
inline Derived& derived() { return *static_cast<Derived*>(this); }
|
inline Derived& derived() { return *static_cast<Derived*>(this); }
|
||||||
@ -90,9 +72,9 @@ class RotationBase
|
|||||||
* - a vector of size Dim
|
* - a vector of size Dim
|
||||||
*/
|
*/
|
||||||
template<typename OtherDerived>
|
template<typename OtherDerived>
|
||||||
inline typename generic_product_selector<OtherDerived,OtherDerived::IsVectorAtCompileTime>::ReturnType
|
inline typename ei_rotation_base_generic_product_selector<Derived,OtherDerived,OtherDerived::IsVectorAtCompileTime>::ReturnType
|
||||||
operator*(const MatrixBase<OtherDerived>& e) const
|
operator*(const MatrixBase<OtherDerived>& e) const
|
||||||
{ return generic_product_selector<OtherDerived>::run(derived(), e.derived()); }
|
{ return ei_rotation_base_generic_product_selector<Derived,OtherDerived>::run(derived(), e.derived()); }
|
||||||
|
|
||||||
/** \returns the concatenation of a linear transformation \a l with the rotation \a r */
|
/** \returns the concatenation of a linear transformation \a l with the rotation \a r */
|
||||||
template<typename OtherDerived> friend
|
template<typename OtherDerived> friend
|
||||||
@ -109,6 +91,27 @@ class RotationBase
|
|||||||
{ return toRotationMatrix() * v; }
|
{ return toRotationMatrix() * v; }
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// implementation of the generic product rotation * matrix
|
||||||
|
template<typename RotationDerived, typename MatrixType>
|
||||||
|
struct ei_rotation_base_generic_product_selector<RotationDerived,MatrixType,false>
|
||||||
|
{
|
||||||
|
enum { Dim = RotationDerived::Dim };
|
||||||
|
typedef Matrix<typename RotationDerived::Scalar,Dim,Dim> ReturnType;
|
||||||
|
inline static ReturnType run(const RotationDerived& r, const MatrixType& m)
|
||||||
|
{ return r.toRotationMatrix() * m; }
|
||||||
|
};
|
||||||
|
|
||||||
|
template<typename RotationDerived,typename OtherVectorType>
|
||||||
|
struct ei_rotation_base_generic_product_selector<RotationDerived,OtherVectorType,true>
|
||||||
|
{
|
||||||
|
enum { Dim = RotationDerived::Dim };
|
||||||
|
typedef Matrix<typename RotationDerived::Scalar,Dim,1> ReturnType;
|
||||||
|
inline static ReturnType run(const RotationDerived& r, const OtherVectorType& v)
|
||||||
|
{
|
||||||
|
return r._transformVector(v);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
/** \geometry_module
|
/** \geometry_module
|
||||||
*
|
*
|
||||||
* Constructs a Dim x Dim rotation matrix from the rotation \a r
|
* Constructs a Dim x Dim rotation matrix from the rotation \a r
|
||||||
|
Loading…
Reference in New Issue
Block a user