Expression Templates Library (ETL)
Public Types | Public Member Functions | Static Public Attributes | List of all members
etl::lower_matrix< Matrix > Struct Template Referencefinal

A lower triangular matrix adapter. More...

#include <lower.hpp>

Inheritance diagram for etl::lower_matrix< Matrix >:
Inheritance graph
[legend]
Collaboration diagram for etl::lower_matrix< Matrix >:
Collaboration graph
[legend]

Public Types

using matrix_t = Matrix
 The adapted matrix type.
 
using expr_t = matrix_t
 The wrapped expression type.
 
using this_type = lower_matrix< Matrix >
 The type of this matrix.
 
using value_type = value_t< matrix_t >
 The value type.
 
using memory_type = value_type *
 The memory type.
 
using const_memory_type = const value_type *
 The const memory type.
 
using iterator = typename matrix_t::const_iterator
 The type of const iterator.
 
using const_iterator = typename matrix_t::const_iterator
 The type of const iterator.
 
using base_type = adapter< Matrix >
 The base type.
 
template<typename V = default_vec>
using vec_type = typename V::template vec_type< value_type >
 The vectorization type for V.
 
- Public Types inherited from etl::adapter< Matrix >
using matrix_t = Matrix
 The adapted matrix type.
 
using expr_t = matrix_t
 The wrapped expression type.
 
using value_type = value_t< matrix_t >
 The value type.
 
using memory_type = value_type *
 The memory type.
 
using const_memory_type = const value_type *
 The const memory type.
 
template<typename V = default_vec>
using vec_type = typename V::template vec_type< value_type >
 The vectorization type for V.
 
- Public Types inherited from etl::iterable< const lower_matrix< Matrix > >
using derived_t = const lower_matrix< Matrix >
 The derived type.
 

Public Member Functions

 lower_matrix () noexcept
 Construct a new lower triangular matrix and fill it with zeros. More...
 
 lower_matrix (value_type value) noexcept
 Construct a new lower triangular matrix and fill it witht the given value. More...
 
 lower_matrix (size_t dim) noexcept
 Construct a new lower triangular matrix and fill it with zeros. More...
 
 lower_matrix (const lower_matrix &rhs)=default
 Construct a lower_matrix by copy. More...
 
lower_matrixoperator= (const lower_matrix &rhs)=default
 Assign to the matrix by copy. More...
 
 lower_matrix (lower_matrix &&rhs) noexcept=default
 Construct a lower_matrix by move. More...
 
lower_matrixoperator= (lower_matrix &&rhs) noexcept=default
 Assign to the matrix by move. More...
 
template<convertible_expr< value_type > E>
lower_matrixoperator= (E &&e) noexcept(false)
 Assign the values of the ETL expression to the lower triangular matrix. More...
 
template<etl_expr R>
lower_matrixoperator+= (const R &rhs)
 Multiply each element by the value of the elements in the right hand side expression. More...
 
template<etl_expr R>
lower_matrixoperator-= (const R &rhs)
 Multiply each element by the value of the elements in the right hand side expression. More...
 
lower_matrixoperator*= (const value_type &rhs) noexcept
 Multiply each element by the right hand side scalar. More...
 
template<etl_expr R>
lower_matrixoperator*= (const R &rhs)
 Multiply each element by the value of the elements in the right hand side expression. More...
 
lower_matrixoperator>>= (const value_type &rhs) noexcept
 Multiply each element by the right hand side scalar. More...
 
template<etl_expr R>
lower_matrixoperator>>= (const R &rhs)
 Multiply each element by the value of the elements in the right hand side expression. More...
 
lower_matrixoperator/= (const value_type &rhs) noexcept
 Divide each element by the right hand side scalar. More...
 
template<etl_expr R>
lower_matrixoperator/= (const R &rhs)
 Modulo each element by the value of the elements in the right hand side expression. More...
 
lower_matrixoperator%= (const value_type &rhs) noexcept
 Modulo each element by the right hand side scalar. More...
 
template<etl_expr R>
lower_matrixoperator%= (const R &rhs)
 Modulo each element by the value of the elements in the right hand side expression. More...
 
