Blaze 3.9
Public Types | Public Member Functions | Private Attributes | List of all members
blaze::IdentityMatrix< Type, SO, Tag >::ConstIterator Class Reference

Iterator over the elements of the identity matrix. More...

#include <IdentityMatrix.h>

Public Types

using Element = ValueIndexPair< Type >
 Element type of the identity matrix.
 
using IteratorCategory = std::forward_iterator_tag
 The iterator category.
 
using ValueType = Element
 Type of the underlying pointers.
 
using PointerType = ValueType *
 Pointer return type.
 
using ReferenceType = ValueType &
 Reference return type.
 
using DifferenceType = ptrdiff_t
 Difference between two iterators.
 
using iterator_category = IteratorCategory
 The iterator category.
 
using value_type = ValueType
 Type of the underlying pointers.
 
using pointer = PointerType
 Pointer return type.
 
using reference = ReferenceType
 Reference return type.
 
using difference_type = DifferenceType
 Difference between two iterators.
 

Public Member Functions

constexpr ConstIterator () noexcept
 Default constructor for the ConstIterator class.
 
constexpr ConstIterator (size_t index) noexcept
 Constructor for the ConstIterator class. More...
 
constexpr ConstIteratoroperator++ () noexcept
 Pre-increment operator. More...
 
constexpr ConstIterator operator++ (int) noexcept
 Post-increment operator. More...
 
constexpr const Element operator* () const noexcept
 Direct access to the sparse matrix element at the current iterator position. More...
 
constexpr const ConstIteratoroperator-> () const noexcept
 Direct access to the sparse matrix element at the current iterator position. More...
 
constexpr Type value () const noexcept
 Access to the current value of the sparse element. More...
 
constexpr size_t index () const noexcept
 Access to the current index of the sparse element. More...
 
constexpr bool operator== (const ConstIterator &rhs) const noexcept
 Equality comparison between two ConstIterator objects. More...
 
constexpr bool operator!= (const ConstIterator &rhs) const noexcept
 Inequality comparison between two ConstIterator objects. More...
 
constexpr DifferenceType operator- (const ConstIterator &rhs) const noexcept
 Calculating the number of elements between two ConstIterator objects. More...
 

Private Attributes

size_t index_
 Index to the current identity matrix element.
 

Detailed Description

template<typename Type, bool SO, typename Tag>
class blaze::IdentityMatrix< Type, SO, Tag >::ConstIterator

Iterator over the elements of the identity matrix.

Constructor & Destructor Documentation

◆ ConstIterator()

template<typename Type , bool SO, typename Tag >
constexpr blaze::IdentityMatrix< Type, SO, Tag >::ConstIterator::ConstIterator ( size_t  index)
inlineconstexprnoexcept

Constructor for the ConstIterator class.

Parameters
indexIndex to the initial matrix element.

Member Function Documentation

◆ index()

template<typename Type , bool SO, typename Tag >
constexpr size_t blaze::IdentityMatrix< Type, SO, Tag >::ConstIterator::index ( ) const
inlineconstexprnoexcept

Access to the current index of the sparse element.

Returns
The current index of the sparse element.

◆ operator!=()

template<typename Type , bool SO, typename Tag >
constexpr bool blaze::IdentityMatrix< Type, SO, Tag >::ConstIterator::operator!= ( const ConstIterator rhs) const
inlineconstexprnoexcept

Inequality comparison between two ConstIterator objects.

Parameters
rhsThe right-hand side ConstIterator object.
Returns
true if the iterators don't refer to the same element, false if they do.

◆ operator*()

template<typename Type , bool SO, typename Tag >
constexpr const Element blaze::IdentityMatrix< Type, SO, Tag >::ConstIterator::operator* ( ) const
inlineconstexprnoexcept

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

Returns
The current value of the sparse element.

◆ operator++() [1/2]

template<typename Type , bool SO, typename Tag >
constexpr ConstIterator & blaze::IdentityMatrix< Type, SO, Tag >::ConstIterator::operator++ ( )
inlineconstexprnoexcept

Pre-increment operator.

Returns
Reference to the incremented iterator.

◆ operator++() [2/2]

template<typename Type , bool SO, typename Tag >
constexpr ConstIterator blaze::IdentityMatrix< Type, SO, Tag >::ConstIterator::operator++ ( int  )
inlineconstexprnoexcept

Post-increment operator.

Returns
The previous position of the iterator.

◆ operator-()

template<typename Type , bool SO, typename Tag >
constexpr DifferenceType blaze::IdentityMatrix< Type, SO, Tag >::ConstIterator::operator- ( const ConstIterator rhs) const
inlineconstexprnoexcept

Calculating the number of elements between two ConstIterator objects.

Parameters
rhsThe right-hand side ConstIterator object.
Returns
The number of elements between the two ConstIterator objects.

◆ operator->()

template<typename Type , bool SO, typename Tag >
constexpr const ConstIterator * blaze::IdentityMatrix< Type, SO, Tag >::ConstIterator::operator-> ( ) const
inlineconstexprnoexcept

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

Returns
Reference to the sparse matrix element at the current iterator position.

◆ operator==()

template<typename Type , bool SO, typename Tag >
constexpr bool blaze::IdentityMatrix< Type, SO, Tag >::ConstIterator::operator== ( const ConstIterator rhs) const
inlineconstexprnoexcept

Equality comparison between two ConstIterator objects.

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

◆ value()

template<typename Type , bool SO, typename Tag >
constexpr Type blaze::IdentityMatrix< Type, SO, Tag >::ConstIterator::value ( ) const
inlineconstexprnoexcept

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: