riccaticpp
Loading...
Searching...
No Matches
riccati::arena_matrix< MatrixType > Class Template Reference

#include <arena_matrix.hpp>

Inheritance diagram for riccati::arena_matrix< MatrixType >:

Public Types

using Scalar = typename std::decay_t<MatrixType>::Scalar
 
using Base = Eigen::Map<MatrixType>
 
using PlainObject = std::decay_t<MatrixType>
 
typedef Eigen::internal::remove_all< Base >::type NestedExpression
 
using allocator_t = arena_allocator<Scalar, arena_alloc>
 

Public Member Functions

template<typename T >
 arena_matrix (arena_allocator< T, arena_alloc > &allocator)
 
template<typename T >
 arena_matrix (arena_allocator< T, arena_alloc > &allocator, Eigen::Index rows, Eigen::Index cols)
 
template<typename T >
 arena_matrix (arena_allocator< T, arena_alloc > &allocator, Eigen::Index size)
 
template<typename T , typename Expr >
 arena_matrix (arena_allocator< T, arena_alloc > &allocator, const Expr &other)
 
 arena_matrix (const Base &other)
 
 arena_matrix (const arena_matrix< MatrixType > &other)
 
arena_matrixoperator= (const arena_matrix< MatrixType > &other)
 
template<typename T >
arena_matrixoperator= (const T &a)
 

Public Attributes

allocator_t allocator_
 

Static Public Attributes

static constexpr int RowsAtCompileTime = MatrixType::RowsAtCompileTime
 
static constexpr int ColsAtCompileTime = MatrixType::ColsAtCompileTime
 

Detailed Description

template<typename MatrixType>
class riccati::arena_matrix< MatrixType >

Equivalent to Eigen::Matrix, except that the data is stored on AD stack. That makes these objects triviali destructible and usable in varis.

Template Parameters
MatrixTypeEigen matrix type this works as (MatrixXd, VectorXd ...)

Definition at line 20 of file arena_matrix.hpp.

Member Typedef Documentation

◆ allocator_t

template<typename MatrixType >
using riccati::arena_matrix< MatrixType >::allocator_t = arena_allocator<Scalar, arena_alloc>

Definition at line 28 of file arena_matrix.hpp.

◆ Base

template<typename MatrixType >
using riccati::arena_matrix< MatrixType >::Base = Eigen::Map<MatrixType>

Definition at line 23 of file arena_matrix.hpp.

◆ NestedExpression

template<typename MatrixType >
Eigen::internal::remove_all<Base>::type riccati::arena_matrix< MatrixType >::NestedExpression

Definition at line 25 of file arena_matrix.hpp.

◆ PlainObject

template<typename MatrixType >
using riccati::arena_matrix< MatrixType >::PlainObject = std::decay_t<MatrixType>

Definition at line 24 of file arena_matrix.hpp.

◆ Scalar

template<typename MatrixType >
using riccati::arena_matrix< MatrixType >::Scalar = typename std::decay_t<MatrixType>::Scalar

Definition at line 22 of file arena_matrix.hpp.

Constructor & Destructor Documentation

◆ arena_matrix() [1/6]

template<typename MatrixType >
template<typename T >
riccati::arena_matrix< MatrixType >::arena_matrix ( arena_allocator< T, arena_alloc > & allocator)
inline

Basic allocator constructor.

Parameters
allocatorThe allocator to receive memory from

Definition at line 35 of file arena_matrix.hpp.

References riccati::arena_matrix< MatrixType >::allocator_, and riccati::arena_allocator< T, ArenaType >::owns_alloc_.

◆ arena_matrix() [2/6]

template<typename MatrixType >
template<typename T >
riccati::arena_matrix< MatrixType >::arena_matrix ( arena_allocator< T, arena_alloc > & allocator,
Eigen::Index rows,
Eigen::Index cols )
inline

Constructs arena_matrix with given number of rows and columns.

