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

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

#include <UniformIterator.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_t< Type >
 SIMD type of the elements.
 

Public Member Functions

Constructors
constexpr UniformIterator () noexcept
 Default constructor for the UniformIterator class.
 
constexpr UniformIterator (Type *ptr, size_t index) noexcept
 Constructor for the UniformIterator class. More...
 
template<typename Other , bool AF2>
constexpr UniformIterator (const UniformIterator< Other, AF2 > &it) noexcept
 Conversion constructor from different UniformIterator instances. More...
 
 UniformIterator (const UniformIterator &)=default
 
Destructor
 ~UniformIterator ()=default
 
Assignment operators
constexpr UniformIteratoroperator+= (ptrdiff_t inc) noexcept
 Addition assignment operator. More...
 
constexpr UniformIteratoroperator-= (ptrdiff_t inc) noexcept
 Subtraction assignment operator. More...
 
UniformIteratoroperator= (const UniformIterator &)=default
 
Increment/decrement operators
constexpr UniformIteratoroperator++ () noexcept
 Pre-increment operator. More...
 
constexpr const UniformIterator operator++ (int) noexcept
 Post-increment operator. More...
 
constexpr UniformIteratoroperator-- () noexcept
 Pre-decrement operator. More...
 
constexpr const UniformIterator operator-- (int) noexcept
 Post-decrement operator. More...
 
Access operators
constexpr ReferenceType operator[] (size_t index) const noexcept
 Direct access to the underlying elements. More...
 
constexpr ReferenceType operator* () const noexcept
 Direct access to the element at the current iterator position. More...
 
constexpr PointerType operator-> () const noexcept
 Direct access to the element at the current iterator position. More...
 
Utility functions
constexpr PointerType ptr () const noexcept
 Low-level access to the current memory location of the iterator. More...
 
constexpr size_t idx () const noexcept
 Low-level access to the underlying index 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...
 

Private Attributes

Member variables
PointerType ptr_
 Pointer to the element.
 
size_t index_
 Index of the current element.
 

Detailed Description

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

Implementation of a generic iterator for uniform vectors and matrices.

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

Constructor & Destructor Documentation

◆ UniformIterator() [1/2]

template<typename Type , bool AF>
constexpr blaze::UniformIterator< Type, AF >::UniformIterator ( Type *  ptr,
size_t  index 
)
inlineexplicitnoexcept

Constructor for the UniformIterator class.

Parameters
ptrPointer to the element.
indexThe index of the initial element.

◆ UniformIterator() [2/2]

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

Conversion constructor from different UniformIterator instances.

Parameters
itThe foreign UniformIterator instance to be copied.

Member Function Documentation

◆ idx()

template<typename Type , bool AF>
constexpr size_t blaze::UniformIterator< Type, AF >::idx ( ) const
inlinenoexcept

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

Returns
Index to the current element.

◆ load()

template<typename Type , bool AF>
const UniformIterator< Type, AF >::SIMDType blaze::UniformIterator< 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 UniformIterator< Type, AF >::SIMDType blaze::UniformIterator< 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 UniformIterator< Type, AF >::SIMDType blaze::UniformIterator< 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>
constexpr UniformIterator< Type, AF >::ReferenceType blaze::UniformIterator< 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>
constexpr UniformIterator< Type, AF > & blaze::UniformIterator< Type, AF >::operator++ ( )
inlinenoexcept

Pre-increment operator.

Returns
Reference to the incremented iterator.

◆ operator++() [2/2]

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

Post-increment operator.

Returns
The previous position of the iterator.

◆ operator+=()

template<typename Type , bool AF>
constexpr UniformIterator< Type, AF > & blaze::UniformIterator< 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>
constexpr UniformIterator< Type, AF > & blaze::UniformIterator< Type, AF >::operator-- ( )
inlinenoexcept

Pre-decrement operator.

Returns
Reference to the decremented iterator.

◆ operator--() [2/2]

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

Post-decrement operator.

Returns
The previous position of the iterator.

◆ operator-=()

template<typename Type , bool AF>
constexpr UniformIterator< Type, AF > & blaze::UniformIterator< 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>
constexpr UniformIterator< Type, AF >::PointerType blaze::UniformIterator< 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>
constexpr UniformIterator< Type, AF >::ReferenceType blaze::UniformIterator< Type, AF >::operator[] ( size_t  index) const
inlinenoexcept

Direct access to the underlying elements.

Parameters
indexAccess index.
Returns
Reference to the accessed value.

◆ ptr()

template<typename Type , bool AF>
constexpr UniformIterator< Type, AF >::PointerType blaze::UniformIterator< Type, AF >::ptr ( ) const
inlinenoexcept

Low-level access to the current memory location of the iterator.

Returns
Pointer to the current memory location.

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