 |
Eigen
3.3.90 (git rev 598e1b6e54ec51c2448b1a10d4354f165f0b083e)
|
|
10 #ifndef EIGEN_ROTATIONBASE_H
11 #define EIGEN_ROTATIONBASE_H
17 template<
typename RotationDerived,
typename MatrixType,
bool IsVector=MatrixType::IsVectorAtCompileTime>
18 struct rotation_base_generic_product_selector;
28 template<
typename Derived,
int _Dim>
34 typedef typename internal::traits<Derived>::Scalar
Scalar;
41 EIGEN_DEVICE_FUNC
inline const Derived& derived()
const {
return *
static_cast<const Derived*
>(
this); }
42 EIGEN_DEVICE_FUNC
inline Derived& derived() {
return *
static_cast<Derived*
>(
this); }
53 EIGEN_DEVICE_FUNC
inline Derived
inverse()
const {
return derived().inverse(); }
69 template<
typename OtherDerived>
70 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
typename internal::rotation_base_generic_product_selector<Derived,OtherDerived,OtherDerived::IsVectorAtCompileTime>::ReturnType
72 {
return internal::rotation_base_generic_product_selector<Derived,OtherDerived>::run(derived(), e.
derived()); }
75 template<
typename OtherDerived>
friend
77 {
return l.
derived() * r.toRotationMatrix(); }
83 res.
linear().applyOnTheLeft(l);
88 template<
int Mode,
int Options>
92 template<
typename OtherVectorType>
93 EIGEN_DEVICE_FUNC
inline VectorType _transformVector(
const OtherVectorType& v)
const
100 template<
typename RotationDerived,
typename MatrixType>
101 struct rotation_base_generic_product_selector<RotationDerived,MatrixType,false>
103 enum { Dim = RotationDerived::Dim };
104 typedef Matrix<typename RotationDerived::Scalar,Dim,Dim> ReturnType;
105 EIGEN_DEVICE_FUNC
static inline ReturnType run(
const RotationDerived& r,
const MatrixType& m)
106 {
return r.toRotationMatrix() * m; }
109 template<
typename RotationDerived,
typename Scalar,
int Dim,
int MaxDim>
110 struct rotation_base_generic_product_selector< RotationDerived, DiagonalMatrix<Scalar,Dim,MaxDim>, false >
112 typedef Transform<Scalar,Dim,Affine> ReturnType;
113 EIGEN_DEVICE_FUNC
static inline ReturnType run(
const RotationDerived& r,
const DiagonalMatrix<Scalar,Dim,MaxDim>& m)
121 template<
typename RotationDerived,
typename OtherVectorType>
122 struct rotation_base_generic_product_selector<RotationDerived,OtherVectorType,true>
124 enum { Dim = RotationDerived::Dim };
125 typedef Matrix<typename RotationDerived::Scalar,Dim,1> ReturnType;
126 EIGEN_DEVICE_FUNC
static EIGEN_STRONG_INLINE ReturnType run(
const RotationDerived& r,
const OtherVectorType& v)
128 return r._transformVector(v);
138 template<
typename _Scalar,
int _Rows,
int _Cols,
int _Storage,
int _MaxRows,
int _MaxCols>
139 template<
typename OtherDerived>
143 EIGEN_STATIC_ASSERT_MATRIX_SPECIFIC_SIZE(
Matrix,
int(OtherDerived::Dim),
int(OtherDerived::Dim))
151 template<
typename _Scalar,
int _Rows,
int _Cols,
int _Storage,
int _MaxRows,
int _MaxCols>
152 template<
typename OtherDerived>
157 EIGEN_STATIC_ASSERT_MATRIX_SPECIFIC_SIZE(
Matrix,
int(OtherDerived::Dim),
int(OtherDerived::Dim))
181 template<
typename Scalar,
int Dim>
184 EIGEN_STATIC_ASSERT(Dim==2,YOU_MADE_A_PROGRAMMING_MISTAKE)
188 template<
typename Scalar,
int Dim,
typename OtherDerived>
189 EIGEN_DEVICE_FUNC
static inline Matrix<Scalar,Dim,Dim> toRotationMatrix(
const RotationBase<OtherDerived,Dim>& r)
191 return r.toRotationMatrix();
194 template<
typename Scalar,
int Dim,
typename OtherDerived>
195 EIGEN_DEVICE_FUNC
static inline const MatrixBase<OtherDerived>& toRotationMatrix(
const MatrixBase<OtherDerived>& mat)
197 EIGEN_STATIC_ASSERT(OtherDerived::RowsAtCompileTime==Dim && OtherDerived::ColsAtCompileTime==Dim,
198 YOU_MADE_A_PROGRAMMING_MISTAKE)
206 #endif // EIGEN_ROTATIONBASE_H
Namespace containing all symbols from the Eigen library.
Definition: Core:134
Represents a diagonal matrix with its storage.
Definition: DiagonalMatrix.h:142
Definition: EigenBase.h:30
Matrix< Scalar, Dim, Dim > RotationMatrixType
Definition: RotationBase.h:37
friend RotationMatrixType operator*(const EigenBase< OtherDerived > &l, const Derived &r)
Definition: RotationBase.h:76
Common base class for compact rotation representations.
Definition: RotationBase.h:30
Matrix2 toRotationMatrix() const
Definition: Rotation2D.h:188
RotationMatrixType operator*(const UniformScaling< Scalar > &s) const
Definition: RotationBase.h:60
internal::traits< Derived >::Scalar Scalar
Definition: RotationBase.h:34
Represents a rotation/orientation in a 2 dimensional space.
Definition: Rotation2D.h:42
Derived & derived()
Definition: EigenBase.h:46
Represents a translation transformation.
Definition: Translation.h:31
The matrix class, also used for vectors and row-vectors.
Definition: Matrix.h:180
RotationMatrixType toRotationMatrix() const
Definition: RotationBase.h:45
Derived inverse() const
Definition: RotationBase.h:53
Matrix & operator=(const Matrix &other)
Assigns matrices to each other.
Definition: Matrix.h:206
RotationMatrixType matrix() const
Definition: RotationBase.h:50
Transform< Scalar, Dim, Mode > operator*(const Transform< Scalar, Dim, Mode, Options > &t) const
Definition: RotationBase.h:89
internal::rotation_base_generic_product_selector< Derived, OtherDerived, OtherDerived::IsVectorAtCompileTime >::ReturnType operator*(const EigenBase< OtherDerived > &e) const
Definition: RotationBase.h:71
friend Transform< Scalar, Dim, Affine > operator*(const DiagonalMatrix< Scalar, Dim > &l, const Derived &r)
Definition: RotationBase.h:80
Matrix()
Default constructor.
Definition: Matrix.h:259
Transform< Scalar, Dim, Isometry > operator*(const Translation< Scalar, Dim > &t) const
Definition: RotationBase.h:56