11 #ifndef EIGEN_SKEWSYMMETRICMATRIX3_H
12 #define EIGEN_SKEWSYMMETRICMATRIX3_H
33 template<
typename Derived>
38 typedef typename SkewSymmetricVectorType::Scalar
Scalar;
39 typedef typename SkewSymmetricVectorType::RealScalar
RealScalar;
40 typedef typename internal::traits<Derived>::StorageKind
StorageKind;
41 typedef typename internal::traits<Derived>::StorageIndex
StorageIndex;
58 inline const Derived&
derived()
const {
return *
static_cast<const Derived*
>(
this); }
61 inline Derived&
derived() {
return *
static_cast<Derived*
>(
this); }
86 const Scalar norm2 =
v.squaredNorm();
107 template<
typename MatrixDerived>
116 template<
typename MatrixDerived>
124 template <
typename OtherDerived>
130 template <
typename OtherDerived>
133 return vector().cross(other.
vector()).asSkewSymmetric();
142 return (
vector() * scalar).asSkewSymmetric();
151 return (scalar * other.
vector()).asSkewSymmetric();
154 template <
typename OtherDerived>
159 template <
typename OtherDerived>
165 template <
typename OtherDerived>
170 template <
typename OtherDerived>
188 template<
typename Scalar_>
189 struct traits<SkewSymmetricMatrix3<Scalar_> >
190 : traits<Matrix<Scalar_,3,3,0,3,3> >
199 template<
typename Scalar_>
204 #ifndef EIGEN_PARSED_BY_DOXYGEN
208 typedef typename internal::traits<SkewSymmetricMatrix3>::StorageKind
StorageKind;
209 typedef typename internal::traits<SkewSymmetricMatrix3>::StorageIndex
StorageIndex;
238 template<
typename OtherDerived>
244 template<
typename OtherDerived>
248 #ifndef EIGEN_PARSED_BY_DOXYGEN
254 template<
typename OtherDerived>
262 #ifndef EIGEN_PARSED_BY_DOXYGEN
301 template<
typename SkewSymmetricVectorType_>
302 struct traits<SkewSymmetricWrapper<SkewSymmetricVectorType_> >
304 typedef SkewSymmetricVectorType_ SkewSymmetricVectorType;
305 typedef typename SkewSymmetricVectorType::Scalar Scalar;
306 typedef typename SkewSymmetricVectorType::StorageIndex StorageIndex;
307 typedef SkewSymmetricShape StorageKind;
308 typedef typename traits<SkewSymmetricVectorType>::XprKind XprKind;
310 RowsAtCompileTime = SkewSymmetricVectorType::SizeAtCompileTime,
311 ColsAtCompileTime = SkewSymmetricVectorType::SizeAtCompileTime,
312 MaxRowsAtCompileTime = SkewSymmetricVectorType::MaxSizeAtCompileTime,
313 MaxColsAtCompileTime = SkewSymmetricVectorType::MaxSizeAtCompileTime,
319 template<
typename SkewSymmetricVectorType_>
321 :
public SkewSymmetricBase<SkewSymmetricWrapper<SkewSymmetricVectorType_> >, internal::no_assignment_operator
324 #ifndef EIGEN_PARSED_BY_DOXYGEN
347 template<
typename Derived>
357 template<
typename Derived>
361 return (this->transpose() + *
this).isZero(prec);
366 template<
typename Derived>
367 template<
typename SkewDerived>
378 struct SkewSymmetric2Dense {};
380 template<>
struct AssignmentKind<DenseShape,SkewSymmetricShape> {
typedef SkewSymmetric2Dense Kind; };
383 template<
typename DstXprType,
typename SrcXprType,
typename Functor>
384 struct Assignment<DstXprType, SrcXprType, Functor, SkewSymmetric2Dense>
387 static void run(DstXprType &dst,
const SrcXprType &src,
const internal::assign_op<typename DstXprType::Scalar,typename SrcXprType::Scalar> &)
389 if((dst.rows()!=3) || (dst.cols()!=3)) {
392 dst.diagonal().setZero();
393 const typename SrcXprType::SkewSymmetricVectorType
v = src.vector();
402 static void run(DstXprType &dst,
const SrcXprType &src,
const internal::add_assign_op<typename DstXprType::Scalar,typename SrcXprType::Scalar> &)
403 { dst.vector() += src.vector(); }
406 static void run(DstXprType &dst,
const SrcXprType &src,
const internal::sub_assign_op<typename DstXprType::Scalar,typename SrcXprType::Scalar> &)
407 { dst.vector() -= src.vector(); }
Array< int, Dynamic, 1 > v
#define EIGEN_CWISE_BINARY_RETURN_TYPE(LHS, RHS, OPNAME)
#define EIGEN_DEVICE_FUNC
#define EIGEN_EXPR_BINARYOP_SCALAR_RETURN_TYPE(EXPR, SCALAR, OPNAME)
#define EIGEN_SCALAR_BINARYOP_EXPR_RETURN_TYPE(SCALAR, EXPR, OPNAME)
NumTraits< Scalar >::Real RealScalar
internal::traits< Homogeneous< MatrixType, Direction_ > >::StorageKind StorageKind
Base class for all dense matrices, vectors, and expressions.
const SkewSymmetricWrapper< const Derived > asSkewSymmetric() const
static const IdentityReturnType Identity()
bool isSkewSymmetric(const RealScalar &prec=NumTraits< Scalar >::dummy_precision()) const
const Product< Derived, OtherDerived > operator*(const MatrixBase< OtherDerived > &other) const
The matrix class, also used for vectors and row-vectors.
Expression of the product of two arbitrary matrices or vectors.
Base class for skew symmetric matrices and expressions.
SkewSymmetricVectorType::RealScalar RealScalar
SkewSymmetricDifferenceReturnType< OtherDerived > operator-(const SkewSymmetricBase< OtherDerived > &other) const
SkewSymmetricVectorType & vector()
const Derived & derived() const
DenseMatrixType toDenseMatrix() const
Product< Derived, MatrixDerived, LazyProduct > operator*(const SkewSymmetricBase< MatrixDerived > &matrix) const
SkewSymmetricScaleReturnType operator*(const Scalar &scalar) const
EIGEN_CONSTEXPR Index cols() const
const SkewSymmetricVectorType & vector() const
Product< Derived, MatrixDerived, LazyProduct > operator*(const MatrixBase< MatrixDerived > &matrix) const
DenseMatrixType DenseType
internal::traits< Derived >::StorageIndex StorageIndex
internal::traits< Derived >::SkewSymmetricVectorType SkewSymmetricVectorType
EIGEN_CONSTEXPR Index rows() const
DenseMatrixType exponential() const
friend ScaleSkewSymmetricReturnType operator*(const Scalar &scalar, const SkewSymmetricBase &other)
EIGEN_CONSTEXPR Scalar determinant() const
SkewSymmetricVectorType::Scalar Scalar
internal::traits< Derived >::StorageKind StorageKind
SkewSymmetricSumReturnType< OtherDerived > operator+(const SkewSymmetricBase< OtherDerived > &other) const
SkewSymmetricMatrix3< Scalar > PlainObject
SkewSymmetricProductReturnType< OtherDerived > wedge(const SkewSymmetricBase< OtherDerived > &other) const
PlainObject transpose() const
Matrix< Scalar, RowsAtCompileTime, ColsAtCompileTime, 0, MaxRowsAtCompileTime, MaxColsAtCompileTime > DenseMatrixType
Represents a 3x3 skew symmetric matrix with its storage.
SkewSymmetricWrapper< const CwiseNullaryOp< internal::scalar_constant_op< Scalar >, SkewSymmetricVectorType > > InitializeReturnType
SkewSymmetricMatrix3(SkewSymmetricVectorType &&vec)
Constructs a SkewSymmetricMatrix3 from an r-value vector type.
SkewSymmetricMatrix3 & operator=(const SkewSymmetricBase< OtherDerived > &other)
const SkewSymmetricVectorType & vector() const
SkewSymmetricVectorType m_vector
SkewSymmetricMatrix3(const Scalar &x, const Scalar &y, const Scalar &z)
SkewSymmetricVectorType & vector()
static InitializeReturnType Zero()
SkewSymmetricMatrix3(const MatrixBase< OtherDerived > &other)
SkewSymmetricMatrix3(const SkewSymmetricBase< OtherDerived > &other)
Expression of a skew symmetric matrix.
SkewSymmetricVectorType::Nested m_vector
SkewSymmetricWrapper(SkewSymmetricVectorType &a_vector)
const SkewSymmetricVectorType & vector() const
const unsigned int NoPreferredStorageOrderBit
const unsigned int LvalueBit
EIGEN_ALWAYS_INLINE T sin(const T &x)
EIGEN_ALWAYS_INLINE float sqrt(const float &x)
EIGEN_ALWAYS_INLINE T cos(const T &x)
const unsigned int NestByRefBit
Eigen::Index Index
The interface type of indices.