All Classes Namespaces Files Functions Variables Typedefs Enumerations Friends Macros Pages
Classes | Public Types | Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | List of all members
paal::data_structures::simple_cycle< CycleEl, IdxT > Class Template Reference

This is the simplest implementation of the Cycle concept based on the list. More...

#include <simple_cycle.hpp>

Inheritance diagram for paal::data_structures::simple_cycle< CycleEl, IdxT >:
paal::data_structures::Simplecycle_start_from_last_change< CycleEl, IdxT >

Classes

class  edge_iterator
 Iterator on cycle edges. More...
 
class  vertex_iterator
 iterator over vertices of the cycle More...
 

Public Types

using cycle_el_pair = std::pair< CycleEl, CycleEl >
 
using cycle_element = CycleEl
 
using vertices = boost::iterator_range< vertex_iterator >
 
using edges = boost::iterator_range< edge_iterator >
 

Public Member Functions

template<typename Iter >
 simple_cycle (Iter begin, Iter end)
 constructor More...
 
void flip (const CycleEl &begin, const CycleEl &end)
 
std::size_t size () const
 number of elements in the cycle More...
 
CycleEl next (const CycleEl &ce) const
 next element in the cycle More...
 
vertex_iterator vbegin (const CycleEl &el) const
 begin of the vertices range starting at el More...
 
vertex_iterator vbegin () const
 begin of the vertices range More...
 
vertex_iterator vend () const
 end of the vertices range More...
 
vertices get_vertices_range (const CycleEl &el) const
 returns range of vertices starting at el More...
 
vertices get_vertices_range () const
 returns range of vertices More...
 
edges get_edge_range (const CycleEl &el) const
 returns edges range starting at el More...
 
edges get_edge_range () const
 returns edges range More...
 

Protected Types

using SorsMap = std::vector< IdxT >
 

Protected Member Functions

void link (IdxT x, IdxT y)
 connects two vertices represented by ids More...
 
void partial_reverse (IdxT x, IdxT y)
 after this operation links from x to y are connected i reverse order, after this function call cycle is in inconsistent state More...
 
IdxT to_idx (const CycleEl &ce) const
 vertex to idx More...
 
IdxT next_idx (IdxT i) const
 returns next idx in the cycle More...
 
IdxT prev_idx (IdxT i) const
 returns previous idx More...
 
const CycleEl & from_idx (IdxT i) const
 idx to vertex More...
 
IdxT add (const CycleEl &el)
 ads new element to cycle data structures More...
 

Protected Attributes

bimap< CycleEl, IdxT > m_cycle_idx
 mapping from elements to indexes
 
SorsMap m_predecessor_map
 predecessors
 
SorsMap m_successor_map
 successors
 

Detailed Description

template<typename CycleEl, typename IdxT = int>
class paal::data_structures::simple_cycle< CycleEl, IdxT >

This is the simplest implementation of the Cycle concept based on the list.

Template Parameters
CycleEl
IdxT

Definition at line 36 of file simple_cycle.hpp.

Constructor & Destructor Documentation

template<typename CycleEl , typename IdxT = int>
template<typename Iter >
paal::data_structures::simple_cycle< CycleEl, IdxT >::simple_cycle ( Iter  begin,
Iter  end 
)
inline

constructor

Template Parameters
Iter
Parameters
begin
end

Definition at line 48 of file simple_cycle.hpp.

Member Function Documentation

template<typename CycleEl , typename IdxT = int>
IdxT paal::data_structures::simple_cycle< CycleEl, IdxT >::add ( const CycleEl &  el)
inlineprotected

ads new element to cycle data structures

Parameters
el
Returns

Definition at line 447 of file simple_cycle.hpp.

template<typename CycleEl , typename IdxT = int>
void paal::data_structures::simple_cycle< CycleEl, IdxT >::flip ( const CycleEl &  begin,
const CycleEl &  end 
)
inline

after flip the order will be reversed, ie it will be from 'end' to 'begin'

Definition at line 70 of file simple_cycle.hpp.

template<typename CycleEl , typename IdxT = int>
const CycleEl& paal::data_structures::simple_cycle< CycleEl, IdxT >::from_idx ( IdxT  i) const
inlineprotected

