Expression Templates Library (ETL)
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
etl::base_temporary_expr< D, Fast > Struct Template Reference

A temporary expression base. More...

#include <base_temporary_expr.hpp>

Inheritance diagram for etl::base_temporary_expr< D, Fast >:
Inheritance graph
[legend]
Collaboration diagram for etl::base_temporary_expr< D, Fast >:
Collaboration graph
[legend]

Public Types

using derived_t = D
 The derived type.
 
using value_type = typename decay_traits< D >::value_type
 The value type.
 
using result_type = temporary_detail::expr_result_t< Fast, D >
 The result type.
 
using memory_type = value_type *
 The memory type.
 
using const_memory_type = const value_type *
 The const memory type.
 
template<typename VV = default_vec>
using vec_type = typename VV::template vec_type< value_type >
 The vectorization type for VV.
 
- Public Types inherited from etl::value_testable< D >
using derived_t = D
 The derived type.
 
- Public Types inherited from etl::dim_testable< D >
using derived_t = D
 The derived type.
 
- Public Types inherited from etl::iterable< const D, true >
using derived_t = const D
 The derived type.
 

Public Member Functions

 base_temporary_expr ()
 Construct a new base_temporary_expr.
 
 base_temporary_expr (const base_temporary_expr &expr)=default
 Copy construct a new base_temporary_expr.
 
 base_temporary_expr (base_temporary_expr &&rhs)
 Move construct a base_temporary_expr The right hand side cannot be used anymore after ths move. More...
 
base_temporary_exproperator= (const base_temporary_expr &)=delete
 
base_temporary_exproperator= (base_temporary_expr &&)=delete
 
value_type operator[] (size_t i) const
 Returns the element at the given index. More...
 
value_type read_flat (size_t i) const
 Returns the value at the given index This function never alters the state of the container. More...
 
- Public Member Functions inherited from etl::value_testable< D >
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...
 
bool is_finite () const noexcept
 Indicates if the expression contains only finite values. More...
 
bool is_zero () const noexcept
 Indicates if the expression contains only zero values. More...
 
bool is_diagonal () const noexcept
 Indicates if the expression is diagonal. More...
 
bool is_uniform () const noexcept
 Indicates if the expression is uniform, i.e. all elements are of the same value. More...
 
- Public Member Functions inherited from etl::dim_testable< D >
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...
 
bool is_square () const noexcept
 Indicates if the expressions is of square dimensions (only for 2d expression) More...
 
bool is_rectangular () const noexcept
 Indicates if the expressions is of rectangular dimensions (only for 2d expression) More...
 
bool is_sub_square () const noexcept
 Indicates if the expressions is of square dimensions, ignoring the first dimension (only for 3d expression) More...
 
bool is_sub_rectangular () const noexcept
 Indicates if the expressions is of rectangular dimensions, ignoring the first dimension (only for 3d expression) More...
 
bool is_symmetric () const noexcept
 Indicates if the given expression is a symmetric matrix or not. More...
 
bool is_lower_triangular () const noexcept
 Indicates if the given expression is a lower triangular matrix or not. More...
 
bool is_uni_lower_triangular () const noexcept
 Indicates if the given expression is a uni lower triangular matrix or not. More...
 
bool is_strictly_lower_triangular () const noexcept
 Indicates if the given expression is a strictly lower triangular matrix or not. More...
 
bool is_upper_triangular () const noexcept
 Indicates if the given expression is a upper triangular matrix or not. More...
 
bool is_uni_upper_triangular () const noexcept
 Indicates if the given expression is a uni upper triangular matrix or not. More...
 
bool is_strictly_upper_triangular () const noexcept
 Indicates if the given expression is a strictly upper triangular matrix or not. More...
 
bool is_triangular () const noexcept
 Indicates if the given expression is a triangular matrix or not. More...
 
- Public Member Functions inherited from etl::iterable< const D, true >
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...
 

Protected Member Functions

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...
 
bool is_allocated () const noexcept
 Indicates if the temporary has been allocated. More...
 
bool is_evaluated () const noexcept
 Indicates if the temporary has been evaluated. More...
 
void evaluate () const
 Evaluate the expression, if not evaluated. More...
 
void allocate_temporary () const
 Allocate the necessary temporaries, if necessary.
 
template<size_t... I>
result_typedyn_allocate (std::index_sequence< I... >) const
 Allocate the dynamic temporary.
 
result_typeallocate () const
 Allocate the temporary.
 

Protected Attributes

std::shared_ptr< bool > evaluated
 Indicates if the expression has been evaluated.
 
std::shared_ptr< result_type_c
 The result reference.
 

Detailed Description

template<typename D, bool Fast>
struct etl::base_temporary_expr< D, Fast >

A temporary expression base.

Template Parameters
DThe derived type

A temporary expression computes the expression directly and stores it into a temporary.

Constructor & Destructor Documentation

◆ base_temporary_expr()

template<typename D, bool Fast>
etl::base_temporary_expr< D, Fast >::base_temporary_expr ( base_temporary_expr< D, Fast > &&  rhs)
inline

Move construct a base_temporary_expr The right hand side cannot be used anymore after ths move.

Parameters
rhsThe expression to move from.

Member Function Documentation

◆ as_derived() [1/2]

template<typename D, bool Fast>
derived_t& etl::base_temporary_expr< D, Fast >::as_derived ( )
inlineprotectednoexcept

Returns a reference to the derived object, i.e. the object using the CRTP injector.

Returns
a reference to the derived object.

◆ as_derived() [2/2]

template<typename D, bool Fast>
const derived_t& etl::base_temporary_expr< D, Fast >::as_derived ( ) const
inlineprotectednoexcept

Returns a reference to the derived object, i.e. the object using the CRTP injector.

Returns
a reference to the derived object.

◆ evaluate()

template<typename D, bool Fast>
void etl::base_temporary_expr< D, Fast >::evaluate ( ) const
inlineprotected

Evaluate the expression, if not evaluated.

Will fail if not previously allocated

◆ is_allocated()

template<typename D, bool Fast>
bool etl::base_temporary_expr< D, Fast >::is_allocated ( ) const
inlineprotectednoexcept

Indicates if the temporary has been allocated.

Returns
true if the temporary has been allocated, false otherwise

◆ is_evaluated()

template<typename D, bool Fast>
bool etl::base_temporary_expr< D, Fast >::is_evaluated ( ) const
inlineprotectednoexcept

Indicates if the temporary has been evaluated.

Returns
true if the temporary has been evaluted, false otherwise

◆ operator[]()

template<typename D, bool Fast>
value_type etl::base_temporary_expr< D, Fast >::operator[] ( size_t  i) const
inline

Returns the element at the given index.

Parameters
iThe index
Returns
a reference to the element at the given index.

◆ read_flat()

template<typename D, bool Fast>
value_type etl::base_temporary_expr< D, Fast >::read_flat ( size_t  i) const
inline

Returns the value at the given index This function never alters the state of the container.

Parameters
iThe index
Returns
the value at the given index.

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