50 #ifndef TRISTRIP_GRAPH_ARRAY_H 51 #define TRISTRIP_GRAPH_ARRAY_H 60 template <
class nodetype,
class arctype>
95 arc(
const node_iterator & Initial,
const node_iterator & Terminal)
98 arc(
const node_iterator & Initial,
const node_iterator & Terminal,
const arctype & Elem)
124 out_arc_iterator
out_begin() {
return m_OutArcs.begin(); }
125 out_arc_iterator
out_end() {
return m_OutArcs.end(); }
126 const_out_arc_iterator
out_begin()
const {
return m_OutArcs.begin(); }
127 const_out_arc_iterator
out_end()
const {
return m_OutArcs.end(); }
130 nodetype * operator -> () {
return &
m_Elem; }
132 const nodetype * operator -> ()
const {
return &
m_Elem; }
134 nodetype & operator = (
const nodetype & Elem) {
return (
m_Elem = Elem); }
139 friend class std::vector<
node>;
155 void setsize(
const size_t NbNodes);
161 node_iterator
begin();
163 const_node_iterator
begin()
const;
164 const_node_iterator
end()
const;
166 node_reverse_iterator
rbegin();
167 node_reverse_iterator
rend();
168 const_node_reverse_iterator
rbegin()
const;
169 const_node_reverse_iterator
rend()
const;
175 void erase_arcs(
const node_iterator & Initial);
176 out_arc_iterator
erase_arc(
const out_arc_iterator &
Pos);
178 out_arc_iterator
insert_arc(
const nodeid & Initial,
const nodeid & Terminal);
179 out_arc_iterator
insert_arc(
const nodeid & Initial,
const nodeid & Terminal,
const arctype & Elem);
180 out_arc_iterator
insert_arc(
const node_iterator & Initial,
const node_iterator & Terminal);
181 out_arc_iterator
insert_arc(
const node_iterator & Initial,
const node_iterator & Terminal,
const arctype & Elem);
184 out_arc_iterator
insert(
const nodeid & Initial,
const nodeid & Terminal) {
return insert_arc(Initial, Terminal); }
185 out_arc_iterator
insert(
const nodeid & Initial,
const nodeid & Terminal,
const arctype & Elem) {
return insert_arc(Initial, Terminal, Elem); }
186 out_arc_iterator
insert(
const node_iterator & Initial,
const node_iterator & Terminal) {
return insert_arc(Initial, Terminal); }
187 out_arc_iterator
insert(
const node_iterator & Initial,
const node_iterator & Terminal,
const arctype & Elem) {
return insert_arc(Initial, Terminal, Elem); }
190 void swap(_mytype & Right);
204 template <
class nodetype,
class arctype>
207 template <
class nodetype,
class arctype>
210 template <
class nodetype,
class arctype>
220 template <
class nodetype,
class arctype>
224 template <
class nodetype,
class arctype>
228 template <
class nodetype,
class arctype>
236 template <
class nodetype,
class arctype>
242 template <
class nodetype,
class arctype>
248 template <
class nodetype,
class arctype>
255 template <
class nodetype,
class arctype>
259 if (i >=
size())
throw "graph_array<nodetype, arctype>::operator [] out of range";
265 template <
class nodetype,
class arctype>
269 if (i >=
size())
throw "graph_array<nodetype, arctype>::operator [] out of range";
275 template <
class nodetype,
class arctype>
281 template <
class nodetype,
class arctype>
287 template <
class nodetype,
class arctype>
293 template <
class nodetype,
class arctype>
299 template <
class nodetype,
class arctype>
305 template <
class nodetype,
class arctype>
311 template <
class nodetype,
class arctype>
317 template <
class nodetype,
class arctype>
323 template <
class nodetype,
class arctype>
329 template <
class nodetype,
class arctype>
335 template <
class nodetype,
class arctype>
341 template <
class nodetype,
class arctype>
344 Initial->m_OutArcs.push_back(
arc(Initial, Terminal));
345 return (--(Initial->m_OutArcs.end()));
349 template <
class nodetype,
class arctype>
352 Initial->m_OutArcs.push_back(
arc(Initial, Terminal, Elem));
353 return (--(Initial->m_OutArcs.end()));
357 template <
class nodetype,
class arctype>
360 return (Pos->initial()->m_OutArcs.erase(Pos));
364 template <
class nodetype,
class arctype>
366 m_NbArcs -= (Initial->m_OutArcs.size());
367 Initial->m_OutArcs.clear();
371 template <
class nodetype,
class arctype>
374 for (
nodeid i = 0;
i < this->Size(); ++
i)
379 template <
class nodetype,
class arctype>
391 template <
class nodetype,
class arctype>
396 for (node_it NodeIt = G.
begin(); NodeIt != G.
end(); ++NodeIt)
401 template <
class nodetype,
class arctype>
411 template <
class nodetype,
class arctype>
416 for (node_it NodeIt = G.
begin(); NodeIt != G.
end(); ++NodeIt)
out_arc_iterator insert(const nodeid &Initial, const nodeid &Terminal)
std::list< arc >::const_iterator const_out_arc_iterator
std::list< arc >::iterator out_arc_iterator
out_arc_iterator insert(const node_iterator &Initial, const node_iterator &Terminal)
arc(const node_iterator &Initial, const node_iterator &Terminal)
node_reverse_iterator rend()
std::vector< node > m_Nodes
void unmark_arcs_from_node(typename graph_array< nodetype, arctype >::node &N)
out_arc_iterator erase_arc(const out_arc_iterator &Pos)
size_t number_of_out_arcs() const
node_iterator terminal() const
node_iterator initial() const
node_reverse_iterator rbegin()
std::vector< node >::iterator node_iterator
out_arc_iterator insert(const nodeid &Initial, const nodeid &Terminal, const arctype &Elem)
std::list< arc > m_OutArcs
out_arc_iterator out_begin()
void setsize(const size_t NbNodes)
arc(const node_iterator &Initial, const node_iterator &Terminal, const arctype &Elem)
std::vector< node >::const_reverse_iterator const_node_reverse_iterator
out_arc_iterator out_end()
const_out_arc_iterator out_end() const
std::vector< node >::const_iterator const_node_iterator
void unmark_nodes(graph_array< nodetype, arctype > &G)
size_t number_of_arcs() const
out_arc_iterator insert(const node_iterator &Initial, const node_iterator &Terminal, const arctype &Elem)
node & operator[](const nodeid &i)
out_arc_iterator insert_arc(const nodeid &Initial, const nodeid &Terminal)
void unmark_arcs(graph_array< nodetype, arctype > &G)
const_out_arc_iterator out_begin() const
void swap(_mytype &Right)
std::vector< node >::reverse_iterator node_reverse_iterator
graph_array< nodetype, arctype > _mytype