Expression Templates Library (ETL)
Public Types | Public Member Functions | Friends | List of all members
etl::binary_expr< T, LeftExpr, BinaryOp, RightExpr > Struct Template Referencefinal

A binary expression. More...

#include <binary_expr.hpp>

Inheritance diagram for etl::binary_expr< T, LeftExpr, BinaryOp, RightExpr >:
Inheritance graph
[legend]
Collaboration diagram for etl::binary_expr< T, LeftExpr, BinaryOp, RightExpr >:
Collaboration graph
[legend]

Public Types

using value_type = T
 The Value type.
 
using memory_type = void
 The memory type.
 
using const_memory_type = void
 The const memory type.
 
using iterator = etl::iterator< const this_type >
 The iterator type.
 
using const_iterator = etl::iterator< const this_type >
 The const iterator type.
 
using operator_type = BinaryOp
 The binary operator type.
 
using left_type = std::decay_t< LeftExpr >
 The LHS side type.
 
using right_type = std::decay_t< RightExpr >
 The RHS side type.
 
template<typename V = default_vec>
using vec_type = typename V::template vec_type< T >
 The vectorization type for V.
 
- Public Types inherited from etl::dim_testable< binary_expr< T, LeftExpr, BinaryOp, RightExpr > >
using derived_t = binary_expr< T, LeftExpr, BinaryOp, RightExpr >
 The derived type.
 
- Public Types inherited from etl::value_testable< binary_expr< T, LeftExpr, BinaryOp, RightExpr > >
using derived_t = binary_expr< T, LeftExpr, BinaryOp, RightExpr >
 The derived type.
 
- Public Types inherited from etl::iterable< binary_expr< T, LeftExpr, BinaryOp, RightExpr > >
using derived_t = binary_expr< T, LeftExpr, BinaryOp, RightExpr >
 The derived type.
 

Public Member Functions

 binary_expr (LeftExpr l, RightExpr r)
 Construct a new binary expression. More...
 
 binary_expr (const binary_expr &e)=default
 Copy construct a new binary expression. More...
 
 binary_expr (binary_expr &&e) noexcept=default
 Move construct a new binary expression. More...
 
binary_exproperator= (const binary_expr &e)=delete
 
binary_exproperator= (binary_expr &&e)=delete
 
template<typename E >
bool alias (const E &other) const noexcept
 Test if this expression aliases with the given expression. More...
 
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...
 
template<typename V = default_vec>
 load (size_t i) const
 Perform several operations at once. More...
 
template<typename V = default_vec>
 loadu (size_t i) const
 Perform several operations at once. More...
 
- Public Member Functions inherited from etl::dim_testable< binary_expr< T, LeftExpr, BinaryOp, RightExpr > >
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::value_testable< binary_expr< T, LeftExpr, BinaryOp, RightExpr > >
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::iterable< binary_expr< T, LeftExpr, BinaryOp, RightExpr > >
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...
 

Friends

struct etl_traits< binary_expr >
 
struct optimizer< binary_expr >
 
struct optimizable< binary_expr >
 
struct transformer< binary_expr >
 

Detailed Description

template<typename T, expr_or_scalar< T > LeftExpr, typename BinaryOp, expr_or_scalar< T > RightExpr>
struct etl::binary_expr< T, LeftExpr, BinaryOp, RightExpr >

A binary expression.

A binary expression has a left hand side expression and a right hand side expression and for each element applies a binary opeartor to both expressions.

Constructor & Destructor Documentation

◆ binary_expr() [1/3]

template<typename T, expr_or_scalar< T > LeftExpr, typename BinaryOp, expr_or_scalar< T > RightExpr>
etl::binary_expr< T, LeftExpr, BinaryOp, RightExpr >::binary_expr ( LeftExpr  l,
RightExpr  r 
)
inline

Construct a new binary expression.

Parameters
lThe left hand side of the expression
rThe right hand side of the expression

◆ binary_expr() [2/3]

template<typename T, expr_or_scalar< T > LeftExpr, typename BinaryOp, expr_or_scalar< T > RightExpr>
etl::binary_expr< T, LeftExpr, BinaryOp, RightExpr >::binary_expr ( const binary_expr< T, LeftExpr, BinaryOp, RightExpr > &  e)
default

Copy construct a new binary expression.

Parameters
eThe expression from which to copy

◆ binary_expr() [3/3]

template<typename T, expr_or_scalar< T > LeftExpr, typename BinaryOp, expr_or_scalar< T > RightExpr>
etl::binary_expr< T, LeftExpr, BinaryOp, RightExpr >::binary_expr ( binary_expr< T, LeftExpr, BinaryOp, RightExpr > &&  e)
defaultnoexcept

Move construct a new binary expression.

Parameters
eThe expression from which to move

Member Function Documentation

◆ alias()

template<typename T, expr_or_scalar< T > LeftExpr, typename BinaryOp, expr_or_scalar< T > RightExpr>
template<typename E >
bool etl::binary_expr< T, LeftExpr, BinaryOp, RightExpr >::alias ( const E &  other) const
inlinenoexcept

Test if this expression aliases with the given expression.

Parameters
otherThe other expression to test
Returns
true if the two expressions aliases, false otherwise

◆ load()

template<typename T, expr_or_scalar< T > LeftExpr, typename BinaryOp, expr_or_scalar< T > RightExpr>
template<typename V = default_vec>
etl::binary_expr< T, LeftExpr, BinaryOp, RightExpr >::load ( size_t  i) const
inline

Perform several operations at once.

Parameters
iThe index at which to perform the operation
Template Parameters
VThe vectorization mode to use
Returns
a vector containing several results of the expression

◆ loadu()

template<typename T, expr_or_scalar< T > LeftExpr, typename BinaryOp, expr_or_scalar< T > RightExpr>
template<typename V = default_vec>
etl::binary_expr< T, LeftExpr, BinaryOp, RightExpr >::loadu ( size_t  i) const
inline

Perform several operations at once.

Parameters
iThe index at which to perform the operation
Template Parameters
VThe vectorization mode to use
Returns
a vector containing several results of the expression

◆ operator[]()

template<typename T, expr_or_scalar< T > LeftExpr, typename BinaryOp, expr_or_scalar< T > RightExpr>
value_type etl::binary_expr< T, LeftExpr, BinaryOp, RightExpr >::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 T, expr_or_scalar< T > LeftExpr, typename BinaryOp, expr_or_scalar< T > RightExpr>
value_type etl::binary_expr< T, LeftExpr, BinaryOp, RightExpr >::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: