39# ifndef TPL_TEST_CYCLE_H
40# define TPL_TEST_CYCLE_H
111template <AlephGraph GT, ArcFilter<GT> SA = Dft_Show_Arc<GT>>
141 std::optional<Frame> here(std::in_place, curr,
sa);
144 if (
auto tgt = here->template next_target<Test_Cycle>(
src))
150 frames.
push(std::move(*here));
151 here.emplace(tgt,
sa);
160 Frame & f = frames.
top();
162 if (
auto tgt = f.template next_target<Test_Cycle>(
src))
168 here.emplace(tgt,
sa);
180 <<
"Test_For_Cycle: source node cannot be null";
191 typename GT::Arc * arc = it.get_current_arc_ne();
Exception handling system with formatted messages for Aleph-w.
#define ah_invalid_argument_if(C)
Throws std::invalid_argument if condition holds.
C++20 concepts for the protocol shared by graph algorithms.
Stack of the frames of a depth-first search that does not recurse.
T & push(Args &&...args)
Builds a frame on top of the stack.
bool is_empty() const noexcept
Whether the stack has no frames.
T & top() noexcept
The top frame; the stack must not be empty.
void pop() noexcept
Destroys the top frame; the stack must not be empty.
void next_ne() noexcept(shows_ne)
Advances the iterator to the next filtered element, as next() does.
Test whether a cycle is reachable from a given node.
bool test_cycle(typename GT::Node *curr) const
bool test_cycle(const GT &g, typename GT::Node *s) const
Test_For_Cycle(SA arc_filter=SA())
Construct a cycle tester with optional arc filter.
bool operator()(const GT &g, typename GT::Node *src_node) const
Test whether a cycle is reachable from the given source node.
void reset_bit_nodes(int bit) const noexcept
Reset bit to zero for all the nodes of graph.
void reset_bit_arcs(int bit) const noexcept
Reset bit to zero for all the arcs of graph.
#define IS_NODE_VISITED(p, bit)
Determine whether the control bit is set or not to one.
#define ARC_BITS(p)
Return the control bits of arc p.
#define IS_ARC_VISITED(p, bit)
Determine whether the bit field is or not set to one.
#define NODE_BITS(p)
Get the control bits of a node.
Main namespace for Aleph-w library functions.
The next arc of a node to look at, for a depth-first search that keeps only that in a frame.
Filtered iterator of adjacent arcs of a node.
Stack of the frames of a depth-first search that does not recurse.
Generic graph and digraph implementations.