Expression Templates Library (ETL)
Public Types | Public Member Functions | Public Attributes | Friends | List of all members
etl::sub_matrix_3d< T, Aligned > Struct Template Reference

View that shows a 3d sub matrix of an expression. More...

#include <sub_matrix_3d.hpp>

Inheritance diagram for etl::sub_matrix_3d< T, Aligned >:
Inheritance graph
[legend]
Collaboration diagram for etl::sub_matrix_3d< T, Aligned >:
Collaboration graph
[legend]

Public Types

using this_type = sub_matrix_3d< T, Aligned >
 The type of this expression.
 
using iterable_base_type = iterable< this_type, false >
 The iterable base type.
 
using assignable_base_type = assignable< this_type, value_t< T > >
 The iterable base type.
 
using sub_type = T
 The sub type.
 
using value_type = value_t< sub_type >
 The value contained in the expression.
 
using memory_type = memory_t< sub_type >
 The memory acess type.
 
using const_memory_type = const_memory_t< sub_type >
 The const memory access type.
 
using return_type = return_helper< sub_type, decltype(std::declval< sub_type >()[0])>
 The type returned by the view.
 
using const_return_type = const_return_helper< sub_type, decltype(std::declval< sub_type >()[0])>
 The const type return by the view.
 
using iterator = etl::iterator< this_type >
 The iterator type.
 
using const_iterator = etl::iterator< const this_type >
 The const iterator 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< sub_matrix_3d< T, Aligned >, false >
using derived_t = sub_matrix_3d< T, Aligned >
 The derived type.
 
- Public Types inherited from etl::assignable< sub_matrix_3d< T, Aligned >, value_t< T > >
using derived_t = sub_matrix_3d< T, Aligned >
 The derived type.
 
using value_type = value_t< T >
 The value type.
 
- Public Types inherited from etl::value_testable< sub_matrix_3d< T, Aligned > >
using derived_t = sub_matrix_3d< T, Aligned >
 The derived type.
 
- Public Types inherited from etl::inplace_assignable< sub_matrix_3d< T, Aligned > >
using derived_t = sub_matrix_3d< T, Aligned >
 The derived type.
 

Public Member Functions

 sub_matrix_3d (sub_type sub_expr, size_t i, size_t j, size_t k, size_t m, size_t n, size_t o)
 Construct a new sub_matrix_3d over the given sub expression. More...
 
const_return_type operator[] (size_t f) const
 Returns the element at the given index. More...
 
return_type operator[] (size_t f)
 Returns the element at the given index. More...
 
