Public Types | Public Member Functions | Private Attributes | Friends | List of all members
blaze::DenseSubmatrix< MT, AF, SO >::SubmatrixIterator< IteratorType > Class Template Reference

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

#include <DenseSubmatrix.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

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

Private Attributes

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

Friends

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

Detailed Description

template<typename MT, bool AF = unaligned, bool SO = IsColumnMajorMatrix<MT>::value>
template<typename IteratorType>
class blaze::DenseSubmatrix< MT, AF, SO >::SubmatrixIterator< IteratorType >

Iterator over the elements of the sparse submatrix.

Constructor & Destructor Documentation

template<typename MT, bool AF = unaligned, bool SO = IsColumnMajorMatrix<MT>::value>
template<typename IteratorType>
blaze::DenseSubmatrix< MT, AF, SO >::SubmatrixIterator< IteratorType >::SubmatrixIterator ( IteratorType  iterator,
bool  isMemoryAligned 
)
inline

Constructor of the SubmatrixIterator class.

Parameters
iteratorIterator to the initial element.
isMemoryAlignedMemory alignment flag.
template<typename MT, bool AF = unaligned, bool SO = IsColumnMajorMatrix<MT>::value>
template<typename IteratorType>
template<typename IteratorType2 >
blaze::DenseSubmatrix< MT, AF, SO >::SubmatrixIterator< IteratorType >::SubmatrixIterator ( const SubmatrixIterator< IteratorType2 > &  it)
inline

Conversion constructor from different SubmatrixIterator instances.

Parameters
itThe submatrix iterator to be copied.

Member Function Documentation

template<typename MT, bool AF = unaligned, bool SO = IsColumnMajorMatrix<MT>::value>
template<typename IteratorType>
IteratorType blaze::DenseSubmatrix< MT, AF, SO >::SubmatrixIterator< IteratorType >::base ( ) const
inline

Access to the current position of the submatrix iterator.

Returns
The current position of the submatrix iterator.
template<typename MT, bool AF = unaligned, bool SO = IsColumnMajorMatrix<MT>::value>
template<typename IteratorType>
bool blaze::DenseSubmatrix< MT, AF, SO >::SubmatrixIterator< 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 MT, bool AF = unaligned, bool SO = IsColumnMajorMatrix<MT>::value>
template<typename IteratorType>
IntrinsicType blaze::DenseSubmatrix< MT, AF, SO >::SubmatrixIterator< IteratorType >::load ( ) const
inline

Load of an intrinsic element of the dense submatrix.

Returns
The loaded intrinsic element.

This function performs a load of the current intrinsic element of the submatrix 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 MT, bool AF = unaligned, bool SO = IsColumnMajorMatrix<MT>::value>
template<typename IteratorType>
IntrinsicType blaze::DenseSubmatrix< MT, AF, SO >::SubmatrixIterator< IteratorType >::loada ( ) const
inline

Aligned load of an intrinsic element of the dense submatrix.

Returns
The loaded intrinsic element.

This function performs an aligned load of the current intrinsic element of the submatrix 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 MT, bool AF = unaligned, bool SO = IsColumnMajorMatrix<MT>::value>
template<typename IteratorType>
IntrinsicType blaze::DenseSubmatrix< MT, AF, SO >::SubmatrixIterator< IteratorType >::loadu ( ) const
inline

Unaligned load of an intrinsic element of the dense submatrix.

Returns
The loaded intrinsic element.

This function performs an unaligned load of the current intrinsic element of the submatrix 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 MT, bool AF = unaligned, bool SO = IsColumnMajorMatrix<MT>::value>
template<typename IteratorType>
bool blaze::DenseSubmatrix< MT, AF, SO >::SubmatrixIterator< IteratorType >::operator!= ( const SubmatrixIterator< IteratorType > &  rhs) const
inline

Inequality comparison between two SubmatrixIterator 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 MT, bool AF = unaligned, bool SO = IsColumnMajorMatrix<MT>::value>
template<typename IteratorType>
ReferenceType blaze::DenseSubmatrix< MT, AF, SO >::SubmatrixIterator< IteratorType >::operator* ( ) const
inline

Direct access to the element at the current iterator position.

Returns
The resulting value.
template<typename MT, bool AF = unaligned, bool SO = IsColumnMajorMatrix<MT>::value>
template<typename IteratorType>
SubmatrixIterator& blaze::DenseSubmatrix< MT, AF, SO >::SubmatrixIterator< IteratorType >::operator++ ( )
inline

Pre-increment operator.

Returns
Reference to the incremented iterator.
template<typename MT, bool AF = unaligned, bool SO = IsColumnMajorMatrix<MT>::value>
template<typename IteratorType>
const SubmatrixIterator blaze::DenseSubmatrix< MT, AF, SO >::SubmatrixIterator< IteratorType >::operator++ ( int  )
inline

Post-increment operator.

Returns
The previous position of the iterator.
template<typename MT, bool AF = unaligned, bool SO = IsColumnMajorMatrix<MT>::value>
template<typename IteratorType>
SubmatrixIterator& blaze::DenseSubmatrix< MT, AF, SO >::SubmatrixIterator< IteratorType >::operator+= ( size_t  inc)
inline

Addition assignment operator.

Parameters
incThe increment of the iterator.
Returns
The incremented iterator.
template<typename MT, bool AF = unaligned, bool SO = IsColumnMajorMatrix<MT>::value>
template<typename IteratorType>
DifferenceType blaze::DenseSubmatrix< MT, AF, SO >::SubmatrixIterator< IteratorType >::operator- ( const SubmatrixIterator< 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 MT, bool AF = unaligned, bool SO = IsColumnMajorMatrix<MT>::value>
template<typename IteratorType>
SubmatrixIterator& blaze::DenseSubmatrix< MT, AF, SO >::SubmatrixIterator< IteratorType >::operator-- ( )
inline

Pre-decrement operator.

Returns
Reference to the decremented iterator.
template<typename MT, bool AF = unaligned, bool SO = IsColumnMajorMatrix<MT>::value>
template<typename IteratorType>
const SubmatrixIterator blaze::DenseSubmatrix< MT, AF, SO >::SubmatrixIterator< IteratorType >::operator-- ( int  )
inline

Post-decrement operator.

Returns
The previous position of the iterator.
template<typename MT, bool AF = unaligned, bool SO = IsColumnMajorMatrix<MT>::value>
template<typename IteratorType>
SubmatrixIterator& blaze::DenseSubmatrix< MT, AF, SO >::SubmatrixIterator< IteratorType >::operator-= ( size_t  dec)
inline

Subtraction assignment operator.

Parameters
decThe decrement of the iterator.
Returns
The decremented iterator.
template<typename MT, bool AF = unaligned, bool SO = IsColumnMajorMatrix<MT>::value>
template<typename IteratorType>
bool blaze::DenseSubmatrix< MT, AF, SO >::SubmatrixIterator< IteratorType >::operator< ( const SubmatrixIterator< IteratorType > &  rhs) const
inline

Less-than comparison between two SubmatrixIterator objects.

Parameters
rhsThe right-hand side iterator.
Returns
true if the left-hand side iterator is smaller, false if not.
template<typename MT, bool AF = unaligned, bool SO = IsColumnMajorMatrix<MT>::value>
template<typename IteratorType>
bool blaze::DenseSubmatrix< MT, AF, SO >::SubmatrixIterator< IteratorType >::operator<= ( const SubmatrixIterator< IteratorType > &  rhs) const
inline

Less-than comparison between two SubmatrixIterator objects.

Parameters
rhsThe right-hand side iterator.
Returns
true if the left-hand side iterator is smaller or equal, false if not.
template<typename MT, bool AF = unaligned, bool SO = IsColumnMajorMatrix<MT>::value>
template<typename IteratorType>
bool blaze::DenseSubmatrix< MT, AF, SO >::SubmatrixIterator< IteratorType >::operator== ( const SubmatrixIterator< IteratorType > &  rhs) const
inline

Equality comparison between two SubmatrixIterator objects.

Parameters
rhsThe right-hand side iterator.
Returns
true if the iterators refer to the same element, false if not.
template<typename MT, bool AF = unaligned, bool SO = IsColumnMajorMatrix<MT>::value>
template<typename IteratorType>
bool blaze::DenseSubmatrix< MT, AF, SO >::SubmatrixIterator< IteratorType >::operator> ( const SubmatrixIterator< IteratorType > &  rhs) const
inline

Greater-than comparison between two SubmatrixIterator objects.

Parameters
rhsThe right-hand side iterator.
Returns
true if the left-hand side iterator is greater, false if not.
template<typename MT, bool AF = unaligned, bool SO = IsColumnMajorMatrix<MT>::value>
template<typename IteratorType>
bool blaze::DenseSubmatrix< MT, AF, SO >::SubmatrixIterator< IteratorType >::operator>= ( const SubmatrixIterator< IteratorType > &  rhs) const
inline

Greater-than comparison between two SubmatrixIterator 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 MT, bool AF = unaligned, bool SO = IsColumnMajorMatrix<MT>::value>
template<typename IteratorType>
const SubmatrixIterator operator+ ( const SubmatrixIterator< IteratorType > &  it,
size_t  inc 
)
friend

Addition between a SubmatrixIterator and an integral value.

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

Addition between an integral value and a SubmatrixIterator.

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

Subtraction between a SubmatrixIterator 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: