template class Eigen::Map<sophus::So2<TScalar> const, kOptions>

Overview

Specialization of Eigen::Map for So2 const; derived from So2Base. More…

#include <so2.h>

template <class TScalar, int kOptions>
class Map<sophus::So2<TScalar> const, kOptions>: public sophus::So2Base {
public:
    // typedefs

    using Base = sophus::So2Base<Map<sophus::So2<TScalar> const, kOptions>> ;
    using Scalar = TScalar ;
    using Transformation = typename Base::Transformation ;
    using Point = typename Base::Point ;
    using HomogeneousPoint = typename Base::HomogeneousPoint ;
    using Tangent = typename Base::Tangent ;
    using Adjoint = typename Base::Adjoint ;

    // construction

    Map(Scalar const* coeffs);

    // methods

    SOPHUS_FUNC Map<Eigen::Vector2<Scalar> const, kOptions> const& unitComplex() const;

protected:
    // fields

    Map<Eigen::Matrix<Scalar, 2, 1> const, kOptions> unit_complex_;
};

Inherited Members

public:
    // typedefs

    using Scalar = typename Eigen::internal::traits<TDerived>::Scalar ;
    using ComplexT = typename Eigen::internal::traits<TDerived>::ComplexType ;
    using ComplexTemporaryType = Eigen::Matrix<Scalar, 2, 1, kOptions> ;
    using Transformation = Eigen::Matrix<Scalar, kMatrixDim, kMatrixDim> ;
    using Point = Eigen::Vector2<Scalar> ;
    using HomogeneousPoint = Eigen::Vector3<Scalar> ;
    using Line = Eigen::ParametrizedLine<Scalar, 2> ;
    using Hyperplane = Eigen::Hyperplane<Scalar, 2> ;
    using Tangent = Scalar ;
    using Adjoint = Scalar ;
    using ReturnScalar = typename Eigen::ScalarBinaryOpTraits<Scalar, typename TOtherDerived::Scalar>::ReturnType ;
    using So2Product = So2<ReturnScalar<TOtherDerived>> ;
    using PointProduct = Eigen::Vector2<ReturnScalar<TPointDerived>> ;
    using HomogeneousPointProduct = Eigen::Vector3<ReturnScalar<THPointDerived>> ;

    // fields

    static constexpr int kOptions = Eigen::internal::traits<TDerived>::kOptions;
    static constexpr int kDoF = 1;
    static constexpr int kNumParameters = 2;
    static constexpr int kMatrixDim = 2;
    static constexpr int kPointDim = 2;

    // methods

    SOPHUS_FUNC Adjoint adj() const;

    template <class TNewScalarType>
    SOPHUS_FUNC So2<TNewScalarType> cast() const;

    SOPHUS_FUNC Scalar* data();
    SOPHUS_FUNC Scalar const* data() const;
    SOPHUS_FUNC So2<Scalar> inverse() const;
    SOPHUS_FUNC Scalar log() const;
    SOPHUS_FUNC void normalize();
    SOPHUS_FUNC Transformation matrix() const;

    template <class TOtherDerived>
    SOPHUS_FUNC So2Base<TDerived>& operator=(So2Base<TOtherDerived> const& other);

    template <class TOtherDerived>
    SOPHUS_FUNC So2Product<TOtherDerived> operator*(So2Base<TOtherDerived> const& other) const;

    template <
        typename TPointDerived,
        typename = typename std::enable_if<IsFixedSizeVector<TPointDerived, 2>::value>::type
        >
    SOPHUS_FUNC PointProduct<TPointDerived> operator*(Eigen::MatrixBase<TPointDerived> const& p) const;

    template <
        typename THPointDerived,
        typename = typename std::enable_if<IsFixedSizeVector<THPointDerived, 3>::value>::type
        >
    SOPHUS_FUNC HomogeneousPointProduct<THPointDerived> operator*(Eigen::MatrixBase<THPointDerived> const& p) const;

    SOPHUS_FUNC Line operator*(Line const& l) const;
    SOPHUS_FUNC Hyperplane operator*(Hyperplane const& p) const;

    template <
        typename TOtherDerived,
        typename = typename std::enable_if<std::is_same<Scalar, ReturnScalar<TOtherDerived>>::value>::type
        >
    SOPHUS_FUNC So2Base<TDerived> operator*=(So2Base<TOtherDerived> const& other);

    SOPHUS_FUNC Eigen::Matrix<Scalar, kNumParameters, kDoF> dxThisMulExpXAt0() const;
    SOPHUS_FUNC Eigen::Vector<Scalar, kNumParameters> params() const;
    SOPHUS_FUNC Eigen::Matrix<Scalar, kDoF, kNumParameters> dxLogThisInvTimesXAtThis() const;
    SOPHUS_FUNC void setComplex(Point const& complex);
    SOPHUS_FUNC ComplexT const& unitComplex() const;

Detailed Documentation

Specialization of Eigen::Map for So2 const; derived from So2Base.

Allows us to wrap So2 objects around POD array (e.g. external c style complex number / tuple).

Fields

Map<Eigen::Matrix<Scalar, 2, 1> const, kOptions> unit_complex_

Mutator of unit_complex is protected to ensure class invariant.

Methods

SOPHUS_FUNC Map<Eigen::Vector2<Scalar> const, kOptions> const& unitComplex() const

Accessor of unit complex number.