value_type read_flat (size_t f) const noexcept(assert_nothrow)
 Returns the value at the given index This function never has side effects. More...
 
 ETL_STRONG_INLINE (const_return_type) operator()(size_t i
 Access to the element at the given (args...) position. More...
 
 cpp_assert (j< n, "Invalid 3d index inside sub_matrix_3d")
 
 cpp_assert (k< o, "Invalid 3d index inside sub_matrix_3d")
 
return sub_expr (base_i+i, base_j+j, base_k+k)
 
 ETL_STRONG_INLINE (return_type) operator()(size_t i
 Access to the element at the given (args...) position. More...
 
 cpp_assert (j< n, "Invalid 3d index inside sub_matrix_3d")
 
 cpp_assert (k< o, "Invalid 3d index inside sub_matrix_3d")
 
return sub_expr (base_i+i, base_j+j, base_k+k)
 
auto operator() (size_t x) const
 Creates a sub view of the matrix, effectively removing the first dimension and fixing it to the given index. More...
 
template<typename E >
bool alias (const E &rhs) const noexcept
 Test if this expression aliases with the given expression. More...
 
size_t & unsafe_dimension_access (size_t x)
 Returns a reference to the ith dimension value. 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 ensure_cpu_up_to_date () 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
 Copy back from the GPU to the expression memory if necessary.
 
void visit (detail::evaluator_visitor &visitor) const
 Apply the given visitor to this expression and its descendants. More...
 
- Public Member Functions inherited from etl::iterable< sub_matrix_3d< T, Aligned >, false >
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...
 
- Public Member Functions inherited from etl::assignable< sub_matrix_3d< T, Aligned >, value_t< T > >
derived_toperator= (E &&e)
 Assign the given expression to the unary expression. More...
 
derived_toperator= (const value_type &v)
 Assign the given expression to the unary expression. More...
 
derived_toperator= (const Container &vec) requires(std
 Assign the given container to the unary expression. More...
 
- Public Member Functions inherited from etl::value_testable< sub_matrix_3d< T, Aligned > >
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::inplace_assignable< sub_matrix_3d< T, Aligned > >
derived_tas_derived () noexcept
 Returns a reference to the derived object, i.e. the object using the CRTP injector. More...
 
derived_tscale_inplace (E &&e)
 Scale the matrix by the factor e, in place. More...
 
derived_tfflip_inplace () requires(mat_or_vec< derived_t >)
 Flip the matrix horizontally and vertically, in place.
 
derived_tdeep_fflip_inplace ()
 Fully flip each sub 2D matrix in place.
 
derived_tdeep_transpose_inplace ()
 Transpose each sub 2D matrix in place.
 
derived_tdirect_deep_transpose_inplace ()
 Transpose each sub 2D matrix in place.
 
derived_ttranspose_inplace () requires(etl_2d< derived_t >)
 Transpose the matrix in place. More...
 
derived_tdirect_transpose_inplace () requires(etl_2d< derived_t >)
 Transpose the matrix in place. More...
 
derived_tfft_inplace () requires(etl_1d< derived_t > &&etl_complex_expr< derived_t >)
 Perform inplace 1D FFT of the vector.
 
derived_tfft_many_inplace () requires(matrix< derived_t > &&etl_complex_expr< derived_t >)
 Perform many inplace 1D FFT of the matrix. More...
 
derived_tifft_inplace () requires(etl_1d< derived_t > &&etl_complex_expr< derived_t >)
 Perform inplace 1D Inverse FFT of the vector.
 
derived_tifft_many_inplace () requires(matrix< derived_t > &&etl_complex_expr< derived_t >)
 Perform many inplace 1D Inverse FFT of the vector.
 
derived_tfft2_inplace () requires(etl_2d< derived_t > &&etl_complex_expr< derived_t >)
 Perform inplace 2D FFT of the matrix.
 
derived_tfft2_many_inplace () requires(deep_mat< derived_t > &&etl_complex_expr< derived_t >)
 Perform many inplace 2D FFT of the matrix. More...
 
derived_tifft2_inplace () requires(etl_2d< derived_t > &&etl_complex_expr< derived_t >)
 Perform inplace 2D Inverse FFT of the matrix.
 
derived_tifft2_many_inplace () requires(deep_mat< derived_t > &&etl_complex_expr< derived_t >)
 Perform many inplace 2D Inverse FFT of the matrix.
 

Public Attributes

size_t j
 
size_t size_t k const
 
size_t size_t k
 

Friends

struct etl_traits< sub_matrix_3d >
 
std::ostream & operator<< (std::ostream &os, const sub_matrix_3d &v)
 Print a representation of the view on the given stream. More...
 

Detailed Description

template<etl_expr T, bool Aligned>
struct etl::sub_matrix_3d< T, Aligned >

View that shows a 3d sub matrix of an expression.

Template Parameters
TThe type of expression on which the view is made

Constructor & Destructor Documentation

◆ sub_matrix_3d()

template<etl_expr T, bool Aligned>
etl::sub_matrix_3d< T, Aligned >::sub_matrix_3d ( sub_type  sub_expr,
size_t  i,
size_t  j,
size_t  k,
size_t  m,
size_t  n,
size_t  o 
)
inline

Construct a new sub_matrix_3d over the given sub expression.

Parameters
sub_exprThe sub expression
iThe sub index

Member Function Documentation

◆ alias()

template<etl_expr T, bool Aligned>
template<typename E >
bool etl::sub_matrix_3d< T, Aligned >::alias ( const E &  rhs) const
inlinenoexcept

Test if this expression aliases with the given expression.

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

◆ assign_add_to()

template<etl_expr T, bool Aligned>
template<typename L >
void etl::sub_matrix_3d< T, Aligned >::assign_add_to ( L &&  lhs) const
inline

Add to the given left-hand-side expression.

Parameters
lhsThe expression to which assign

◆ assign_div_to()

template<etl_expr T, bool Aligned>
template<typename L >
void etl::sub_matrix_3d< T, Aligned >::assign_div_to ( L &&  lhs) const
inline

Divide the given left-hand-side expression.

Parameters
lhsThe expression to which assign

◆ assign_mod_to()

template<etl_expr T, bool Aligned>
template<typename L >
void etl::sub_matrix_3d< T, Aligned >::assign_mod_to ( L &&  lhs) const
inline

Modulo the given left-hand-side expression.

Parameters
lhsThe expression to which assign

◆ assign_mul_to()

template<etl_expr T, bool Aligned>
template<typename L >
void etl::sub_matrix_3d< T, Aligned >::assign_mul_to ( L &&  lhs) const
inline

Multiply the given left-hand-side expression.

Parameters
lhsThe expression to which assign

◆ assign_sub_to()

template<etl_expr T, bool Aligned>
template<typename L >
void etl::sub_matrix_3d< T, Aligned >::assign_sub_to ( L &&  lhs) const
inline

Sub from the given left-hand-side expression.

Parameters
lhsThe expression to which assign

◆ assign_to()

template<etl_expr T, bool Aligned>
template<typename L >
void etl::sub_matrix_3d< T, Aligned >::assign_to ( L &&  lhs) const
inline

Assign to the given left-hand-side expression.

Parameters
lhsThe expression to which assign

◆ ETL_STRONG_INLINE() [1/2]

template<etl_expr T, bool Aligned>
etl::sub_matrix_3d< T, Aligned >::ETL_STRONG_INLINE ( const_return_type  )

Access to the element at the given (args...) position.

Parameters
iThe first index
jThe second index
Returns
a reference to the element at the given position.

◆ ETL_STRONG_INLINE() [2/2]

template<etl_expr T, bool Aligned>
etl::sub_matrix_3d< T, Aligned >::ETL_STRONG_INLINE ( return_type  )

Access to the element at the given (args...) position.

Parameters
iThe first index
jThe second index
Returns
a reference to the element at the given position.

◆ operator()()

template<etl_expr T, bool Aligned>
auto etl::sub_matrix_3d< T, Aligned >::operator() ( size_t  x) const
inline

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

Parameters
xThe index to use
Returns
a sub view of the matrix at position x.

◆ operator[]() [1/2]

template<etl_expr T, bool Aligned>
const_return_type etl::sub_matrix_3d< T, Aligned >::operator[] ( size_t  f) const
inline

Returns the element at the given index.

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

◆ operator[]() [2/2]

template<etl_expr T, bool Aligned>
return_type etl::sub_matrix_3d< T, Aligned >::operator[] ( size_t  f)
inline

Returns the element at the given index.

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

◆ read_flat()

template<etl_expr T, bool Aligned>
value_type etl::sub_matrix_3d< T, Aligned >::read_flat ( size_t  f) const
inlinenoexcept

Returns the value at the given index This function never has side effects.

Parameters
fThe index
Returns
the value at the given index.

◆ unsafe_dimension_access()

template<etl_expr T, bool Aligned>
size_t& etl::sub_matrix_3d< T, Aligned >::unsafe_dimension_access ( size_t  x)
inline

Returns a reference to the ith dimension value.

This should only be used internally and with care

Returns
a refernece to the ith dimension value.

◆ visit()

template<etl_expr T, bool Aligned>
void etl::sub_matrix_3d< T, Aligned >::visit ( detail::evaluator_visitor visitor) const
inline

Apply the given visitor to this expression and its descendants.

Parameters
visitorThe visitor to apply

Friends And Related Function Documentation

◆ operator<<

template<etl_expr T, bool Aligned>
std::ostream& operator<< ( std::ostream &  os,
const sub_matrix_3d< T, Aligned > &  v 
)
friend

Print a representation of the view on the given stream.

Parameters
osThe output stream
vThe view to print
Returns
the output stream

Member Data Documentation

◆ const

template<etl_expr T, bool Aligned>
size_t size_t k etl::sub_matrix_3d< T, Aligned >::const
Initial value:
{
cpp_assert(i < m, "Invalid 3d index inside sub_matrix_3d")

◆ k

template<etl_expr T, bool Aligned>
size_t size_t etl::sub_matrix_3d< T, Aligned >::k
Initial value:
{
cpp_assert(i < m, "Invalid 3d index inside sub_matrix_3d")

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