lower_detail::lower_reference< matrix_toperator() (size_t i, size_t j) noexcept
 Access the (i, j) element of the 2D matrix. More...
 
- Public Member Functions inherited from etl::adapter< Matrix >
 adapter () noexcept
 Construct a new matrix and fill it with zeros. More...
 
 adapter (value_type value) noexcept
 Construct a new adapter matrix and fill it witht the given value. More...
 
 adapter (size_t dim) noexcept
 Construct a new adapter matrix and fill it with zeros. More...
 
 adapter (size_t dim, value_type value) noexcept
 Construct a new adapter matrix and fill it witht the given value. More...
 
 adapter (const adapter &rhs)=default
 Construct a adapter by copy. More...
 
adapteroperator= (const adapter &rhs)=default
 Assign to the matrix by copy. More...
 
 adapter (adapter &&rhs) noexcept=default
 Construct a adapter by move. More...
 
adapteroperator= (adapter &&rhs) noexcept=default
 Assign to the matrix by move. More...
 
const value_typeoperator() (size_t i, size_t j) const noexcept
 Access the (i, j) element of the 2D matrix. More...
 
const value_typeoperator[] (size_t i) const noexcept
 Returns the element at the given index. More...
 
value_typeoperator[] (size_t i) noexcept
 Returns the element at the given index. More...
 
value_type read_flat (size_t i) const noexcept
 
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...
 
template<typename V = default_vec>
vec_type< V > load (size_t i) const noexcept
 Load several elements of the matrix at once. More...
 
template<typename V = default_vec>
vec_type< V > loadu (size_t i) const noexcept
 Load several elements of the matrix at once. More...
 
template<typename V = default_vec>
void stream (vec_type< V > in, size_t i) noexcept
 Store several elements in the matrix at once, using non-temporal stores. More...
 
template<typename V = default_vec>
void store (vec_type< V > in, size_t i) noexcept
 Store several elements in the matrix at once. More...
 
template<typename V = default_vec>
void storeu (vec_type< V > in, size_t i) noexcept
 Store several elements in the matrix at once. More...
 
template<typename E >
bool alias (const E &rhs) const noexcept
 Test if this expression aliases with the given expression. More...
 
template<typename Y >
auto & gpu_compute_hint ([[maybe_unused]] Y &y)
 Return a GPU computed version of this expression. More...
 
template<typename Y >
const auto & gpu_compute_hint ([[maybe_unused]] Y &y) const
 Return a GPU computed version of this expression. More...
 
template<typename L >
void assign_to (L &&lhs) const
 Assign to the given left-hand-side expression. More...
 
template<typename L >
void assign_add_to (L &&lhs) const
 Add to the given left-hand-side expression. More...
 
template<typename L >
void assign_sub_to (L &&lhs) const
 Sub from the given left-hand-side expression. More...
 
template<typename L >
void assign_mul_to (L &&lhs) const
 Multiply the given left-hand-side expression. More...
 
template<typename L >
void assign_div_to (L &&lhs) const
 Divide the given left-hand-side expression. More...
 
template<typename L >
void assign_mod_to (L &&lhs) const
 Modulo the given left-hand-side expression. More...
 
void visit ([[maybe_unused]] const detail::evaluator_visitor &visitor) const
 Apply the given visitor to this expression and its descendants. More...
 
value_typegpu_memory () const noexcept
 Return GPU memory of this expression, if any. More...
 
void gpu_evict () const noexcept
 Evict the expression from GPU.
 
void invalidate_cpu () const noexcept
 Invalidates the CPU memory.
 
void invalidate_gpu () const noexcept
 Invalidates the GPU memory.
 
void validate_cpu () const noexcept
 Validates the CPU memory.
 
void validate_gpu () const noexcept
 Validates the GPU memory.
 
void ensure_gpu_allocated () const
 Ensures that the GPU memory is allocated and that the GPU memory is up to date (to undefined value).
 
void ensure_gpu_up_to_date () const
 Allocate memory on the GPU for the expression and copy the values into the GPU.
 