Parameters
allocatorThe allocator to receive memory from
rowsnumber of rows
colsnumber of columns

Definition at line 50 of file arena_matrix.hpp.

References riccati::arena_matrix< MatrixType >::allocator_, and riccati::arena_allocator< T, ArenaType >::owns_alloc_.

◆ arena_matrix() [3/6]

template<typename MatrixType >
template<typename T >
riccati::arena_matrix< MatrixType >::arena_matrix ( arena_allocator< T, arena_alloc > & allocator,
Eigen::Index size )
inline

Constructs arena_matrix with given size. This only works if MatrixType is row or col vector.

Parameters
allocatorThe allocator to receive memory from
sizenumber of elements

Definition at line 64 of file arena_matrix.hpp.

◆ arena_matrix() [4/6]

template<typename MatrixType >
template<typename T , typename Expr >
riccati::arena_matrix< MatrixType >::arena_matrix ( arena_allocator< T, arena_alloc > & allocator,
const Expr & other )
inline

Constructs arena_matrix from an expression.

Parameters
allocatorThe allocator to receive memory from
otherexpression

Definition at line 74 of file arena_matrix.hpp.

References riccati::arena_matrix< MatrixType >::allocator_, and riccati::arena_allocator< T, ArenaType >::owns_alloc_.

◆ arena_matrix() [5/6]

template<typename MatrixType >
riccati::arena_matrix< MatrixType >::arena_matrix ( const Base & other)
inline

Constructs arena_matrix from an expression. This makes an assumption that any other Eigen::Map also contains memory allocated in the arena.

Parameters
otherexpression

Definition at line 96 of file arena_matrix.hpp.

◆ arena_matrix() [6/6]

template<typename MatrixType >
riccati::arena_matrix< MatrixType >::arena_matrix ( const arena_matrix< MatrixType > & other)
inline

Copy constructor.

Parameters
othermatrix to copy from

Definition at line 103 of file arena_matrix.hpp.

References riccati::arena_matrix< MatrixType >::allocator_, and riccati::arena_allocator< T, ArenaType >::owns_alloc_.

Member Function Documentation

◆ operator=() [1/2]

template<typename MatrixType >
arena_matrix & riccati::arena_matrix< MatrixType >::operator= ( const arena_matrix< MatrixType > & other)
inline

Copy assignment operator.

Parameters
othermatrix to copy from
Returns
*this

Definition at line 119 of file arena_matrix.hpp.

References riccati::arena_matrix< MatrixType >::allocator_, and riccati::arena_allocator< T, ArenaType >::owns_alloc_.

◆ operator=() [2/2]

template<typename MatrixType >
template<typename T >
arena_matrix & riccati::arena_matrix< MatrixType >::operator= ( const T & a)
inline

Assignment operator for assigning an expression.

Parameters
aexpression to evaluate into this
Returns
*this

Definition at line 135 of file arena_matrix.hpp.

References riccati::arena_matrix< MatrixType >::allocator_, riccati::arena_matrix< MatrixType >::ColsAtCompileTime, riccati::arena_allocator< T, ArenaType >::owns_alloc_, and riccati::arena_matrix< MatrixType >::RowsAtCompileTime.

Member Data Documentation

◆ allocator_

template<typename MatrixType >
allocator_t riccati::arena_matrix< MatrixType >::allocator_

Definition at line 29 of file arena_matrix.hpp.

◆ ColsAtCompileTime

template<typename MatrixType >
int riccati::arena_matrix< MatrixType >::ColsAtCompileTime = MatrixType::ColsAtCompileTime
staticconstexpr

Definition at line 27 of file arena_matrix.hpp.

◆ RowsAtCompileTime

template<typename MatrixType >
int riccati::arena_matrix< MatrixType >::RowsAtCompileTime = MatrixType::RowsAtCompileTime
staticconstexpr

Definition at line 26 of file arena_matrix.hpp.


The documentation for this class was generated from the following file: