Public Types | Public Member Functions | Private Attributes | Friends | List of all members
blaze::DenseSubvector< VT, AF, TF >::SubvectorIterator< IteratorType > Class Template Reference

Iterator over the elements of the sparse subvector. More...

#include <DenseSubvector.h>

Public Types

typedef std::iterator_traits< IteratorType >::iterator_category IteratorCategory
 The iterator category.
 
typedef std::iterator_traits< IteratorType >::value_type ValueType
 Type of the underlying elements.
 
typedef std::iterator_traits< IteratorType >::pointer PointerType
 Pointer return type.
 
typedef std::iterator_traits< IteratorType >::reference ReferenceType
 Reference return type.
 
typedef std::iterator_traits< IteratorType >::difference_type DifferenceType
 Difference between two iterators.
 
typedef IteratorCategory iterator_category
 The iterator category.
 
typedef ValueType value_type
 Type of the underlying elements.
 
typedef PointerType pointer
 Pointer return type.
 
typedef ReferenceType reference
 Reference return type.
 
typedef DifferenceType difference_type
 Difference between two iterators.
 

Public Member Functions

 SubvectorIterator ()
 Default constructor of the SubvectorIterator class.
 
 SubvectorIterator (IteratorType iterator, bool isMemoryAligned)
 Constructor of the SubvectorIterator class. More...
 
template<typename IteratorType2 >
 SubvectorIterator (const SubvectorIterator< IteratorType2 > &it)
 Conversion constructor from different SubvectorIterator instances. More...
 
SubvectorIteratoroperator+= (size_t inc)
 Addition assignment operator. More...
 
SubvectorIteratoroperator-= (size_t dec)
 Subtraction assignment operator. More...
 
SubvectorIteratoroperator++ ()
 Pre-increment operator. More...
 
const SubvectorIterator operator++ (int)
 Post-increment operator. More...
 
SubvectorIteratoroperator-- ()
 Pre-decrement operator. More...
 
const SubvectorIterator operator-- (int)
 Post-decrement operator. More...
 
ReferenceType operator* () const
 Direct access to the element at the current iterator position. More...
 
IntrinsicType load () const
 Aligned load of an intrinsic element of the dense subvector. More...
 
IntrinsicType loada () const
 Aligned load of an intrinsic element of the dense subvector. More...
 
IntrinsicType loadu () const
 Unaligned load of an intrinsic element of the dense subvector. More...
 
bool operator== (const SubvectorIterator &rhs) const
 Equality comparison between two SubvectorIterator objects. More...
 
bool operator!= (const SubvectorIterator &rhs) const
 Inequality comparison between two SubvectorIterator objects. More...
 
bool operator< (const SubvectorIterator &rhs) const
 Less-than comparison between two SubvectorIterator objects. More...
 
bool operator> (const SubvectorIterator &rhs) const
 Greater-than comparison between two SubvectorIterator objects. More...
 
bool operator<= (const SubvectorIterator &rhs) const
 Less-than comparison between two SubvectorIterator objects. More...
 
bool operator>= (const SubvectorIterator &rhs) const
 Greater-than comparison between two SubvectorIterator objects. More...
 
DifferenceType operator- (const SubvectorIterator &rhs) const
 Calculating the number of elements between two iterators. More...
 
IteratorType base () const
 Access to the current position of the subvector iterator. More...
 
bool isAligned () const
 Access to the iterator's memory alignment flag. More...
 

Private Attributes

IteratorType iterator_
 Iterator to the current subvector element.
 
bool isAligned_
 Memory alignment flag.
 

Friends

const SubvectorIterator operator+ (const SubvectorIterator &it, size_t inc)
 Addition between a SubvectorIterator and an integral value. More...
 
const SubvectorIterator operator+ (size_t inc, const SubvectorIterator &it)
 Addition between an integral value and a SubvectorIterator. More...
 
const SubvectorIterator operator- (const SubvectorIterator &it, size_t dec)
 Subtraction between a SubvectorIterator and an integral value. More...
 

Detailed Description

template<typename VT, bool AF = unaligned, bool TF = IsRowVector<VT>::value>
template<typename IteratorType>
class blaze::DenseSubvector< VT, AF, TF >::SubvectorIterator< IteratorType >

Iterator over the elements of the sparse subvector.

Constructor & Destructor Documentation

template<typename VT, bool AF = unaligned, bool TF = IsRowVector<VT>::value>
template<typename IteratorType>
blaze::DenseSubvector< VT, AF, TF >::SubvectorIterator< IteratorType >::SubvectorIterator ( IteratorType  iterator,
bool  isMemoryAligned 
)
inline

Constructor of the SubvectorIterator class.

Parameters
iteratorIterator to the initial element.
isMemoryAlignedMemory alignment flag.
template<typename VT, bool AF = unaligned, bool TF = IsRowVector<VT>::value>
template<typename IteratorType>
template<typename IteratorType2 >
blaze::DenseSubvector< VT, AF, TF >::SubvectorIterator< IteratorType >::SubvectorIterator ( const SubvectorIterator< IteratorType2 > &  it)
inline

Conversion constructor from different SubvectorIterator instances.

Parameters
itThe subvector iterator to be copied

Member Function Documentation

template<typename VT, bool AF = unaligned, bool TF = IsRowVector<VT>::value>
template<typename IteratorType>
IteratorType blaze::DenseSubvector< VT, AF, TF >::SubvectorIterator< IteratorType >::base ( ) const
inline

Access to the current position of the subvector iterator.

Returns
The current position of the subvector iterator.
template<typename VT, bool AF = unaligned, bool TF = IsRowVector<VT>::value>
template<typename IteratorType>
bool blaze::DenseSubvector< VT, AF, TF >::SubvectorIterator< IteratorType >::isAligned ( ) const
inline

Access to the iterator's memory alignment flag.

Returns
true in case the iterator is aligned, false if it is not.
template<typename VT, bool AF = unaligned, bool TF = IsRowVector<VT>::value>
template<typename IteratorType>
IntrinsicType blaze::DenseSubvector< VT, AF, TF >::SubvectorIterator< IteratorType >::load ( ) const
inline

Aligned load of an intrinsic element of the dense subvector.

Returns
The loaded intrinsic element.

This function performs an aligned load of the current intrinsic element of the subvector iterator. 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.

template<typename VT, bool AF = unaligned, bool TF = IsRowVector<VT>::value>
template<typename IteratorType>
IntrinsicType blaze::DenseSubvector< VT, AF, TF >::SubvectorIterator< IteratorType >::loada ( ) const
inline

Aligned load of an intrinsic element of the dense subvector.

Returns
The loaded intrinsic element.

This function performs an aligned load of the current intrinsic element of the subvector iterator. 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.

template<typename VT, bool AF = unaligned, bool TF = IsRowVector<VT>::value>
template<typename IteratorType>
IntrinsicType blaze::DenseSubvector< VT, AF, TF >::SubvectorIterator< IteratorType >::loadu ( ) const
inline

Unaligned load of an intrinsic element of the dense subvector.

Returns
The loaded intrinsic element.

This function performs an unaligned load of the current intrinsic element of the subvector iterator. 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.

template<typename VT, bool AF = unaligned, bool TF = IsRowVector<VT>::value>
template<typename IteratorType>
bool blaze::DenseSubvector< VT, AF, TF >::SubvectorIterator< IteratorType >::operator!= ( const SubvectorIterator< IteratorType > &  rhs) const
inline

Inequality comparison between two SubvectorIterator objects.

Parameters
rhsThe right-hand side iterator.
Returns
true if the iterators don't refer to the same element, false if they do.
template<typename VT, bool AF = unaligned, bool TF = IsRowVector<VT>::value>
template<typename IteratorType>
ReferenceType blaze::DenseSubvector< VT, AF, TF >::SubvectorIterator< IteratorType >::operator* ( ) const
inline

Direct access to the element at the current iterator position.

Returns
The resulting value.
template<typename VT, bool AF = unaligned, bool TF = IsRowVector<VT>::value>
template<typename IteratorType>
SubvectorIterator& blaze::DenseSubvector< VT, AF, TF >::SubvectorIterator< IteratorType >::operator++ ( )
inline

Pre-increment operator.

Returns
Reference to the incremented iterator.
template<typename VT, bool AF = unaligned, bool TF = IsRowVector<VT>::value>
template<typename IteratorType>
const SubvectorIterator blaze::DenseSubvector< VT, AF, TF >::SubvectorIterator< IteratorType >::operator++ ( int  )
inline

Post-increment operator.

Returns
The previous position of the iterator.
template<typename VT, bool AF = unaligned, bool TF = IsRowVector<VT>::value>
template<typename IteratorType>
SubvectorIterator& blaze::DenseSubvector< VT, AF, TF >::SubvectorIterator< IteratorType >::operator+= ( size_t  inc)
inline

Addition assignment operator.

Parameters
incThe increment of the iterator.
Returns
The incremented iterator.
template<typename VT, bool AF = unaligned, bool TF = IsRowVector<VT>::value>
template<typename IteratorType>
DifferenceType blaze::DenseSubvector< VT, AF, TF >::SubvectorIterator< IteratorType >::operator- ( const SubvectorIterator< IteratorType > &  rhs) const
inline

Calculating the number of elements between two iterators.

