Public Types | List of all members
blaze::DenseIterator< Type, AF > Class Template Reference

Implementation of a generic iterator for dense vectors and matrices.The DenseIterator represents a generic random-access iterator that can be used for dense vectors and specific rows/columns of dense matrices. More...

#include <DenseIterator.h>

Public Types

using IteratorCategory = std::random_access_iterator_tag
 The iterator category.
 
using ValueType = Type
 Type of the underlying elements.
 
using PointerType = Type *
 Pointer return type.
 
using ReferenceType = Type &
 Reference return type.
 
using DifferenceType = ptrdiff_t
 Difference between two iterators.
 
using iterator_category = IteratorCategory
 The iterator category.
 
using value_type = ValueType
 Type of the underlying elements.
 
using pointer = PointerType
 Pointer return type.
 
using reference = ReferenceType
 Reference return type.
 
using difference_type = DifferenceType
 Difference between two iterators.
 
using SIMDType = SIMDTrait_< Type >
 SIMD type of the elements.
 

Public Member Functions

Constructors
 DenseIterator () noexcept
 Default constructor for the DenseIterator class.
 
 DenseIterator (Type *ptr) noexcept
 Constructor for the DenseIterator class. More...
 
template<typename Other , bool AF2>
 DenseIterator (const DenseIterator< Other, AF2 > &it) noexcept
 Conversion constructor from different DenseIterator instances. More...
 
Assignment operators
DenseIteratoroperator+= (ptrdiff_t inc) noexcept
 Addition assignment operator. More...
 
DenseIteratoroperator-= (ptrdiff_t inc) noexcept
 Subtraction assignment operator. More...
 
Increment/decrement operators
DenseIteratoroperator++ () noexcept
 Pre-increment operator. More...
 
const DenseIterator operator++ (int) noexcept
 Post-increment operator. More...
 
DenseIteratoroperator-- () noexcept
 Pre-decrement operator. More...
 
const DenseIterator operator-- (int) noexcept
 Post-decrement operator. More...
 
Access operators
ReferenceType operator[] (size_t index) const noexcept
 Direct access to the underlying elements. More...
 
ReferenceType operator* () const noexcept
 Direct access to the element at the current iterator position. More...
 
PointerType operator-> () const noexcept
 Direct access to the element at the current iterator position. More...
 
Utility functions
PointerType base () const noexcept
 Low-level access to the underlying member of the iterator. More...
 
Expression template evaluation functions
const SIMDType load () const noexcept
 Load of the SIMD element at the current iterator position. More...
 
const SIMDType loada () const noexcept
 Aligned load of the SIMD element at the current iterator position. More...
 
const SIMDType loadu () const noexcept
 Unaligned load of the SIMD element at the current iterator position. More...
 
void store (const SIMDType &value) const noexcept
 Store of the SIMD element at the current iterator position. More...
 
void storea (const SIMDType &value) const noexcept
 Aligned store of the SIMD element at the current iterator position. More...
 
void storeu (const SIMDType &value) const noexcept
 Unaligned store of the SIMD element at the current iterator position. More...
 
void stream (const SIMDType &value) const noexcept
 Aligned, non-temporal store of the SIMD element at the current iterator position. More...
 

Private Attributes

Member variables
PointerType ptr_
 Pointer to the current element.
 

Detailed Description

template<typename Type, bool AF>
class blaze::DenseIterator< Type, AF >

Implementation of a generic iterator for dense vectors and matrices.

The DenseIterator represents a generic random-access iterator that can be used for dense vectors and specific rows/columns of dense matrices.

Constructor & Destructor Documentation

◆ DenseIterator() [1/2]

template<typename Type , bool AF>
blaze::DenseIterator< Type, AF >::DenseIterator ( Type *  ptr)
inlineexplicitnoexcept

Constructor for the DenseIterator class.

Parameters
ptrPointer to the initial element.

◆ DenseIterator() [2/2]

template<typename Type , bool AF>
template<typename Other , bool AF2>
blaze::DenseIterator< Type, AF >::DenseIterator ( const DenseIterator< Other, AF2 > &  it)
inlinenoexcept

Conversion constructor from different DenseIterator instances.

Parameters
itThe foreign DenseIterator instance to be copied.

Member Function Documentation

◆ base()

template<typename Type , bool AF>
DenseIterator< Type, AF >::PointerType blaze::DenseIterator< Type, AF >::base ( ) const
inlinenoexcept

Low-level access to the underlying member of the iterator.

Returns
Pointer to the current memory location.

◆ load()

template<typename Type , bool AF>
const DenseIterator< Type, AF >::SIMDType blaze::DenseIterator< Type, AF >::load ( ) const
inlinenoexcept

Load of the SIMD element at the current iterator position.

Returns
The loaded SIMD element.

This function performs a load of the SIMD element of the current element. This function must NOT be called explicitly! It is used internally for the performance optimized evaluation of expression templates. Calling this function explicitly might result in erroneous results and/or in compilation errors.

◆ loada()

template<typename Type , bool AF>
const DenseIterator< Type, AF >::SIMDType blaze::DenseIterator< Type, AF >::loada ( ) const
inlinenoexcept

Aligned load of the SIMD element at the current iterator position.

Returns
The loaded SIMD element.

This function performs an aligned load of the SIMD element of the current element. This function must NOT be called explicitly! It is used internally for the performance optimized evaluation of expression templates. Calling this function explicitly might result in erroneous results and/or in compilation errors.

◆ loadu()

template<typename Type , bool AF>
const DenseIterator< Type, AF >::SIMDType blaze::DenseIterator< Type, AF >::loadu ( ) const
inlinenoexcept

Unaligned load of the SIMD element at the current iterator position.

Returns
The loaded SIMD element.

This function performs an unaligned load of the SIMD element of the current element. This function must NOT be called explicitly! It is used internally for the performance optimized evaluation of expression templates. Calling this function explicitly might result in erroneous results and/or in compilation errors.

◆ operator*()

template<typename Type , bool AF>
DenseIterator< Type, AF >::ReferenceType blaze::DenseIterator< Type, AF >::operator* ( ) const
inlinenoexcept

Direct access to the element at the current iterator position.

Returns
Reference to the current element.

◆ operator++() [1/2]

template<typename Type , bool AF>
DenseIterator< Type, AF > & blaze::DenseIterator< Type, AF >::operator++ ( )
inlinenoexcept

Pre-increment operator.

Returns
Reference to the incremented iterator.

◆ operator++() [2/2]

template<typename Type , bool AF>
const DenseIterator< Type, AF > blaze::DenseIterator< Type, AF >::operator++ ( int  )
inlinenoexcept

Post-increment operator.

Returns
The previous position of the iterator.

◆ operator+=()

template<typename Type , bool AF>
DenseIterator< Type, AF > & blaze::DenseIterator< Type, AF >::operator+= ( ptrdiff_t  inc)
inlinenoexcept

Addition assignment operator.

Parameters
incThe increment of the iterator.
Returns
Reference to the incremented iterator.

◆ operator--() [1/2]

template<typename Type , bool AF>
DenseIterator< Type, AF > & blaze::DenseIterator< Type, AF >::operator-- ( )
inlinenoexcept

Pre-decrement operator.

Returns
Reference to the decremented iterator.

◆ operator--() [2/2]

template<typename Type , bool AF>
const DenseIterator< Type, AF > blaze::DenseIterator< Type, AF >::operator-- ( int  )
inlinenoexcept

Post-decrement operator.

Returns
The previous position of the iterator.

◆ operator-=()

template<typename Type , bool AF>
DenseIterator< Type, AF > & blaze::DenseIterator< Type, AF >::operator-= ( ptrdiff_t  dec)
inlinenoexcept

Subtraction assignment operator.

Parameters
decThe decrement of the iterator.
Returns
Reference to the decremented iterator.

◆ operator->()

template<typename Type , bool AF>
DenseIterator< Type, AF >::PointerType blaze::DenseIterator< Type, AF >::operator-> ( ) const
inlinenoexcept

Direct access to the element at the current iterator position.

Returns
Pointer to the element at the current iterator position.

◆ operator[]()

template<typename Type , bool AF>
DenseIterator< Type, AF >::ReferenceType blaze::DenseIterator< Type, AF >::operator[] ( size_t  index) const
inlinenoexcept

Direct access to the underlying elements.

Parameters
indexAccess index.
Returns
Reference to the accessed value.

◆ store()

template<typename Type , bool AF>
void blaze::DenseIterator< Type, AF >::store ( const SIMDType value) const
inlinenoexcept

Store of the SIMD element at the current iterator position.

Parameters
valueThe SIMD element to be stored.
Returns
void

This function performs a store of the SIMD element of the current element. This function must NOT be called explicitly! It is used internally for the performance optimized evaluation of expression templates. Calling this function explicitly might result in erroneous results and/or in compilation errors.

◆ storea()

template<typename Type , bool AF>
void blaze::DenseIterator< Type, AF >::storea ( const SIMDType value) const
inlinenoexcept

Aligned store of the SIMD element at the current iterator position.

Parameters
valueThe SIMD element to be stored.
Returns
void

This function performs an aligned store of the SIMD element of the current element. This function must NOT be called explicitly! It is used internally for the performance optimized evaluation of expression templates. Calling this function explicitly might result in erroneous results and/or in compilation errors.

◆ storeu()

template<typename Type , bool AF>
void blaze::DenseIterator< Type, AF >::storeu ( const SIMDType value) const
inlinenoexcept

Unaligned store of the SIMD element at the current iterator position.

Parameters
valueThe SIMD element to be stored.
Returns
void

This function performs an unaligned store of the SIMD element of the current element. This function must NOT be called explicitly! It is used internally for the performance optimized evaluation of expression templates. Calling this function explicitly might result in erroneous results and/or in compilation errors.

◆ stream()

template<typename Type , bool AF>
void blaze::DenseIterator< Type, AF >::stream ( const SIMDType value) const
inlinenoexcept

Aligned, non-temporal store of the SIMD element at the current iterator position.

Parameters
valueThe SIMD element to be stored.
Returns
void

This function performs an aligned, non-temporal store of the SIMD element of the current element. This function must NOT be called explicitly! It is used internally for the performance optimized evaluation of expression templates. Calling this function explicitly might result in erroneous results and/or in compilation errors.


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