Expression Templates Library (ETL)
Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Member Functions | Static Protected Member Functions | Protected Attributes | List of all members
etl::fast_matrix_base< D, T, ST, SO, Dims > Struct Template Reference
Collaboration diagram for etl::fast_matrix_base< D, T, ST, SO, Dims >:
Collaboration graph
[legend]

Public Types

using value_type = T
 The type of value.
 
using derived_t = D
 The derived type.
 
using storage_impl = ST
 The storage implementation.
 
using memory_type = value_type *
 The memory type.
 
using const_memory_type = const value_type *
 The const memory type.
 
using iterator = std::conditional_t< SO==order::RowMajor, value_type *, etl::iterator< derived_t > >
 The iterator type.
 
using const_iterator = std::conditional_t< SO==order::RowMajor, const value_type *, etl::iterator< const derived_t > >
 The iterator type.
 

Public Member Functions

 fast_matrix_base ()
 Construct a default fast_matrix_base.
 
 fast_matrix_base (storage_impl data)
 Construct a default fast_matrix_base from storage. More...
 
 fast_matrix_base (const fast_matrix_base &rhs)
 Copy Construct a fast_matrix_base. More...
 
 fast_matrix_base (fast_matrix_base &&rhs) noexcept
 Move Construct a fast_matrix_base. More...
 
fast_matrix_baseoperator= (const fast_matrix_base &rhs)=delete
 
fast_matrix_baseoperator= (fast_matrix_base &&rhs)=delete
 
memory_type memory_start () noexcept
 Returns a pointer to the first element in memory. More...
 
const_memory_type memory_start () const noexcept
 Returns a pointer to the first element in memory. More...
 
memory_type memory_end () noexcept
 Returns a pointer to the past-the-end element in memory. More...
 
const_memory_type memory_end () const noexcept
 Returns a pointer to the past-the-end element in memory. More...
 
size_t dim (size_t d) const noexcept
 Returns the dth dimension of the matrix. More...
 
auto operator() (size_t i) noexcept requires(n_dimensions > 1)
 Creates a sub view of the matrix, effectively removing the first dimension and fixing it to the given index. More...
 
auto operator() (size_t i) const noexcept requires(n_dimensions > 1)
 Creates a sub view of the matrix, effectively removing the first dimension and fixing it to the given index. More...
 
auto slice (size_t first, size_t last) noexcept
 Creates a slice view of the matrix, effectively reducing the first dimension. More...
 
auto slice (size_t first, size_t last) const noexcept
 Creates a slice view of the matrix, effectively reducing the first dimension. More...
 

Static Public Member Functions

static constexpr size_t size () noexcept
 Returns the size of the matrix, in O(1) More...
 
static constexpr size_t rows () noexcept
 Returns the number of rows of the matrix (the first dimension), in O(1) More...
 
static constexpr size_t columns () noexcept requires(n_dimensions > 1)
 Returns the number of columns of the matrix (the second dimension), in O(1) More...
 
static constexpr size_t dimensions () noexcept
 Returns the number of dimensions of the matrix. More...
 
template<size_t DD>
static constexpr size_t dim () noexcept
 Returns the Dth dimension of the matrix. More...
 

Static Public Attributes

static constexpr size_t n_dimensions = sizeof...(Dims)
 The number of dimensions.
 
static constexpr size_t etl_size = (Dims * ...)
 The size of the matrix.
 

Protected Member Functions

void init ()
 Init the container if necessary.
 
template<typename... S>
value_typeaccess (S... args)
 Return the value at the given indices. More...
 
template<typename... S>
const value_typeaccess (S... args) const
 Return the value at the given indices. More...
 

Static Protected Member Functions

template<typename... S>
static constexpr size_t index (S... args)
 Compute the 1D index from the given indices. More...
 

Protected Attributes

storage_impl _data
 The storage container.
 
gpu_memory_handler< T > _gpu
 The GPU memory handler.
 

Constructor & Destructor Documentation

◆ fast_matrix_base() [1/3]

template<typename D, typename T, typename ST, order SO, size_t... Dims>
etl::fast_matrix_base< D, T, ST, SO, Dims >::fast_matrix_base ( storage_impl  data)
inline

Construct a default fast_matrix_base from storage.

Parameters
dataThe storage data

◆ fast_matrix_base() [2/3]

template<typename D, typename T, typename ST, order SO, size_t... Dims>
etl::fast_matrix_base< D, T, ST, SO, Dims >::fast_matrix_base ( const fast_matrix_base< D, T, ST, SO, Dims > &  rhs)
inline

Copy Construct a fast_matrix_base.

Parameters
rhsThe right hand side

◆ fast_matrix_base() [3/3]

template<typename D, typename T, typename ST, order SO, size_t... Dims>
etl::fast_matrix_base< D, T, ST, SO, Dims >::fast_matrix_base ( fast_matrix_base< D, T, ST, SO, Dims > &&  rhs)
inlinenoexcept

Move Construct a fast_matrix_base.

Parameters
rhsThe right hand side

Member Function Documentation

◆ access() [1/2]

template<typename D, typename T, typename ST, order SO, size_t... Dims>
template<typename... S>
value_type& etl::fast_matrix_base< D, T, ST, SO, Dims >::access ( S...  args)
inlineprotected

Return the value at the given indices.

Parameters
argsThe access indices
Returns
The value at the given indices

◆ access() [2/2]