void ensure_cpu_up_to_date () const
 Copy back from the GPU to the expression memory if necessary.
 
void gpu_copy_from (const value_type *gpu_memory) const
 Copy from GPU to GPU. More...
 
bool is_cpu_up_to_date () const noexcept
 Indicates if the CPU memory is up to date. More...
 
bool is_gpu_up_to_date () const noexcept
 Indicates if the GPU memory is up to date. More...
 
- Public Member Functions inherited from etl::iterable< const lower_matrix< Matrix > >
derived_tas_derived () noexcept
 Returns a reference to the derived object, i.e. the object using the CRTP injector. More...
 
const derived_tas_derived () const noexcept
 Returns a reference to the derived object, i.e. the object using the CRTP injector. More...
 
auto begin () noexcept
 Return an iterator to the first element of the matrix. More...
 
auto begin () const noexcept
 Return an iterator to the first element of the matrix. More...
 
auto end () noexcept
 Return an iterator to the past-the-end element of the matrix. More...
 
auto end () const noexcept
 Return an iterator to the past-the-end element of the matrix. More...
 
auto cbegin () const noexcept
 Return an iterator to the first element of the matrix. More...
 
auto cend () const noexcept
 Return an iterator to the past-the-end element of the matrix. More...
 

Static Public Attributes

static constexpr size_t n_dimensions = etl_traits<matrix_t>::dimensions()
 The number of dimensions.
 
static constexpr order storage_order = etl_traits<matrix_t>::storage_order
 The storage order.
 
static constexpr size_t alignment = matrix_t::alignment
 The memory alignment.
 

Additional Inherited Members

- Static Public Member Functions inherited from etl::adapter< Matrix >
static constexpr size_t dimensions () noexcept
 Returns the number of dimensions of the matrix. More...
 
- Protected Attributes inherited from etl::adapter< Matrix >
matrix_t value
 The adapted matrix.
 

Detailed Description

template<adaptable Matrix>
struct etl::lower_matrix< Matrix >

A lower triangular matrix adapter.

This is only a prototype.

Constructor & Destructor Documentation

◆ lower_matrix() [1/5]

template<adaptable Matrix>
etl::lower_matrix< Matrix >::lower_matrix ( )
inlinenoexcept

Construct a new lower triangular matrix and fill it with zeros.

This constructor can only be used when the matrix is fast

◆ lower_matrix() [2/5]

template<adaptable Matrix>
etl::lower_matrix< Matrix >::lower_matrix ( value_type  value)
inlineexplicitnoexcept

Construct a new lower triangular matrix and fill it witht the given value.

Parameters
valueThe value to fill the matrix with

This constructor can only be used when the matrix is fast

◆ lower_matrix() [3/5]

template<adaptable Matrix>
etl::lower_matrix< Matrix >::lower_matrix ( size_t  dim)
inlineexplicitnoexcept

Construct a new lower triangular matrix and fill it with zeros.

Parameters
dimThe dimension of the matrix

◆ lower_matrix() [4/5]

template<adaptable Matrix>
etl::lower_matrix< Matrix >::lower_matrix ( const lower_matrix< Matrix > &  rhs)
default

Construct a lower_matrix by copy.

Parameters
rhsThe right-hand-side matrix

◆ lower_matrix() [5/5]

template<adaptable Matrix>
etl::lower_matrix< Matrix >::lower_matrix ( lower_matrix< Matrix > &&  rhs)
defaultnoexcept

Construct a lower_matrix by move.

Parameters
rhsThe right-hand-side matrix

Member Function Documentation

◆ operator%=() [1/2]

template<adaptable Matrix>
lower_matrix& etl::lower_matrix< Matrix >::operator%= ( const value_type rhs)
inlinenoexcept

Modulo each element by the right hand side scalar.

Parameters
rhsThe right hand side scalar
Returns
a reference to the matrix

◆ operator%=() [2/2]

template<adaptable Matrix>
template<etl_expr R>
lower_matrix& etl::lower_matrix< Matrix >::operator%= ( const R &  rhs)
inline

Modulo each element by the value of the elements in the right hand side expression.

Parameters
rhsThe right hand side
Returns
a reference to the matrix

◆ operator()()

template<adaptable Matrix>
lower_detail::lower_reference<matrix_t> etl::lower_matrix< Matrix >::operator() ( size_t  i,
size_t  j 
)
inlinenoexcept

Access the (i, j) element of the 2D matrix.

Parameters
iThe index of the first dimension
jThe index of the second dimension
Returns
a reference to the (i,j) element

Accessing an element outside the matrix results in Undefined Behaviour.

◆ operator*=() [1/2]

template<adaptable Matrix>
lower_matrix& etl::lower_matrix< Matrix >::operator*= ( const value_type rhs)
inlinenoexcept

Multiply each element by the right hand side scalar.

Parameters
rhsThe right hand side scalar
Returns
a reference to the matrix

◆ operator*=() [2/2]

template<adaptable Matrix>
template<etl_expr R>
lower_matrix& etl::lower_matrix< Matrix >::operator*= ( const R &  rhs)
inline

Multiply each element by the value of the elements in the right hand side expression.

Parameters
rhsThe right hand side
Returns
a reference to the matrix

◆ operator+=()

template<adaptable Matrix>
template<etl_expr R>
lower_matrix& etl::lower_matrix< Matrix >::operator+= ( const R &  rhs)
inline

Multiply each element by the value of the elements in the right hand side expression.

Parameters
rhsThe right hand side
Returns
a reference to the matrix

◆ operator-=()

template<adaptable Matrix>
template<etl_expr R>
lower_matrix& etl::lower_matrix< Matrix >::operator-= ( const R &  rhs)
inline

Multiply each element by the value of the elements in the right hand side expression.

Parameters
rhsThe right hand side
Returns
a reference to the matrix

◆ operator/=() [1/2]

template<adaptable Matrix>
lower_matrix& etl::lower_matrix< Matrix >::operator/= ( const value_type rhs)
inlinenoexcept

Divide each element by the right hand side scalar.

Parameters
rhsThe right hand side scalar
Returns
a reference to the matrix

◆ operator/=() [2/2]

template<adaptable Matrix>
template<etl_expr R>
lower_matrix& etl::lower_matrix< Matrix >::operator/= ( const R &  rhs)
inline

Modulo each element by the value of the elements in the right hand side expression.

Parameters
rhsThe right hand side
Returns
a reference to the matrix

◆ operator=() [1/3]

template<adaptable Matrix>
lower_matrix& etl::lower_matrix< Matrix >::operator= ( const lower_matrix< Matrix > &  rhs)
default

Assign to the matrix by copy.

Parameters
rhsThe right-hand-side matrix
Returns
a reference to the assigned matrix

◆ operator=() [2/3]

template<adaptable Matrix>
lower_matrix& etl::lower_matrix< Matrix >::operator= ( lower_matrix< Matrix > &&  rhs)
defaultnoexcept

Assign to the matrix by move.

Parameters
rhsThe right-hand-side matrix
Returns
a reference to the assigned matrix

◆ operator=() [3/3]

template<adaptable Matrix>
template<convertible_expr< value_type > E>
lower_matrix& etl::lower_matrix< Matrix >::operator= ( E &&  e)
inlinenoexcept

Assign the values of the ETL expression to the lower triangular matrix.

Parameters
eThe ETL expression to get the values from
Returns
a reference to the fast matrix

◆ operator>>=() [1/2]

template<adaptable Matrix>
lower_matrix& etl::lower_matrix< Matrix >::operator>>= ( const value_type rhs)
inlinenoexcept

Multiply each element by the right hand side scalar.

Parameters
rhsThe right hand side scalar
Returns
a reference to the matrix

◆ operator>>=() [2/2]

template<adaptable Matrix>
template<etl_expr R>
lower_matrix& etl::lower_matrix< Matrix >::operator>>= ( const R &  rhs)
inline

Multiply each element by the value of the elements in the right hand side expression.

Parameters
rhsThe right hand side
Returns
a reference to the matrix

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