10 #ifndef TRI_STRIPPER_HEADER_GUARD_GRAPH_ARRAY_H 11 #define TRI_STRIPPER_HEADER_GUARD_GRAPH_ARRAY_H 30 template <
class nodetype>
59 arc(node_iterator Terminal);
79 bool out_empty()
const;
80 size_t out_size()
const;
82 out_arc_iterator out_begin();
83 out_arc_iterator out_end();
84 const_out_arc_iterator out_begin()
const;
85 const_out_arc_iterator out_end()
const;
88 value_type * operator -> ();
90 const value_type * operator -> ()
const;
92 value_type &
operator = (
const value_type & Elem);
96 friend class std::vector<
node>;
98 node(arc_list & Arcs);
119 node_iterator
begin();
121 const_node_iterator
begin()
const;
122 const_node_iterator
end()
const;
124 node_reverse_iterator
rbegin();
125 node_reverse_iterator
rend();
126 const_node_reverse_iterator
rbegin()
const;
127 const_node_reverse_iterator
rend()
const;
130 out_arc_iterator
insert_arc(nodeid Initial, nodeid Terminal);
131 out_arc_iterator
insert_arc(node_iterator Initial, node_iterator Terminal);
134 void swap(graph_type & Right);
135 friend void swap(graph_type & Left, graph_type & Right) { Left.
swap(Right); }
148 template <
class nodetype>
179 m_Begin(
std::numeric_limits<size_t>::
max()),
180 m_End(
std::numeric_limits<size_t>::
max()),
300 m_Arcs.reserve(NbNodes * 2);
307 return m_Nodes.
empty();
314 return m_Nodes.size();
339 return m_Nodes.
begin();
346 return m_Nodes.end();
353 return m_Nodes.
begin();
360 return m_Nodes.end();
374 return m_Nodes.
rend();
388 return m_Nodes.
rend();
395 assert(Initial <
size());
396 assert(Terminal <
size());
398 return insert_arc(m_Nodes.begin() + Initial, m_Nodes.begin() + Terminal);
405 assert((Initial >= begin()) && (Initial <
end()));
406 assert((Terminal >= begin()) && (Terminal <
end()));
408 node & Node = * Initial;
410 if (Node.out_empty()) {
412 Node.m_Begin = m_Arcs.size();
413 Node.m_End = m_Arcs.size() + 1;
419 assert(Node.m_End == m_Arcs.size());
424 m_Arcs.push_back(arc(Terminal));
434 std::swap(m_Nodes, Right.
m_Nodes);
435 std::swap(m_Arcs, Right.
m_Arcs);
460 #endif // TRI_STRIPPER_HEADER_GUARD_GRAPH_ARRAY_H
void unmark_nodes(graph_array< N > &G)
node_vector::reverse_iterator node_reverse_iterator
graph_type & operator=(const graph_type &)
out_arc_iterator out_begin()
node_iterator terminal() const
graph_array< nodetype > graph_type
node_vector::const_reverse_iterator const_node_reverse_iterator
node_reverse_iterator rend()
value_type & operator=(const value_type &Elem)
void swap(graph_type &Right)
friend void swap(graph_type &Left, graph_type &Right)
value_type * operator->()
arc_list::iterator out_arc_iterator
std::vector< node > node_vector
arc(node_iterator Terminal)
std::vector< arc > arc_list
out_arc_iterator out_end()
node_vector::iterator node_iterator
float operator*(float a, const half &b)
out_arc_iterator insert_arc(nodeid Initial, nodeid Terminal)
arc_list::const_iterator const_out_arc_iterator
node_reverse_iterator rbegin()
node_vector::const_iterator const_node_iterator
node & operator[](nodeid i)
void unmark_nodes(graph_array< nodetype > &G)