template class mrpt::math::CMatrixColumnAccessor

Overview

A vector-like wrapper for a Matrix for accessing the elements of a given column with a [] operator.

See also:

CMatrixRowAccessor, CMatrixColumnAccessorExtended, CConstMatrixColumnAccessor, CConstMatrixColumnAccessorExtended

#include <mrpt/math/matrix_adaptors.h>

template <typename MAT>
class CMatrixColumnAccessor
{
public:
    // typedefs

    typedef typename MAT::Scalar value_type;
    typedef CMatrixColumnAccessor<MAT> mrpt_autotype;
    typedef detail::AccessorIterator<CMatrixColumnAccessor<MAT>, value_type> iterator;
    typedef detail::AccessorIterator<const CMatrixColumnAccessor<MAT>, const value_type> const_iterator;
    typedef detail::ReverseAccessorIterator<CMatrixColumnAccessor<MAT>, value_type> reverse_iterator;
    typedef detail::ReverseAccessorIterator<const CMatrixColumnAccessor<MAT>, const value_type> const_reverse_iterator;

    // construction

    CMatrixColumnAccessor(
        MAT& mat,
        size_t colIdx
        );

    CMatrixColumnAccessor();

    // methods

    value_type& operator [] (const size_t i);
    value_type operator [] (const size_t i) const;
    iterator begin();
    const_iterator begin() const;
    iterator end();
    const_iterator end() const;
    reverse_iterator rbegin();
    const_reverse_iterator rbegin() const;
    reverse_iterator rend();
    const_reverse_iterator rend() const;
    size_t size() const;
    void resize(size_t N);
};