10 #ifndef EIGEN_ROTATIONBASE_H
11 #define EIGEN_ROTATIONBASE_H
19 template<
typename RotationDerived,
typename MatrixType,
bool IsVector=MatrixType::IsVectorAtCompileTime>
20 struct rotation_base_generic_product_selector;
30 template<
typename Derived,
int Dim_>
36 typedef typename internal::traits<Derived>::Scalar
Scalar;
71 template<
typename OtherDerived>
72 EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE
typename internal::rotation_base_generic_product_selector<Derived,OtherDerived,OtherDerived::IsVectorAtCompileTime>::ReturnType
74 {
return internal::rotation_base_generic_product_selector<Derived,OtherDerived>::run(
derived(),
e.derived()); }
77 template<
typename OtherDerived>
friend
79 {
return l.
derived() * r.toRotationMatrix(); }
85 res.linear().applyOnTheLeft(l);
90 template<
int Mode,
int Options>
94 template<
typename OtherVectorType>
102 template<
typename RotationDerived,
typename MatrixType>
103 struct rotation_base_generic_product_selector<RotationDerived,
MatrixType,false>
105 enum { Dim = RotationDerived::Dim };
106 typedef Matrix<typename RotationDerived::Scalar,Dim,Dim> ReturnType;
108 {
return r.toRotationMatrix() *
m; }
111 template<
typename RotationDerived,
typename Scalar,
int Dim,
int MaxDim>
112 struct rotation_base_generic_product_selector< RotationDerived, DiagonalMatrix<Scalar,Dim,MaxDim>, false >
114 typedef Transform<Scalar,Dim,Affine> ReturnType;
115 EIGEN_DEVICE_FUNC static inline ReturnType run(
const RotationDerived& r,
const DiagonalMatrix<Scalar,Dim,MaxDim>&
m)
123 template<
typename RotationDerived,
typename OtherVectorType>
124 struct rotation_base_generic_product_selector<RotationDerived,OtherVectorType,true>
126 enum { Dim = RotationDerived::Dim };
127 typedef Matrix<typename RotationDerived::Scalar,Dim,1> ReturnType;
128 EIGEN_DEVICE_FUNC static EIGEN_STRONG_INLINE ReturnType run(
const RotationDerived& r,
const OtherVectorType&
v)
130 return r._transformVector(
v);
140 template<
typename Scalar_,
int Rows_,
int Cols_,
int Storage_,
int MaxRows_,
int MaxCols_>
141 template<
typename OtherDerived>
153 template<
typename Scalar_,
int Rows_,
int Cols_,
int Storage_,
int MaxRows_,
int MaxCols_>
154 template<
typename OtherDerived>
183 template<
typename Scalar,
int Dim>
190 template<
typename Scalar,
int Dim,
typename OtherDerived>
196 template<
typename Scalar,
int Dim,
typename OtherDerived>
199 EIGEN_STATIC_ASSERT(OtherDerived::RowsAtCompileTime==Dim && OtherDerived::ColsAtCompileTime==Dim,
200 YOU_MADE_A_PROGRAMMING_MISTAKE)
Array< int, Dynamic, 1 > v
Array< double, 1, 3 > e(1./3., 0.5, 2.)
#define EIGEN_DEVICE_FUNC
cout<< "Here is the matrix m:"<< endl<< m<< endl;Matrix< ptrdiff_t, 3, 1 > res
#define EIGEN_STATIC_ASSERT(X, MSG)
#define EIGEN_STATIC_ASSERT_MATRIX_SPECIFIC_SIZE(TYPE, ROWS, COLS)
Matrix< float, 1, Dynamic > MatrixType
Represents a diagonal matrix with its storage.
Base class for all dense matrices, vectors, and expressions.
The matrix class, also used for vectors and row-vectors.
Matrix & operator=(const Matrix &other)
Assigns matrices to each other.
Matrix()
Default constructor.
Represents a rotation/orientation in a 2 dimensional space.
Matrix2 toRotationMatrix() const
Common base class for compact rotation representations.
RotationMatrixType matrix() const
Transform< Scalar, Dim, Mode > operator*(const Transform< Scalar, Dim, Mode, Options > &t) const
Matrix< Scalar, Dim, Dim > RotationMatrixType
friend RotationMatrixType operator*(const EigenBase< OtherDerived > &l, const Derived &r)
Matrix< Scalar, Dim, 1 > VectorType
friend Transform< Scalar, Dim, Affine > operator*(const DiagonalMatrix< Scalar, Dim > &l, const Derived &r)
VectorType _transformVector(const OtherVectorType &v) const
const Derived & derived() const
RotationMatrixType operator*(const UniformScaling< Scalar > &s) const
internal::traits< Derived >::Scalar Scalar
RotationMatrixType toRotationMatrix() const
internal::rotation_base_generic_product_selector< Derived, OtherDerived, OtherDerived::IsVectorAtCompileTime >::ReturnType operator*(const EigenBase< OtherDerived > &e) const
Transform< Scalar, Dim, Isometry > operator*(const Translation< Scalar, Dim > &t) const
Represents a translation transformation.
static Matrix< Scalar, 2, 2 > toRotationMatrix(const Scalar &s)