// This file is part of Eigen, a lightweight C++ template library // for linear algebra. // // Copyright (C) 2009 Gael Guennebaud <[email protected]> // Copyright (C) 2007-2009 Benoit Jacob <[email protected]> // // This Source Code Form is subject to the terms of the Mozilla // Public License v. 2.0. If a copy of the MPL was not distributed // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. #ifndef EIGEN_SKEWSYMMETRICMATRIX3_H #define EIGEN_SKEWSYMMETRICMATRIX3_H // IWYU pragma: private #include "./InternalHeaderCheck.h" namespace Eigen { /** \class SkewSymmetricBase * \ingroup Core_Module * * \brief Base class for skew symmetric matrices and expressions * * This is the base class that is inherited by SkewSymmetricMatrix3 and related expression * types, which internally use a three vector for storing the entries. SkewSymmetric * types always represent square three times three matrices. * * This implementations follows class DiagonalMatrix * * \tparam Derived is the derived type, a SkewSymmetricMatrix3 or SkewSymmetricWrapper. * * \sa class SkewSymmetricMatrix3, class SkewSymmetricWrapper */ template <typename Derived> class SkewSymmetricBase : public EigenBase<Derived> { … }; /** \class SkewSymmetricMatrix3 * \ingroup Core_Module * * \brief Represents a 3x3 skew symmetric matrix with its storage * * \tparam Scalar_ the type of coefficients * * \sa class SkewSymmetricBase, class SkewSymmetricWrapper */ namespace internal { traits<SkewSymmetricMatrix3<Scalar_>>; } // namespace internal template <typename Scalar_> class SkewSymmetricMatrix3 : public SkewSymmetricBase<SkewSymmetricMatrix3<Scalar_>> { … }; /** \class SkewSymmetricWrapper * \ingroup Core_Module * * \brief Expression of a skew symmetric matrix * * \tparam SkewSymmetricVectorType_ the type of the vector of coefficients * * This class is an expression of a skew symmetric matrix, but not storing its own vector of coefficients, * instead wrapping an existing vector expression. It is the return type of MatrixBase::asSkewSymmetric() * and most of the time this is the only way that it is used. * * \sa class SkewSymmetricMatrix3, class SkewSymmetricBase, MatrixBase::asSkewSymmetric() */ namespace internal { traits<SkewSymmetricWrapper<SkewSymmetricVectorType_>>; } // namespace internal template <typename SkewSymmetricVectorType_> class SkewSymmetricWrapper : public SkewSymmetricBase<SkewSymmetricWrapper<SkewSymmetricVectorType_>>, internal::no_assignment_operator { … }; /** \returns a pseudo-expression of a skew symmetric matrix with *this as vector of coefficients * * \only_for_vectors * * \sa class SkewSymmetricWrapper, class SkewSymmetricMatrix3, vector(), isSkewSymmetric() **/ template <typename Derived> EIGEN_DEVICE_FUNC inline const SkewSymmetricWrapper<const Derived> MatrixBase<Derived>::asSkewSymmetric() const { … } /** \returns true if *this is approximately equal to a skew symmetric matrix, * within the precision given by \a prec. */ template <typename Derived> bool MatrixBase<Derived>::isSkewSymmetric(const RealScalar& prec) const { … } /** \returns the matrix product of \c *this by the skew symmetric matrix \skew. */ template <typename Derived> template <typename SkewDerived> EIGEN_DEVICE_FUNC inline const Product<Derived, SkewDerived, LazyProduct> MatrixBase<Derived>::operator*( const SkewSymmetricBase<SkewDerived>& skew) const { … } namespace internal { template <> struct storage_kind_to_shape<SkewSymmetricShape> { … }; struct SkewSymmetric2Dense { … }; template <> struct AssignmentKind<DenseShape, SkewSymmetricShape> { … }; // SkewSymmetric matrix to Dense assignment Assignment<DstXprType, SrcXprType, Functor, SkewSymmetric2Dense>; } // namespace internal } // end namespace Eigen #endif // EIGEN_SKEWSYMMETRICMATRIX3_H