27 # ifndef TPL_TEST_ACYCLIQUE_H 28 # define TPL_TEST_ACYCLIQUE_H 53 template <
class GT,
class SA = Dft_Show_Arc<GT>>
58 bool is_acyclique(
typename GT::Node * curr)
63 NODE_BITS(curr).set_bit(Test_Cycle,
true);
67 typename GT::Arc * arc = i.get_current_arc_ne();
71 ARC_BITS(arc).set_bit(Test_Cycle,
true);
73 if (not is_acyclique(i.get_tgt_node()))
82 bool is_acyclique(GT & g,
size_t num_arcs)
85 throw std::domain_error(
"is_graph_acyclique() does not work for digraps");
87 if (num_arcs >= g.get_num_nodes())
90 g.reset_bit_arcs(Test_Cycle);
91 g.reset_bit_nodes(Test_Cycle);
93 for (
typename GT::Node_Iterator it(g); it.has_curr(); it.next_ne())
95 typename GT::Node * curr = it.get_current_node_ne();
99 if (not is_acyclique(curr))
133 return is_acyclique(g, num_arcs);
153 return is_acyclique(g, g.get_num_arcs());
176 template <
class GT,
class SA = Dft_Show_Arc<GT>>
183 Has_Cycle(SA && __sa = SA()) : sa(__sa) { }
233 # endif // TPL_TEST_ACYCLIQUE_H Definition: tpl_test_acyclique.H:177
#define IS_NODE_VISITED(p, bit)
Definition: aleph-graph.H:327
#define IS_ARC_VISITED(p, bit)
Definition: aleph-graph.H:360
bool operator()(GT &g, size_t num_arcs)
Definition: tpl_test_acyclique.H:131
#define NODE_BITS(p)
Definition: aleph-graph.H:305
Definition: tpl_test_acyclique.H:54
#define ARC_BITS(p)
Definition: aleph-graph.H:351
Definition: tpl_graph.H:1177