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

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

#include <SparseSubmatrix.h>

Public Types

typedef std::forward_iterator_tag IteratorCategory
 The iterator category.
 
typedef SubmatrixElement< MatrixType, IteratorType > ValueType
 Type of the underlying elements.
 
typedef ValueType PointerType
 Pointer return type.
 
typedef ValueType ReferenceType
 Reference return type.
 
typedef ptrdiff_t 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 for the SubmatrixIterator class.
 
 SubmatrixIterator (IteratorType iterator, size_t index)
 Constructor for the SubmatrixIterator class. More...
 
template<typename MatrixType2 , typename IteratorType2 >
 SubmatrixIterator (const SubmatrixIterator< MatrixType2, IteratorType2 > &it)
 Conversion constructor from different SubmatrixIterator instances. More...
 
SubmatrixIteratoroperator++ ()
 Pre-increment operator. More...
 
const SubmatrixIterator operator++ (int)
 Post-increment operator. More...
 
ReferenceType operator* () const
 Direct access to the current sparse submatrix element. More...
 
PointerType operator-> () const
 Direct access to the current sparse submatrix element. More...
 
template<typename MatrixType2 , typename IteratorType2 >
bool operator== (const SubmatrixIterator< MatrixType2, IteratorType2 > &rhs) const
 Equality comparison between two SubmatrixIterator objects. More...
 
template<typename MatrixType2 , typename IteratorType2 >
bool operator!= (const SubmatrixIterator< MatrixType2, IteratorType2 > &rhs) const
 Inequality comparison between two SubmatrixIterator objects. More...
 
DifferenceType operator- (const SubmatrixIterator &rhs) const
 Calculating the number of elements between two submatrix iterators. More...
 
IteratorType base () const
 Access to the current position of the submatrix iterator. More...
 
size_t offset () const
 Access to the offset of the submatrix iterator. More...
 

Private Attributes

IteratorType pos_
 Iterator to the current sparse element.
 
size_t offset_
 The offset of the according row/column of the sparse matrix.
 

Detailed Description

template<typename MT, bool AF = unaligned, bool SO = IsColumnMajorMatrix<MT>::value>
template<typename MatrixType, typename IteratorType>
class blaze::SparseSubmatrix< MT, AF, SO >::SubmatrixIterator< MatrixType, 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 MatrixType, typename IteratorType>
blaze::SparseSubmatrix< MT, AF, SO >::SubmatrixIterator< MatrixType, IteratorType >::SubmatrixIterator ( IteratorType  iterator,
size_t  index 
)
inline

Constructor for the SubmatrixIterator class.

Parameters
iteratorIterator to the current sparse element.
indexThe starting index within the according row/column of the sparse matrix.
template<typename MT, bool AF = unaligned, bool SO = IsColumnMajorMatrix<MT>::value>
template<typename MatrixType, typename IteratorType>
template<typename MatrixType2 , typename IteratorType2 >
blaze::SparseSubmatrix< MT, AF, SO >::SubmatrixIterator< MatrixType, IteratorType >::SubmatrixIterator ( const SubmatrixIterator< MatrixType2, 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 MatrixType, typename IteratorType>
IteratorType blaze::SparseSubmatrix< MT, AF, SO >::SubmatrixIterator< MatrixType, 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 MatrixType, typename IteratorType>
size_t blaze::SparseSubmatrix< MT, AF, SO >::SubmatrixIterator< MatrixType, IteratorType >::offset ( ) const
inline

Access to the offset of the submatrix iterator.

Returns
The offset of the submatrix iterator.
template<typename MT, bool AF = unaligned, bool SO = IsColumnMajorMatrix<MT>::value>
template<typename MatrixType, typename IteratorType>
template<typename MatrixType2 , typename IteratorType2 >
bool blaze::SparseSubmatrix< MT, AF, SO >::SubmatrixIterator< MatrixType, IteratorType >::operator!= ( const SubmatrixIterator< MatrixType2, IteratorType2 > &  rhs) const
inline

Inequality comparison between two SubmatrixIterator objects.

Parameters
rhsThe right-hand side submatrix 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 MatrixType, typename IteratorType>
ReferenceType blaze::SparseSubmatrix< MT, AF, SO >::SubmatrixIterator< MatrixType, IteratorType >::operator* ( ) const
inline

Direct access to the current sparse submatrix element.

Returns
Reference to the current sparse submatrix element.
template<typename MT, bool AF = unaligned, bool SO = IsColumnMajorMatrix<MT>::value>
template<typename MatrixType, typename IteratorType>
SubmatrixIterator& blaze::SparseSubmatrix< MT, AF, SO >::SubmatrixIterator< MatrixType, 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 MatrixType, typename IteratorType>
const SubmatrixIterator blaze::SparseSubmatrix< MT, AF, SO >::SubmatrixIterator< MatrixType, 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 MatrixType, typename IteratorType>
DifferenceType blaze::SparseSubmatrix< MT, AF, SO >::SubmatrixIterator< MatrixType, IteratorType >::operator- ( const SubmatrixIterator< MatrixType, IteratorType > &  rhs) const
inline

Calculating the number of elements between two submatrix iterators.

Parameters
rhsThe right-hand side submatrix iterator.
Returns
The number of elements between the two submatrix iterators.
template<typename MT, bool AF = unaligned, bool SO = IsColumnMajorMatrix<MT>::value>
template<typename MatrixType, typename IteratorType>
PointerType blaze::SparseSubmatrix< MT, AF, SO >::SubmatrixIterator< MatrixType, IteratorType >::operator-> ( ) const
inline

Direct access to the current sparse submatrix element.

Returns
Pointer to the current sparse submatrix element.
template<typename MT, bool AF = unaligned, bool SO = IsColumnMajorMatrix<MT>::value>
template<typename MatrixType, typename IteratorType>
template<typename MatrixType2 , typename IteratorType2 >
bool blaze::SparseSubmatrix< MT, AF, SO >::SubmatrixIterator< MatrixType, IteratorType >::operator== ( const SubmatrixIterator< MatrixType2, IteratorType2 > &  rhs) const
inline

Equality comparison between two SubmatrixIterator objects.

Parameters
rhsThe right-hand side submatrix iterator.
Returns
true if the iterators refer to the same element, false if not.

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