template class mrpt::math::MatrixVectorBase

Overview

Base CRTP class for all MRPT vectors and matrices.

Template methods whose implementation is not in this header file are explicitly instantiated and exported for these derived types:

See also:

CMatrixFixed

#include <mrpt/math/MatrixVectorBase.h>

template <typename Scalar, class Derived>
class MatrixVectorBase
{
public:
    // methods

    void setConstant(const Scalar value);

    void setConstant(
        size_t nrows,
        size_t ncols,
        const Scalar value
        );

    void setConstant(
        size_t nrows,
        const Scalar value
        );

    void assign(
        const std::size_t N,
        const Scalar value
        );

    void setZero();

    void setZero(
        size_t nrows,
        size_t ncols
        );

    void setZero(size_t nrows);
    static Derived Constant(const Scalar value);

    static Derived Constant(
        size_t nrows,
        size_t ncols,
        const Scalar value
        );

    static Derived Zero();

    static Derived Zero(
        size_t nrows,
        size_t ncols
        );

    auto block(
        int start_row,
        int start_col,
        int BLOCK_ROWS,
        int BLOCK_COLS
        );

    auto block(
        int start_row,
        int start_col,
        int BLOCK_ROWS,
        int BLOCK_COLS
        ) const;

    auto transpose();
    auto transpose() const;
    auto array();
    auto array() const;
    auto operator - () const;

    template <typename S2, class D2>
    auto operator + (const MatrixVectorBase<S2, D2>& m2) const;

    template <typename S2, class D2>
    void operator += (const MatrixVectorBase<S2, D2>& m2);

    template <typename S2, class D2>
    auto operator - (const MatrixVectorBase<S2, D2>& m2) const;

    template <typename S2, class D2>
    void operator -= (const MatrixVectorBase<S2, D2>& m2);

    template <typename S2, class D2>
    auto operator * (const MatrixVectorBase<S2, D2>& m2) const;

    auto operator * (const Scalar s) const;

    template <int N>
    CMatrixFixed<Scalar, N, 1> tail() const;

    template <int N>
    CMatrixFixed<Scalar, N, 1> head() const;

    Scalar& coeffRef(
        int r,
        int c
        );

    const Scalar& coeff(
        int r,
        int c
        ) const;

    Scalar minCoeff(std::size_t& outIndexOfMin) const;

    Scalar minCoeff(
        std::size_t& rowIdx,
        std::size_t& colIdx
        ) const;

    Scalar maxCoeff(std::size_t& outIndexOfMax) const;

    Scalar maxCoeff(
        std::size_t& rowIdx,
        std::size_t& colIdx
        ) const;

    void operator += (Scalar s);
    void operator -= (Scalar s);
    void operator *= (Scalar s);
    CMatrixDynamic<Scalar> operator * (const CMatrixDynamic<Scalar>& v);
    Derived operator + (const Derived& m2) const;
    void operator += (const Derived& m2);
    Derived operator - (const Derived& m2) const;
    void operator -= (const Derived& m2);
    Derived operator * (const Derived& m2) const;
    Scalar dot(const MatrixVectorBase<Scalar, Derived>& v) const;

    template <typename OTHERMATVEC>
    bool operator == (const OTHERMATVEC& o) const;

    template <typename OTHERMATVEC>
    bool operator != (const OTHERMATVEC& o) const;

    Derived& mvbDerived();
    const Derived& mvbDerived() const;
};

// direct descendants

template <class T>
class CVectorDynamic;

template <typename Scalar, class Derived>
class MatrixBase;