raiigraph
C++ RAII for igraph data structures
Loading...
Searching...
No Matches
Classes | Public Member Functions | List of all members
raiigraph::Matrix< Ns_ >::View< BaseIterator, BaseReference > Class Template Reference

View into a row/column of the matrix. More...

#include <Matrix.hpp>

Classes

struct  Iterator
 Random-access iterator through the view. More...
 

Public Member Functions

bool empty () const
 
size_type size () const
 
BaseReference operator[] (size_type i) const
 
BaseReference back () const
 
BaseReference front () const
 
Iterator begin () const
 
Iterator end () const
 
Iterator cbegin () const
 
Iterator cend () const
 
std::reverse_iterator< Iteratorrbegin () const
 
std::reverse_iterator< Iteratorrend () const
 
std::reverse_iterator< Iteratorcrbegin () const
 
std::reverse_iterator< Iteratorcrend () const
 

Detailed Description

template<class Ns_>
template<typename BaseIterator, typename BaseReference>
class raiigraph::Matrix< Ns_ >::View< BaseIterator, BaseReference >

View into a row/column of the matrix.

Template Parameters
BaseIteratorInternal use only.
BaseReferenceInternal use only.

This provides an STL-like container around a row or column of the matrix for convenient access, modification and iteration. It avoids the need to copy data to/from the matrix and an external vector when interfacing with STL functions. Views should be treated like iterators in that they are potentially invalidated by any re/deallocations in the parent Matrix.

Member Function Documentation

◆ back()

template<class Ns_ >
BaseReference raiigraph::Matrix< Ns_ >::View< BaseIterator, BaseReference >::back ( ) const
inline
Returns
Reference to the last element in the view.

◆ begin()

template<class Ns_ >
Iterator raiigraph::Matrix< Ns_ >::View< BaseIterator, BaseReference >::begin ( ) const
inline
Returns
Iterator to the start of this view.

◆ cbegin()

template<class Ns_ >
Iterator raiigraph::Matrix< Ns_ >::View< BaseIterator, BaseReference >::cbegin ( ) const
inline
Returns
Const iterator to the start of this view.

◆ cend()

template<class Ns_ >
Iterator raiigraph::Matrix< Ns_ >::View< BaseIterator, BaseReference >::cend ( ) const
inline
Returns
Const iterator to the end of this view.

◆ crbegin()

template<class Ns_ >
std::reverse_iterator< Iterator > raiigraph::Matrix< Ns_ >::View< BaseIterator, BaseReference >::crbegin ( ) const
inline
Returns
Reverse const iterator to the last element of this view.

◆ crend()

template<class Ns_ >
std::reverse_iterator< Iterator > raiigraph::Matrix< Ns_ >::View< BaseIterator, BaseReference >::crend ( ) const
inline
Returns
Reverse const iterator to a location before the start of this view.

◆ empty()

template<class Ns_ >
bool raiigraph::Matrix< Ns_ >::View< BaseIterator, BaseReference >::empty ( ) const
inline
Returns
Whether the view is empty.

◆ end()

template<class Ns_ >
Iterator raiigraph::Matrix< Ns_ >::View< BaseIterator, BaseReference >::end ( ) const
inline
Returns
Iterator to the end of this view.

◆ front()

template<class Ns_ >
BaseReference raiigraph::Matrix< Ns_ >::View< BaseIterator, BaseReference >::front ( ) const
inline
Returns
Reference to the first element in the view.

◆ operator[]()

Parameters
iIndex on the view (i.e., the column).
Returns
Reference to the value at i.

◆ rbegin()

template<class Ns_ >
std::reverse_iterator< Iterator > raiigraph::Matrix< Ns_ >::View< BaseIterator, BaseReference >::rbegin ( ) const
inline
Returns
Reverse const iterator to the last element of this view.

◆ rend()

template<class Ns_ >
std::reverse_iterator< Iterator > raiigraph::Matrix< Ns_ >::View< BaseIterator, BaseReference >::rend ( ) const
inline
Returns
Reverse const iterator to a location before the start of this view.

◆ size()

template<class Ns_ >
size_type raiigraph::Matrix< Ns_ >::View< BaseIterator, BaseReference >::size ( ) const
inline
Returns
Length of the view.

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