Thin wrapper around Eigen::Map representing a matrix object with memory managed by a C++17 polymorphic allocator. More...
#include <aligator/memory/managed-matrix.hpp>
Public Types | |
using | Scalar = _Scalar |
using | MatrixType = Eigen::Matrix<Scalar, Rows, Cols, Options> |
using | MapType = Eigen::Map<MatrixType, Alignment> |
using | ConstMapType = Eigen::Map<const MatrixType, Alignment> |
using | Index = Eigen::Index |
using | allocator_type = polymorphic_allocator |
Public Member Functions | |
ManagedMatrix (const allocator_type &allocator={}) | |
Extended default constructor. | |
ManagedMatrix (Index size, const allocator_type &allocator) | |
ManagedMatrix (Index rows, Index cols, const allocator_type &allocator) | |
ManagedMatrix (const ManagedMatrix &other, const allocator_type &alloc={}) | |
ManagedMatrix (ManagedMatrix &&other, const allocator_type &alloc) | |
Extended move constructor, will use the provided allocator. | |
ManagedMatrix (ManagedMatrix &&other) noexcept | |
Nonextended move constructor, will use moved-from object's allocator. | |
template<typename Derived> | |
ManagedMatrix (const Eigen::MatrixBase< Derived > &mat, const allocator_type &alloc={}) | |
Copy constructor from another Eigen matrix. | |
ManagedMatrix & | operator= (const ManagedMatrix &other) |
ManagedMatrix & | operator= (ManagedMatrix &&other) |
template<typename Derived> | |
ManagedMatrix & | operator= (const Eigen::MatrixBase< Derived > &mat) |
void | resize (Index size) |
void | resize (Index rows, Index cols) |
Index | rows () const noexcept |
Index | cols () const noexcept |
Index | size () const noexcept |
Index | allocated_size () const noexcept |
Get current allocated size. | |
allocator_type | get_allocator () const noexcept |
Accessor to retrieve the allocator used for this matrix. | |
operator MapType () | |
operator ConstMapType () const | |
~ManagedMatrix () | |
MapType | to_map () |
Obtain mutable map. | |
ConstMapType | to_map () const |
Obtain const map since this is const. | |
ConstMapType | to_const_map () const |
Obtain a const map. | |
void | setZero () |
void | setZero (Index rows, Index cols) |
void | setZero (Index size) |
void | setRandom () |
void | setIdentity () |
void | setConstant (Scalar s) |
auto | noalias () |
auto | diagonal () |
auto | diagonal () const |
auto | topRows (Index n) |
auto | topRows (Index n) const |
auto | head (Index n) |
auto | head (Index n) const |
auto | tail (Index n) |
auto | tail (Index n) const |
bool | isApprox (const ManagedMatrix &other, Scalar prec=std::numeric_limits< Scalar >::epsilon()) const |
template<typename Derived> | |
bool | isApprox (const Eigen::DenseBase< Derived > &mat, Scalar prec=std::numeric_limits< Scalar >::epsilon()) const |
Scalar * | data () |
Pointer to stored data. | |
const Scalar * | data () const |
Pointer to stored data. | |
Static Public Attributes | |
static constexpr int | Rows = _Rows |
static constexpr int | Cols = _Cols |
static constexpr int | Options = _Options |
static constexpr bool | IsVectorAtCompileTime |
Thin wrapper around Eigen::Map representing a matrix object with memory managed by a C++17 polymorphic allocator.
This is an allocator-aware (AA) type, meaning it contains a allocator_type
typedef.
We follow the std::pmr::polymorphic_allocator style, thus the STL traits propagate_on_container_copy_assignment
, propagate_on_container_move_assignment
, and propagate_on_container_swap
all evaluate to false. The object's allocator does not change during its lifetime.
Definition at line 22 of file managed-matrix.hpp.
using aligator::ManagedMatrix< _Scalar, _Rows, _Cols, _Options, Alignment >::Scalar = _Scalar |
Definition at line 38 of file managed-matrix.hpp.
using aligator::ManagedMatrix< _Scalar, _Rows, _Cols, _Options, Alignment >::MatrixType = Eigen::Matrix<Scalar, Rows, Cols, Options> |
Definition at line 42 of file managed-matrix.hpp.
using aligator::ManagedMatrix< _Scalar, _Rows, _Cols, _Options, Alignment >::MapType = Eigen::Map<MatrixType, Alignment> |
Definition at line 43 of file managed-matrix.hpp.
using aligator::ManagedMatrix< _Scalar, _Rows, _Cols, _Options, Alignment >::ConstMapType = Eigen::Map<const MatrixType, Alignment> |
Definition at line 44 of file managed-matrix.hpp.
using aligator::ManagedMatrix< _Scalar, _Rows, _Cols, _Options, Alignment >::Index = Eigen::Index |
Definition at line 45 of file managed-matrix.hpp.
using aligator::ManagedMatrix< _Scalar, _Rows, _Cols, _Options, Alignment >::allocator_type = polymorphic_allocator |
Definition at line 46 of file managed-matrix.hpp.
|
inlineexplicit |
Extended default constructor.
Definition at line 52 of file managed-matrix.hpp.
|
inlineexplicit |
Definition at line 58 of file managed-matrix.hpp.
|
inlineexplicit |
Definition at line 74 of file managed-matrix.hpp.
|
inline |
Definition at line 83 of file managed-matrix.hpp.
|
inline |
Extended move constructor, will use the provided allocator.
Definition at line 89 of file managed-matrix.hpp.
|
inlinenoexcept |
Nonextended move constructor, will use moved-from object's allocator.
Definition at line 110 of file managed-matrix.hpp.
|
inline |
Copy constructor from another Eigen matrix.
Definition at line 123 of file managed-matrix.hpp.
|
inline |
Definition at line 224 of file managed-matrix.hpp.
|
inline |
Definition at line 129 of file managed-matrix.hpp.
|
inline |
Definition at line 143 of file managed-matrix.hpp.
|
inline |
Definition at line 163 of file managed-matrix.hpp.
|
inline |
Definition at line 169 of file managed-matrix.hpp.
|
inline |
Definition at line 184 of file managed-matrix.hpp.
|
inlinenoexcept |
Definition at line 194 of file managed-matrix.hpp.
|
inlinenoexcept |
Definition at line 196 of file managed-matrix.hpp.
|
inlinenoexcept |
Definition at line 198 of file managed-matrix.hpp.
|
inlinenoexcept |
Get current allocated size.
Definition at line 201 of file managed-matrix.hpp.
|
inlinenodiscardnoexcept |
Accessor to retrieve the allocator used for this matrix.
Definition at line 204 of file managed-matrix.hpp.
|
inlineexplicitnodiscard |
Definition at line 208 of file managed-matrix.hpp.
|
inlineexplicitnodiscard |
Definition at line 216 of file managed-matrix.hpp.
|
inline |
Obtain mutable map.
Definition at line 227 of file managed-matrix.hpp.
|
inline |
Obtain const map since this is const.
Definition at line 230 of file managed-matrix.hpp.
|
inline |
Obtain a const map.
Definition at line 233 of file managed-matrix.hpp.
|
inline |
Definition at line 235 of file managed-matrix.hpp.
|
inline |
Definition at line 237 of file managed-matrix.hpp.
|
inline |
Definition at line 242 of file managed-matrix.hpp.
|
inline |
Definition at line 247 of file managed-matrix.hpp.
|
inline |
Definition at line 249 of file managed-matrix.hpp.
|
inline |
Definition at line 251 of file managed-matrix.hpp.
|
inline |
Definition at line 253 of file managed-matrix.hpp.
|
inline |
Definition at line 255 of file managed-matrix.hpp.
|
inline |
Definition at line 256 of file managed-matrix.hpp.
|
inline |
Definition at line 258 of file managed-matrix.hpp.
|
inline |
Definition at line 259 of file managed-matrix.hpp.
|
inline |
Definition at line 261 of file managed-matrix.hpp.
|
inline |
Definition at line 262 of file managed-matrix.hpp.
|
inline |
Definition at line 264 of file managed-matrix.hpp.
|
inline |
Definition at line 265 of file managed-matrix.hpp.
|
inline |
Definition at line 267 of file managed-matrix.hpp.
|
inline |
Definition at line 273 of file managed-matrix.hpp.
|
inlinenodiscard |
Pointer to stored data.
Definition at line 279 of file managed-matrix.hpp.
|
inlinenodiscard |
Pointer to stored data.
Definition at line 282 of file managed-matrix.hpp.
|
staticconstexpr |
Definition at line 39 of file managed-matrix.hpp.
|
staticconstexpr |
Definition at line 40 of file managed-matrix.hpp.
|
staticconstexpr |
Definition at line 41 of file managed-matrix.hpp.
|
staticconstexpr |
Definition at line 48 of file managed-matrix.hpp.