Parameters
rhsThe right-hand side iterator.
Returns
The number of elements between the two iterators.
template<typename VT, bool AF = unaligned, bool TF = IsRowVector<VT>::value>
template<typename IteratorType>
SubvectorIterator& blaze::DenseSubvector< VT, AF, TF >::SubvectorIterator< IteratorType >::operator-- ( )
inline

Pre-decrement operator.

Returns
Reference to the decremented iterator.
template<typename VT, bool AF = unaligned, bool TF = IsRowVector<VT>::value>
template<typename IteratorType>
const SubvectorIterator blaze::DenseSubvector< VT, AF, TF >::SubvectorIterator< IteratorType >::operator-- ( int  )
inline

Post-decrement operator.

Returns
The previous position of the iterator.
template<typename VT, bool AF = unaligned, bool TF = IsRowVector<VT>::value>
template<typename IteratorType>
SubvectorIterator& blaze::DenseSubvector< VT, AF, TF >::SubvectorIterator< IteratorType >::operator-= ( size_t  dec)
inline

Subtraction assignment operator.

Parameters
decThe decrement of the iterator.
Returns
The decremented iterator.
template<typename VT, bool AF = unaligned, bool TF = IsRowVector<VT>::value>
template<typename IteratorType>
bool blaze::DenseSubvector< VT, AF, TF >::SubvectorIterator< IteratorType >::operator< ( const SubvectorIterator< IteratorType > &  rhs) const
inline

Less-than comparison between two SubvectorIterator objects.

Parameters
rhsThe right-hand side iterator.
Returns
true if the left-hand side iterator is smaller, false if not.
template<typename VT, bool AF = unaligned, bool TF = IsRowVector<VT>::value>
template<typename IteratorType>
bool blaze::DenseSubvector< VT, AF, TF >::SubvectorIterator< IteratorType >::operator<= ( const SubvectorIterator< IteratorType > &  rhs) const
inline

Less-than comparison between two SubvectorIterator objects.

Parameters
rhsThe right-hand side iterator.
Returns
true if the left-hand side iterator is smaller or equal, false if not.
template<typename VT, bool AF = unaligned, bool TF = IsRowVector<VT>::value>
template<typename IteratorType>
bool blaze::DenseSubvector< VT, AF, TF >::SubvectorIterator< IteratorType >::operator== ( const SubvectorIterator< IteratorType > &  rhs) const
inline

Equality comparison between two SubvectorIterator objects.

Parameters
rhsThe right-hand side iterator.
Returns
true if the iterators refer to the same element, false if not.
template<typename VT, bool AF = unaligned, bool TF = IsRowVector<VT>::value>
template<typename IteratorType>
bool blaze::DenseSubvector< VT, AF, TF >::SubvectorIterator< IteratorType >::operator> ( const SubvectorIterator< IteratorType > &  rhs) const
inline

Greater-than comparison between two SubvectorIterator objects.

Parameters
rhsThe right-hand side iterator.
Returns
true if the left-hand side iterator is greater, false if not.
template<typename VT, bool AF = unaligned, bool TF = IsRowVector<VT>::value>
template<typename IteratorType>
bool blaze::DenseSubvector< VT, AF, TF >::SubvectorIterator< IteratorType >::operator>= ( const SubvectorIterator< IteratorType > &  rhs) const
inline

Greater-than comparison between two SubvectorIterator objects.

Parameters
rhsThe right-hand side iterator.
Returns
true if the left-hand side iterator is greater or equal, false if not.

Friends And Related Function Documentation

template<typename VT, bool AF = unaligned, bool TF = IsRowVector<VT>::value>
template<typename IteratorType>
const SubvectorIterator operator+ ( const SubvectorIterator< IteratorType > &  it,
size_t  inc 
)
friend

Addition between a SubvectorIterator and an integral value.

Parameters
itThe iterator to be incremented.
incThe number of elements the iterator is incremented.
Returns
The incremented iterator.
template<typename VT, bool AF = unaligned, bool TF = IsRowVector<VT>::value>
template<typename IteratorType>
const SubvectorIterator operator+ ( size_t  inc,
const SubvectorIterator< IteratorType > &  it 
)
friend

Addition between an integral value and a SubvectorIterator.

Parameters
incThe number of elements the iterator is incremented.
itThe iterator to be incremented.
Returns
The incremented iterator.
template<typename VT, bool AF = unaligned, bool TF = IsRowVector<VT>::value>
template<typename IteratorType>
const SubvectorIterator operator- ( const SubvectorIterator< IteratorType > &  it,
size_t  dec 
)
friend

Subtraction between a SubvectorIterator and an integral value.

Parameters
itThe iterator to be decremented.
decThe number of elements the iterator is decremented.
Returns
The decremented iterator.

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