10 namespace scaffold{
namespace predicates {
13 template<
typename Element>
23 virtual bool operator()(
const Element& e)
const = 0;
28 template<
typename Element>
42 template<
typename Element,
typename Container = unordered_set<Element> >
55 Predicate<Element>(_invert), container(_container) {}
65 template<
typename Graph>
68 using Element = Edge<Graph>;
79 bool operator()(
const Element& e)
const
81 return (
invert != g[e].is_matching_edge());
91 template<
typename Graph,
typename Container = unordered_set<Vertex<Graph> > >
94 using Element = Edge<Graph>;
104 TargetContainedPredicate(
const Container& _container,
const Graph& _g,
const bool _invert =
false,
const bool _matching_OK =
true):
105 Predicate<Element>(_invert), container(_container), g(_g), matching_OK(_matching_OK) {}
107 bool operator()(
const Element& e)
const
109 if(!matching_OK && g[e].is_matching_edge())
return false;
an edge predicate that is true iff the given edge has its target (not) in a given set ...
Definition: predicates.hpp:92
an edge predicate that is true iff the given edge is (not) a matching edge
Definition: predicates.hpp:66
TargetContainedPredicate(const Container &_container, const Graph &_g, const bool _invert=false, const bool _matching_OK=true)
constructor
Definition: predicates.hpp:104
virtual bool operator()(const Element &e) const =0
all predicates must implement operator()
const Container & container
container reference
Definition: predicates.hpp:48
const Container & container
reference to the container
Definition: predicates.hpp:98
a predicate that is true iff the given element is (not) contained in a given container ...
Definition: predicates.hpp:43
const bool invert
indicate whether the predicate should be inverted
Definition: predicates.hpp:16
Definition: read_adj_list.hpp:22
prototype predicate
Definition: predicates.hpp:14
ContainedPredicate(const Container &_container, const bool _invert=false)
constructor
Definition: predicates.hpp:54
a predicate that always evaluates to true
Definition: predicates.hpp:29
MatchingPredicate(const Graph &_g, const bool _invert=false)
constructer
Definition: predicates.hpp:76
bool operator()(const Element &e) const
all predicates must implement operator()
Definition: predicates.hpp:34
bool operator()(const Element &e) const
all predicates must implement operator()
Definition: predicates.hpp:57
Predicate(const bool _invert=false)
constructor
Definition: predicates.hpp:19
const Graph & g
reference to the graph for which containment should be checked
Definition: predicates.hpp:72
bool contains(const Set &s, const Element &el)
a more readable containment check
Definition: utils.hpp:171
const Graph & g
reference to the graph
Definition: predicates.hpp:99
const bool matching_OK
indicate whether matching edges should be treated like any other edge (true) or always evaluate to fa...
Definition: predicates.hpp:100