Construct version 5.4.4
An agent based modeling framework
graph_utils::row_begin_iterator< link_type > Struct Template Reference

An iterator that iterates over the start of each row. More...

Inheritance diagram for graph_utils::row_begin_iterator< link_type >:
Collaboration diagram for graph_utils::row_begin_iterator< link_type >:

Public Member Functions

full_row_iterator< link_type > full_begin (void)
 Returns a Graph::full_row_iterator starting at the beginning of the row being pointed to by this iterator.
 
full_row_iterator< link_type > begin (void)
 Same as row_begin_iterator::full_begin
 
sparse_row_iterator< link_type > sparse_begin (const link_type &data)
 Returns a Graph::sparse_row_iterator starting at the first element of the row being pointed to by this iterator that doesn't equal the skip value.
 
- Public Member Functions inherited from graph_utils::const_row_begin_iterator< link_type >
 const_row_begin_iterator (unsigned int row, const Graph< link_type > *parent, void *ptr)
 
unsigned int operator* (void) const
 Returns the row index of the iterator.
 
const_full_row_iterator< link_type > full_begin (void) const
 Returns a Graph::const_full_row_iterator starting at the beginning of the row being pointed to by this iterator.
 
const_full_row_iterator< link_type > begin () const
 Same as const_row_begin_iterator::full_begin
 
const_sparse_row_iterator< link_type > sparse_begin (const link_type &data) const
 Returns a Graph::const_sparse_row_iterator starting at the first element of the row being pointed to by this iterator that doesn't equal the skip value.
 
typeless_graph_iterator end (void) const
 Returns an iterator pointing to beyond the last row.
 
const const_row_begin_iteratoroperator++ (void) const
 Increments the iterator to point to the next row. More...
 
template<typename other , class output = decltype(other()* link_type())>
std::vector< output > ewise_product (const std::vector< other > &vec) const
 
template<typename other , class output = decltype(other()* link_type())>
std::vector< output > ewise_division (const std::vector< other > &vec) const
 
template<typename other , class output = decltype(other()* link_type())>
std::map< unsigned int, output > ewise_product (const std::map< unsigned int, other > &vec) const
 
template<class output = decltype(link_type() + link_type())>
output sum () const
 Sum all elements in the row. Return type for link_type = bool is integer.
 
std::vector< link_type > get_dense () const
 Creates a vector containing all elements in the row.
 
std::map< unsigned int, link_type > get_sparse (const link_type &skip) const
 Creates a map containing only elements in the row that do not equal the skip value.
 
- Public Member Functions inherited from graph_utils::col_graph_iterator< link_type >
unsigned int index () const noexcept
 Returns the row index of the iterator. More...
 
unsigned int max () const noexcept
 Returns the source dimension size. More...
 
const link_type & operator* (void) const
 If the entry exists, a reference to the value of the element being pointed to is returned, otherwise the default value is returned.
 
const link_type * operator-> (void) const
 If the entry exists, a pointer to the value of the element being pointed to is returned, otherwise a pointer to the default value is returned.
 
const link_type & examine (void) const
 Returns the value of the link the iterator is pointing to. More...
 
- Public Member Functions inherited from graph_utils::graph_iterator< link_type >
 graph_iterator (unsigned int row, unsigned int col, const Graph< link_type > *parent, void *ptr)
 
virtual const link_type & examine (void) const =0
 Returns the value of the link the iterator is pointing to. More...
 
- Public Member Functions inherited from typeless_graph_iterator
 typeless_graph_iterator (unsigned int row=0, unsigned int col=0, void *ptr=NULL)
 
unsigned int row (void) const noexcept
 The row index this iterator is pointing to.
 
unsigned int col (void) const noexcept
 The column index this iterator is pointing to.
 
virtual unsigned int index () const noexcept
 Depending on implementation, returns either row or col. More...
 
virtual unsigned int max () const noexcept
 Returns the maximum value that Construct can return. More...
 
virtual const typeless_graph_iteratoroperator++ (void) const
 Depending on implementation, increments the iterator to point to the next relevant element. More...
 

Additional Inherited Members

- Public Attributes inherited from graph_utils::graph_iterator< link_type >
Graph< link_type > * _parent = NULL
 
- Public Attributes inherited from typeless_graph_iterator
void * _ptr
 
unsigned int _row
 
unsigned int _col
 

Detailed Description

template<typename link_type>
struct graph_utils::row_begin_iterator< link_type >

An iterator that iterates over the start of each row.