idx to vertex

Parameters
i
Returns

Definition at line 438 of file simple_cycle.hpp.

template<typename CycleEl , typename IdxT = int>
edges paal::data_structures::simple_cycle< CycleEl, IdxT >::get_edge_range ( const CycleEl &  el) const
inline

returns edges range starting at el

Parameters
el
Returns

Definition at line 360 of file simple_cycle.hpp.

template<typename CycleEl , typename IdxT = int>
edges paal::data_structures::simple_cycle< CycleEl, IdxT >::get_edge_range ( ) const
inline

returns edges range

Returns

Definition at line 369 of file simple_cycle.hpp.

template<typename CycleEl , typename IdxT = int>
vertices paal::data_structures::simple_cycle< CycleEl, IdxT >::get_vertices_range ( const CycleEl &  el) const
inline

returns range of vertices starting at el

Parameters
el
Returns

Definition at line 230 of file simple_cycle.hpp.

template<typename CycleEl , typename IdxT = int>
vertices paal::data_structures::simple_cycle< CycleEl, IdxT >::get_vertices_range ( ) const
inline

returns range of vertices

Returns

Definition at line 239 of file simple_cycle.hpp.

template<typename CycleEl , typename IdxT = int>
void paal::data_structures::simple_cycle< CycleEl, IdxT >::link ( IdxT  x,
IdxT  y 
)
inlineprotected

connects two vertices represented by ids

Parameters
x
y

Definition at line 380 of file simple_cycle.hpp.

template<typename CycleEl , typename IdxT = int>
CycleEl paal::data_structures::simple_cycle< CycleEl, IdxT >::next ( const CycleEl &  ce) const
inline

next element in the cycle

Parameters
ce
Returns

Definition at line 95 of file simple_cycle.hpp.

template<typename CycleEl , typename IdxT = int>
IdxT paal::data_structures::simple_cycle< CycleEl, IdxT >::next_idx ( IdxT  i) const
inlineprotected

returns next idx in the cycle

Parameters
i
Returns

Definition at line 420 of file simple_cycle.hpp.

template<typename CycleEl , typename IdxT = int>
void paal::data_structures::simple_cycle< CycleEl, IdxT >::partial_reverse ( IdxT  x,
IdxT  y 
)
inlineprotected

after this operation links from x to y are connected i reverse order, after this function call cycle is in inconsistent state

Parameters
x
y

Definition at line 392 of file simple_cycle.hpp.

template<typename CycleEl , typename IdxT = int>
IdxT paal::data_structures::simple_cycle< CycleEl, IdxT >::prev_idx ( IdxT  i) const
inlineprotected

returns previous idx

Parameters
i
Returns

Definition at line 429 of file simple_cycle.hpp.

template<typename CycleEl , typename IdxT = int>
std::size_t paal::data_structures::simple_cycle< CycleEl, IdxT >::size ( ) const
inline

number of elements in the cycle

Returns

Definition at line 86 of file simple_cycle.hpp.

template<typename CycleEl , typename IdxT = int>
IdxT paal::data_structures::simple_cycle< CycleEl, IdxT >::to_idx ( const CycleEl &  ce) const
inlineprotected

vertex to idx

Parameters
ce
Returns

Definition at line 411 of file simple_cycle.hpp.

template<typename CycleEl , typename IdxT = int>
vertex_iterator paal::data_structures::simple_cycle< CycleEl, IdxT >::vbegin ( const CycleEl &  el) const
inline

begin of the vertices range starting at el

Parameters
el
Returns

Definition at line 205 of file simple_cycle.hpp.

template<typename CycleEl , typename IdxT = int>
vertex_iterator paal::data_structures::simple_cycle< CycleEl, IdxT >::vbegin ( ) const
inline

begin of the vertices range

Returns

Definition at line 214 of file simple_cycle.hpp.

template<typename CycleEl , typename IdxT = int>
vertex_iterator paal::data_structures::simple_cycle< CycleEl, IdxT >::vend ( ) const
inline

end of the vertices range

Returns

Definition at line 221 of file simple_cycle.hpp.


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