template<typename D, typename T, typename ST, order SO, size_t... Dims>
template<typename... S>
const value_type& etl::fast_matrix_base< D, T, ST, SO, Dims >::access ( S...  args) const
inlineprotected

Return the value at the given indices.

Parameters
argsThe access indices
Returns
The value at the given indices

◆ columns()

template<typename D, typename T, typename ST, order SO, size_t... Dims>
static constexpr size_t etl::fast_matrix_base< D, T, ST, SO, Dims >::columns ( )
inlinestaticnoexcept

Returns the number of columns of the matrix (the second dimension), in O(1)

Returns
The number of columns of the matrix

◆ dim() [1/2]

template<typename D, typename T, typename ST, order SO, size_t... Dims>
template<size_t DD>
static constexpr size_t etl::fast_matrix_base< D, T, ST, SO, Dims >::dim ( )
inlinestaticnoexcept

Returns the Dth dimension of the matrix.

Returns
The Dth dimension of the matrix

◆ dim() [2/2]

template<typename D, typename T, typename ST, order SO, size_t... Dims>
size_t etl::fast_matrix_base< D, T, ST, SO, Dims >::dim ( size_t  d) const
inlinenoexcept

Returns the dth dimension of the matrix.

Parameters
dThe dimension to get
Returns
The Dth dimension of the matrix

◆ dimensions()

template<typename D, typename T, typename ST, order SO, size_t... Dims>
static constexpr size_t etl::fast_matrix_base< D, T, ST, SO, Dims >::dimensions ( )
inlinestaticnoexcept

Returns the number of dimensions of the matrix.

Returns
the number of dimensions of the matrix

◆ index()

template<typename D, typename T, typename ST, order SO, size_t... Dims>
template<typename... S>
static constexpr size_t etl::fast_matrix_base< D, T, ST, SO, Dims >::index ( S...  args)
inlinestaticprotected

Compute the 1D index from the given indices.

Parameters
argsThe access indices
Returns
The 1D index inside the storage container

◆ memory_end() [1/2]

template<typename D, typename T, typename ST, order SO, size_t... Dims>
memory_type etl::fast_matrix_base< D, T, ST, SO, Dims >::memory_end ( )
inlinenoexcept

Returns a pointer to the past-the-end element in memory.

Returns
a pointer tot the past-the-end element in memory.

◆ memory_end() [2/2]

template<typename D, typename T, typename ST, order SO, size_t... Dims>
const_memory_type etl::fast_matrix_base< D, T, ST, SO, Dims >::memory_end ( ) const
inlinenoexcept

Returns a pointer to the past-the-end element in memory.

Returns
a pointer tot the past-the-end element in memory.

◆ memory_start() [1/2]

template<typename D, typename T, typename ST, order SO, size_t... Dims>
memory_type etl::fast_matrix_base< D, T, ST, SO, Dims >::memory_start ( )
inlinenoexcept

Returns a pointer to the first element in memory.

Returns
a pointer tot the first element in memory.

◆ memory_start() [2/2]

template<typename D, typename T, typename ST, order SO, size_t... Dims>
const_memory_type etl::fast_matrix_base< D, T, ST, SO, Dims >::memory_start ( ) const
inlinenoexcept

Returns a pointer to the first element in memory.

Returns
a pointer tot the first element in memory.

◆ operator()() [1/2]

template<typename D, typename T, typename ST, order SO, size_t... Dims>
auto etl::fast_matrix_base< D, T, ST, SO, Dims >::operator() ( size_t  i)
inlinenoexcept

Creates a sub view of the matrix, effectively removing the first dimension and fixing it to the given index.

Parameters
iThe index to use
Returns
a sub view of the matrix at position i.

◆ operator()() [2/2]

template<typename D, typename T, typename ST, order SO, size_t... Dims>
auto etl::fast_matrix_base< D, T, ST, SO, Dims >::operator() ( size_t  i) const
inlinenoexcept

Creates a sub view of the matrix, effectively removing the first dimension and fixing it to the given index.

Parameters
iThe index to use
Returns
a sub view of the matrix at position i.

◆ rows()

template<typename D, typename T, typename ST, order SO, size_t... Dims>
static constexpr size_t etl::fast_matrix_base< D, T, ST, SO, Dims >::rows ( )
inlinestaticnoexcept

Returns the number of rows of the matrix (the first dimension), in O(1)

Returns
The number of rows of the matrix

◆ size()

template<typename D, typename T, typename ST, order SO, size_t... Dims>
static constexpr size_t etl::fast_matrix_base< D, T, ST, SO, Dims >::size ( )
inlinestaticnoexcept

Returns the size of the matrix, in O(1)

Returns
The size of the matrix

◆ slice() [1/2]

template<typename D, typename T, typename ST, order SO, size_t... Dims>
auto etl::fast_matrix_base< D, T, ST, SO, Dims >::slice ( size_t  first,
size_t  last 
)
inlinenoexcept

Creates a slice view of the matrix, effectively reducing the first dimension.

Parameters
firstThe first index to use
lastThe last index to use
Returns
a slice view of the matrix at position i.

◆ slice() [2/2]

template<typename D, typename T, typename ST, order SO, size_t... Dims>
auto etl::fast_matrix_base< D, T, ST, SO, Dims >::slice ( size_t  first,
size_t  last 
) const
inlinenoexcept

Creates a slice view of the matrix, effectively reducing the first dimension.

Parameters
firstThe first index to use
lastThe last index to use
Returns
a slice view of the matrix at position i.

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