Expression Templates Library (ETL)
Public Types | Public Member Functions | Public Attributes | Static Public Attributes | List of all members
etl::dense_dyn_base< Derived, T, SO, D > Struct Template Reference

Dense Matrix with run-time fixed dimensions. The matrix support an arbitrary number of dimensions. More...

#include <dyn_base.hpp>

Inheritance diagram for etl::dense_dyn_base< Derived, T, SO, D >:
Inheritance graph
[legend]
Collaboration diagram for etl::dense_dyn_base< Derived, T, SO, D >:
Collaboration graph
[legend]

Public Types

using value_type = T
 The type of the contained values.
 
using base_type = dyn_base< Derived, T, D >
 The base type.
 
using this_type = dense_dyn_base< Derived, T, SO, D >
 The type of this class.
 
using derived_t = Derived
 The derived type.
 
using memory_type = value_type *
 The memory type.
 
using const_memory_type = const value_type *
 The const memory type.
 
using iterator = memory_type
 The type of iterator.
 
using const_iterator = const_memory_type
 The type of const iterator.
 
using dimension_storage_impl = typename base_type::dimension_storage_impl
 The storage type used to store the dimensions.
 

Public Member Functions

 dense_dyn_base () noexcept
 Initialize the dense_dyn_base with a size of 0.
 
 dense_dyn_base (const dense_dyn_base &rhs) noexcept
 Copy construct a dense_dyn_base. More...
 
 dense_dyn_base (const derived_t &rhs) noexcept
 Copy construct a derived_t. More...
 
 dense_dyn_base (dense_dyn_base &&rhs) noexcept
 Move construct a dense_dyn_base. More...
 
 dense_dyn_base (derived_t &&rhs) noexcept
 Move construct a derived_t. More...
 
 dense_dyn_base (size_t size, dimension_storage_impl dimensions) noexcept
 Construct a dense_dyn_base if the given size and dimensions. More...
 
template<etl_expr E>
 dense_dyn_base (E &&rhs) requires(!std
 Move construct a dense_dyn_base. More...
 
decltype(auto) operator() (size_t i) noexcept(assert_nothrow)
 Access the ith element of the container. More...
 
decltype(auto) operator() (size_t i) const noexcept(assert_nothrow)
 Access the ith element of the container. More...
 

Public Attributes

value_type *ETL_RESTRICT _memory = nullptr
 Pointer to the allocated memory.
 
gpu_memory_handler< T > _gpu
 The GPU memory handler.
 

Static Public Attributes

static constexpr size_t n_dimensions = D
 The number of dimensions.
 
static constexpr order storage_order = SO
 The storage order.
 

Detailed Description

template<typename Derived, typename T, order SO, size_t D>
struct etl::dense_dyn_base< Derived, T, SO, D >

Dense Matrix with run-time fixed dimensions. The matrix support an arbitrary number of dimensions.

Constructor & Destructor Documentation

◆ dense_dyn_base() [1/6]

template<typename Derived, typename T, order SO, size_t D>
etl::dense_dyn_base< Derived, T, SO, D >::dense_dyn_base ( const dense_dyn_base< Derived, T, SO, D > &  rhs)
inlinenoexcept

Copy construct a dense_dyn_base.

Parameters
rhsThe dense_dyn_base to copy from

◆ dense_dyn_base() [2/6]

template<typename Derived, typename T, order SO, size_t D>
etl::dense_dyn_base< Derived, T, SO, D >::dense_dyn_base ( const derived_t rhs)
inlineexplicitnoexcept

Copy construct a derived_t.

This constructor is necessary in order to use the correct constructor in the parent type.

Parameters
rhsThe derived_t to copy from

◆ dense_dyn_base() [3/6]

template<typename Derived, typename T, order SO, size_t D>
etl::dense_dyn_base< Derived, T, SO, D >::dense_dyn_base ( dense_dyn_base< Derived, T, SO, D > &&  rhs)
inlinenoexcept

Move construct a dense_dyn_base.

Parameters
rhsThe dense_dyn_base to move from

◆ dense_dyn_base() [4/6]

template<typename Derived, typename T, order SO, size_t D>
etl::dense_dyn_base< Derived, T, SO, D >::dense_dyn_base ( derived_t &&  rhs)
inlineexplicitnoexcept

Move construct a derived_t.

This constructor is necessary in order to use the correct constructor in the parent type.

Parameters
rhsThe dense_dyn_base to move from

◆ dense_dyn_base() [5/6]

template<typename Derived, typename T, order SO, size_t D>
etl::dense_dyn_base< Derived, T, SO, D >::dense_dyn_base ( size_t  size,
dimension_storage_impl  dimensions 
)
inlinenoexcept

Construct a dense_dyn_base if the given size and dimensions.

Parameters
sizeThe size of the matrix
dimensionsThe dimensions of the matrix

◆ dense_dyn_base() [6/6]

template<typename Derived, typename T, order SO, size_t D>
template<etl_expr E>
etl::dense_dyn_base< Derived, T, SO, D >::dense_dyn_base ( E &&  rhs)
inlineexplicit

Move construct a dense_dyn_base.

Parameters
rhsThe dense_dyn_base to move from

Member Function Documentation

◆ operator()() [1/2]

template<typename Derived, typename T, order SO, size_t D>
decltype(auto) etl::dense_dyn_base< Derived, T, SO, D >::operator() ( size_t  i)
inlinenoexcept

Access the ith element of the container.

If the container is vector, this returns a reference to the ith element of the vector. If the container is a matrix, this returns a sub view inside the first dimension of the matrix at the ith index.

Parameters
iThe index of the element to search
Returns
a reference to the ith element or a sub a view

Accessing an element outside the matrix results in Undefined Behaviour.

◆ operator()() [2/2]

template<typename Derived, typename T, order SO, size_t D>
decltype(auto) etl::dense_dyn_base< Derived, T, SO, D >::operator() ( size_t  i) const
inlinenoexcept

Access the ith element of the container.

If the container is vector, this returns a reference to the ith element of the vector. If the container is a matrix, this returns a sub view inside the first dimension of the matrix at the ith index.

Parameters
iThe index of the element to search
Returns
a reference to the ith element or a sub a view

Accessing an element outside the matrix results in Undefined Behaviour.


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