Public Types | Public Member Functions | Private Attributes | List of all members
blaze::SMatForEachExpr< MT, OP, SO >::ConstIterator Class Reference

Iterator over the elements of the sparse matrix for-each expression. More...

#include <SMatForEachExpr.h>

Public Types

typedef ValueIndexPair< ElementTypeElement
 Element type of the sparse matrix expression.
 
typedef ConstIterator_< RemoveReference_< Operand > > IteratorType
 Iterator type of the sparse matrix expression.
 
typedef std::forward_iterator_tag IteratorCategory
 The iterator category.
 
typedef Element ValueType
 Type of the underlying pointers.
 
typedef ValueTypePointerType
 Pointer return type.
 
typedef ValueTypeReferenceType
 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 pointers.
 
typedef PointerType pointer
 Pointer return type.
 
typedef ReferenceType reference
 Reference return type.
 
typedef DifferenceType difference_type
 Difference between two iterators.
 

Public Member Functions

 ConstIterator (IteratorType it, OP op)
 Constructor for the ConstIterator class. More...
 
ConstIteratoroperator++ ()
 Pre-increment operator. More...
 
const Element operator* () const
 Direct access to the sparse matrix element at the current iterator position. More...
 
const ConstIteratoroperator-> () const
 Direct access to the sparse matrix element at the current iterator position. More...
 
ReturnType value () const
 Access to the current value of the sparse element. More...
 
size_t index () const
 Access to the current index of the sparse element. More...
 
bool operator== (const ConstIterator &rhs) const
 Equality comparison between two ConstIterator objects. More...
 
bool operator!= (const ConstIterator &rhs) const
 Inequality comparison between two ConstIterator objects. More...
 
DifferenceType operator- (const ConstIterator &rhs) const
 Calculating the number of elements between two expression iterators. More...
 

Private Attributes

IteratorType it_
 Iterator over the elements of the sparse matrix expression.
 
OP op_
 The custom unary operation.
 

Detailed Description

template<typename MT, typename OP, bool SO>
class blaze::SMatForEachExpr< MT, OP, SO >::ConstIterator

Iterator over the elements of the sparse matrix for-each expression.

Constructor & Destructor Documentation

template<typename MT , typename OP , bool SO>
blaze::SMatForEachExpr< MT, OP, SO >::ConstIterator::ConstIterator ( IteratorType  it,
OP  op 
)
inline

Constructor for the ConstIterator class.

Parameters
itIterator to the initial matrix element.
opThe custom unary operation.

Member Function Documentation

template<typename MT , typename OP , bool SO>
size_t blaze::SMatForEachExpr< MT, OP, SO >::ConstIterator::index ( ) const
inline

Access to the current index of the sparse element.

Returns
The current index of the sparse element.
template<typename MT , typename OP , bool SO>
bool blaze::SMatForEachExpr< MT, OP, SO >::ConstIterator::operator!= ( const ConstIterator rhs) const
inline

Inequality comparison between two ConstIterator objects.

Parameters
rhsThe right-hand side expression iterator.
Returns
true if the iterators don't refer to the same element, false if they do.
template<typename MT , typename OP , bool SO>
const Element blaze::SMatForEachExpr< MT, OP, SO >::ConstIterator::operator* ( ) const
inline

Direct access to the sparse matrix element at the current iterator position.

Returns
The current value of the sparse element.
template<typename MT , typename OP , bool SO>
ConstIterator& blaze::SMatForEachExpr< MT, OP, SO >::ConstIterator::operator++ ( )
inline

Pre-increment operator.

Returns
Reference to the incremented expression iterator.
template<typename MT , typename OP , bool SO>
DifferenceType blaze::SMatForEachExpr< MT, OP, SO >::ConstIterator::operator- ( const ConstIterator rhs) const
inline

Calculating the number of elements between two expression iterators.

Parameters
rhsThe right-hand side expression iterator.
Returns
The number of elements between the two expression iterators.
template<typename MT , typename OP , bool SO>
const ConstIterator* blaze::SMatForEachExpr< MT, OP, SO >::ConstIterator::operator-> ( ) const
inline

Direct access to the sparse matrix element at the current iterator position.

Returns
Reference to the sparse matrix element at the current iterator position.
template<typename MT , typename OP , bool SO>
bool blaze::SMatForEachExpr< MT, OP, SO >::ConstIterator::operator== ( const ConstIterator rhs) const
inline

Equality comparison between two ConstIterator objects.

Parameters
rhsThe right-hand side expression iterator.
Returns
true if the iterators refer to the same element, false if not.
template<typename MT , typename OP , bool SO>
ReturnType blaze::SMatForEachExpr< MT, OP, SO >::ConstIterator::value ( ) const
inline

Access to the current value of the sparse element.

Returns
The current value of the sparse element.

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