Argon 0.1.0
Loading...
Searching...
No Matches
argon::vectorize::load< ScalarType >::LoadIterator Struct Reference

The Iterator type for the range. More...

#include <load.hpp>

Public Types

using iterator_category = std::bidirectional_iterator_tag
 The iterator category.
using difference_type = std::ptrdiff_t
 The difference type.
using value_type = helpers::ArgonFor_t<intrinsic_type>
 The value type of the iterator.
using reference_type = value_type&

Public Member Functions

 LoadIterator (const ScalarType *ptr)
 Constructs a LoadIterator from a pointer to the data.
Argon< ScalarType > operator* () const
 Dereferences the iterator to get the SIMD vector.
LoadIteratoroperator+= (int n)
 Increments the iterator by a number of steps.
LoadIteratoroperator-= (int n)
 Decrements the iterator by a number of steps.
LoadIterator operator++ (int)
 Postfix increment operator.
LoadIteratoroperator++ ()
 Prefix increment operator.
LoadIterator operator-- (int)
 Postfix decrement operator.
LoadIteratoroperator-- ()
 Prefix decrement operator.
LoadIterator operator+ (int n) const
 Adds an integer to the iterator and returns a new iterator.
LoadIterator operator- (int n) const
 Subtracts an integer from the iterator and returns a new iterator.
LoadIteratoroperator[] (int n) const
 Accesses the element at the given index.
difference_type operator- (const LoadIterator &other) const
 Calculates the difference between two iterators.

Friends

LoadIterator operator+ (const int n, const LoadIterator &it)
 Adds an integer to the iterator and returns a new iterator.
bool operator== (const LoadIterator &a, const LoadIterator &b)
 Compares LoadIterators for equality.
bool operator== (const LoadIterator &a, const ScalarType *ptr)
 Compares LoadIterators for equality.
bool operator!= (const LoadIterator &a, const LoadIterator &b)
 Compares LoadIterators for inequality.
bool operator!= (const LoadIterator &a, const ScalarType *ptr)
 Compares LoadIterators for inequality.
auto operator<=> (const LoadIterator &a, const LoadIterator &b)
 Compares LoadIterators.

Detailed Description

template<typename ScalarType>
struct argon::vectorize::load< ScalarType >::LoadIterator

The Iterator type for the range.

Note
This iterator performs a load operation on every dereference!

Constructor & Destructor Documentation

◆ LoadIterator()

template<typename ScalarType>
argon::vectorize::load< ScalarType >::LoadIterator::LoadIterator ( const ScalarType * ptr)
inline

Constructs a LoadIterator from a pointer to the data.

Parameters
ptrThe pointer to the data.

Member Function Documentation

◆ operator*()

template<typename ScalarType>
Argon< ScalarType > argon::vectorize::load< ScalarType >::LoadIterator::operator* ( ) const
inline

Dereferences the iterator to get the SIMD vector.

Returns
The SIMD vector loaded from the data.
Note
This function Loads the data from the pointer and returns it as an Argon vector.

◆ operator+()

template<typename ScalarType>
LoadIterator argon::vectorize::load< ScalarType >::LoadIterator::operator+ ( int n) const
inline

Adds an integer to the iterator and returns a new iterator.

Parameters
nThe number of steps to add.
Returns
The updated iterator.

◆ operator++() [1/2]

template<typename ScalarType>
LoadIterator & argon::vectorize::load< ScalarType >::LoadIterator::operator++ ( )
inline

Prefix increment operator.

Returns
The updated iterator.

◆ operator++() [2/2]

template<typename ScalarType>
LoadIterator argon::vectorize::load< ScalarType >::LoadIterator::operator++ ( int )
inline

Postfix increment operator.

Returns
The iterator before incrementing.

◆ operator+=()

template<typename ScalarType>
LoadIterator & argon::vectorize::load< ScalarType >::LoadIterator::operator+= ( int n)
inline

Increments the iterator by a number of steps.

Parameters
nThe number of steps to increment.
Returns
The updated iterator.

◆ operator-() [1/2]

template<typename ScalarType>
difference_type argon::vectorize::load< ScalarType >::LoadIterator::operator- ( const LoadIterator & other) const
inline

Calculates the difference between two iterators.

Parameters
otherThe other iterator to subtract from this one.
Returns
The difference between the two iterators.

◆ operator-() [2/2]

template<typename ScalarType>
LoadIterator argon::vectorize::load< ScalarType >::LoadIterator::operator- ( int n) const
inline

Subtracts an integer from the iterator and returns a new iterator.

Parameters
nThe number of steps to subtract.
Returns
The updated iterator.

◆ operator--() [1/2]

template<typename ScalarType>
LoadIterator & argon::vectorize::load< ScalarType >::LoadIterator::operator-- ( )
inline

Prefix decrement operator.

Returns
The updated iterator.

◆ operator--() [2/2]

template<typename ScalarType>
LoadIterator argon::vectorize::load< ScalarType >::LoadIterator::operator-- ( int )
inline

Postfix decrement operator.

Returns
The iterator before decrementing.

◆ operator-=()

template<typename ScalarType>
LoadIterator & argon::vectorize::load< ScalarType >::LoadIterator::operator-= ( int n)
inline

Decrements the iterator by a number of steps.

Parameters
nThe number of steps to decrement.
Returns
The updated iterator.

◆ operator[]()

template<typename ScalarType>
LoadIterator & argon::vectorize::load< ScalarType >::LoadIterator::operator[] ( int n) const
inline

Accesses the element at the given index.

Parameters
nThe index of the element to access.
Returns
A reference to the element at the given index.

◆ operator!=

template<typename ScalarType>
bool operator!= ( const LoadIterator & a,
const ScalarType * ptr )
friend

Compares LoadIterators for inequality.

◆ operator+

template<typename ScalarType>
LoadIterator operator+ ( const int n,
const LoadIterator & it )
friend

Adds an integer to the iterator and returns a new iterator.

Parameters
nThe number of steps to add.
itThe iterator to add to.
Returns
The updated iterator.

◆ operator==

template<typename ScalarType>
bool operator== ( const LoadIterator & a,
const ScalarType * ptr )
friend

Compares LoadIterators for equality.


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