Theoretica
A C++ numerical and automatic mathematical library
theoretica::mat_iterator< Matrix, ReturnType > Class Template Reference

A sequential iterator for matrices. More...

#include <mat.h>

Public Types

using iterator_category = std::forward_iterator_tag
 
using value_type = matrix_element_t< Matrix >
 
using pointer = value_type *
 
using reference = value_type &
 

Public Member Functions

 mat_iterator (Matrix &matrix, size_t row=0, size_t col=0)
 Construct iterator from a matrix.
 
ReturnType operator* ()
 Dereference the iterator to get the current element by reference.
 
mat_iteratoroperator++ ()
 Move to the next element in the matrix.
 
size_t row_index ()
 Get the index of the current row.
 
size_t col_index ()
 Get the index of the current column.
 
bool operator== (const mat_iterator &other) const
 Move to the previous element in the matrix.
 
bool operator!= (const mat_iterator &other) const
 

Detailed Description

template<typename Matrix, typename ReturnType = matrix_element_t<Matrix>&>
class theoretica::mat_iterator< Matrix, ReturnType >

A sequential iterator for matrices.

A const iterator may be constructed by specifying both typenames Matrix and ReturnType as const.


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