12 namespace scaffold{
namespace filters {
15 template<
class Object>
17 bool operator()(
const Object& x)
const {
return true; }
24 const Set& filter_set;
29 filter_set(_filter_set), invert(_invert) {}
32 bool operator()(
const typename Set::key_type& e)
const {
33 return contains(filter_set, e) != invert;
39 template<
class Graph,
class Set>
41 const Set& filter_set;
47 filter_set(_filter_set), g(_g), invert(_invert) {}
49 bool operator()(
const Edge<Graph>& e)
const {
50 return contains(filter_set, Set::value_type(boost::source(e, g), boost::target(e, g))) != invert;
59 const Map& filter_map;
60 const typename Map::mapped_type& mapped_to;
64 map_filter(
const Map& _filter_map,
const typename Map::mapped_type& _mapped_to,
const bool _invert =
false):
65 filter_map(_filter_map), mapped_to(_mapped_to), invert(_invert) {}
67 bool operator()(
const typename Map::key_type& e)
const {
68 return (filter_map.at(e) == mapped_to) != invert;
contained_filter(const Set &_filter_set, const bool _invert=false)
constructor
Definition: filters.hpp:28
Definition: read_adj_list.hpp:22
dummy filter to always say YES
Definition: filters.hpp:16
map_filter(const Map &_filter_map, const typename Map::mapped_type &_mapped_to, const bool _invert=false)
constructor initializing the map, the element and inversion flag
Definition: filters.hpp:64
VP_contained_filter(const Set &_filter_set, const Graph &_g, const bool _invert=false)
constructor initalizing filter_set and invert
Definition: filters.hpp:46
filter to work with filtered graphs that is based on a set of vertices, passed to the constructor ...
Definition: filters.hpp:23
filter to work with filtered graphs that is based on a a mapping of vertices: filter all vertices map...
Definition: filters.hpp:58
filter to work with filtered graphs that is based on a set of VertexPairs, passed to the constructor ...
Definition: filters.hpp:40
bool contains(const Set &s, const Element &el)
a more readable containment check
Definition: utils.hpp:171