19#include "digikam_config.h"
23# pragma warning(disable : 4267)
26#if !defined(Q_OS_DARWIN) && defined(Q_CC_GNU)
27# pragma GCC diagnostic push
28# pragma GCC diagnostic ignored "-Wdeprecated-declarations"
29# pragma GCC diagnostic ignored "-Wunused-local-typedefs"
32#if defined(Q_CC_CLANG)
33# pragma clang diagnostic push
34# pragma clang diagnostic ignored "-Wdeprecated-declarations"
35# pragma clang diagnostic ignored "-Wdeprecated-builtins"
36# pragma clang diagnostic ignored "-Wundef"
37# pragma clang diagnostic ignored "-Wunused-parameter"
38# pragma clang diagnostic ignored "-Wcast-align"
39# pragma clang diagnostic ignored "-Wunused-local-typedef"
40# pragma clang diagnostic ignored "-Wambiguous-reversed-operator"
56#define BOOST_BIND_GLOBAL_PLACEHOLDERS
57#define BOOST_ALLOW_DEPRECATED_HEADERS
59#include <boost/graph/transitive_closure.hpp>
60#include <boost/graph/adjacency_list.hpp>
61#include <boost/graph/topological_sort.hpp>
62#include <boost/graph/graph_utility.hpp>
63#include <boost/graph/dag_shortest_paths.hpp>
64#include <boost/graph/dijkstra_shortest_paths.hpp>
65#include <boost/graph/reverse_graph.hpp>
66#include <boost/graph/dominator_tree.hpp>
67#include <boost/graph/depth_first_search.hpp>
68#include <boost/graph/breadth_first_search.hpp>
69#include <boost/graph/transitive_reduction.hpp>
86 BOOST_INSTALL_PROPERTY(vertex, properties);
87 BOOST_INSTALL_PROPERTY(edge, properties);
97template <
typename Key,
typename Value>
125template <
class VertexProperties,
class EdgeProperties>
130 typedef boost::adjacency_list<
133 boost::bidirectionalS,
134 boost::property<boost::vertex_index_t, int,
135 boost::property<vertex_properties_t, VertexProperties> >,
136 boost::property<edge_properties_t, EdgeProperties>
144 typedef typename graph_traits::vertex_descriptor
vertex_t;
145 typedef typename graph_traits::edge_descriptor
edge_t;
152 typedef typename boost::inv_adjacency_iterator_generator<
GraphContainer,
156 typedef typename graph_traits::degree_size_type
degree_t;
164 typedef typename boost::property_map<GraphContainer, boost::vertex_index_t>::type
vertex_index_map_t;
219 return (v == graph_traits::null_vertex());
227 class DIGIKAM_DATABASE_EXPORT
Edge
307 direction(g.direction)
333 Vertex v = boost::add_vertex(graph);
341 setProperties(v, properties);
353 boost::clear_vertex(v, graph);
354 boost::remove_vertex(v, graph);
359 Edge e = edge(v1, v2);
363 e = boost::add_edge(v1, v2, graph).first;
371 std::pair<edge_t, bool> pair = boost::edge(v1, v2, graph);
383 return boost::edge(v1, v2, graph).second;
390 if (boost::edge(v1, v2, graph).second)
395 if (boost::edge(v2, v1, graph).second)
428 for (
vertex_iter it = range.first ; it != range.second ; ++it)
430 const VertexProperties& props = properties(*it);
445 Edge e = edge(v1, v2);
449 return EdgeProperties();
452 return properties(e);
475 return toVertexList(boost::vertices(graph));
480 OutboundEdges = 1 << 0,
481 InboundEdges = 1 << 1,
485 EdgesToLeaf = 1 << 2,
486 EdgesToRoot = 1 << 3,
487 AllEdges = InboundEdges | OutboundEdges
492 if (flags & EdgesToLeaf)
498 if (flags & EdgesToRoot)
504 QList<Vertex> verticesLst;
506 if (flags & OutboundEdges)
508 verticesLst << toVertexList(boost::adjacent_vertices(v, graph));
511 if (flags & InboundEdges)
513 verticesLst << toVertexList(boost::inv_adjacent_vertices(v, graph));
523 return (
int)boost::num_vertices(graph);
528 return isEmptyRange(boost::vertices(graph));
533 return (
int)boost::out_degree(v, graph);
538 return boost::in_degree(v, graph);
543 return !hasEdges(v, EdgesToRoot);
548 return !hasEdges(v, EdgesToLeaf);
553 return boost::source(e.
toEdge(), graph);
558 return boost::target(e.
toEdge(), graph);
563 if (flags & EdgesToLeaf)
569 if (flags & EdgesToRoot)
577 if (flags & OutboundEdges)
579 es << toEdgeList(boost::out_edges(v, graph));
582 if (flags & InboundEdges)
584 es << toEdgeList(boost::in_edges(v, graph));
592 return boost::num_edges(graph);
597 if (flags & EdgesToLeaf)
603 if (flags & EdgesToRoot)
609 if (flags & OutboundEdges)
611 if (!isEmptyRange(boost::out_edges(v, graph)))
617 if (flags & InboundEdges)
619 if (!isEmptyRange(boost::in_edges(v, graph)))
630 return !isEmptyRange(boost::edges(graph));
635 return toEdgeList(boost::edges(graph));
640 QList<VertexPair> pairs;
643 for (
edge_iter it = range.first ; it != range.second ; ++it)
645 pairs <<
VertexPair(boost::source(*it, graph), boost::target(*it, graph));
658 std::list<Vertex> verticesLst;
662 boost::topological_sort(graph, std::back_inserter(verticesLst));
664 catch (boost::bad_graph& e)
666 qCDebug(DIGIKAM_DATABASE_LOG) << e.what();
668 return QList<Vertex>();
671 typedef typename std::list<Vertex>::iterator vertex_list_iter;
673 return toVertexList(std::pair<vertex_list_iter, vertex_list_iter>(verticesLst.begin(), verticesLst.end()));
678 CopyVertexProperties = 1 << 0,
679 CopyEdgeProperties = 1 << 1,
680 CopyAllProperties = CopyVertexProperties | CopyEdgeProperties
692 std::vector<vertex_t> copiedVertices(vertexCount(),
Vertex());
697 boost::transitive_closure(
700 orig_to_copy(make_iterator_property_map(copiedVertices.begin(),
701 get(boost::vertex_index, graph)))
704 catch (boost::bad_graph& e)
706 qCDebug(DIGIKAM_DATABASE_LOG) << e.what();
711 copyProperties(closure, flags, copiedVertices);
722 std::vector<vertex_t> copiedVertices(vertexCount(),
Vertex());
729 boost::transitive_reduction(graph, reduction.
graph,
730 make_iterator_property_map(copiedVertices.begin(), get(boost::vertex_index, graph)),
731 get(boost::vertex_index, graph));
733 catch (boost::bad_graph& e)
735 qCDebug(DIGIKAM_DATABASE_LOG) << e.what();
740 copyProperties(reduction, flags, copiedVertices);
744 *removedEdges = edgeDifference(reduction, copiedVertices);
756 return findZeroDegree(direction ==
ParentToChild ?
true :
false);
766 return findZeroDegreeFrom(v, direction ==
ParentToChild ?
true :
false);
775 return findZeroDegree((direction ==
ParentToChild) ?
false :
true);
780 return findZeroDegreeFrom(v, (direction ==
ParentToChild) ?
false :
true);
796 return longestPathTouching(v, alwaysFalse<Vertex>);
799 template <
typename LessThan>
804 return QList<Vertex>();
807 QList<Vertex> fromRoot;
808 QList<Vertex> toLeave;
811 path.
longestPath(boost::make_reverse_graph(graph), v);
813 QList<Vertex> rootCandidates = mostRemoteNodes(path.
distances);
815 if (!rootCandidates.isEmpty())
817 std::stable_sort(rootCandidates.begin(), rootCandidates.end(), lessThan);
818 Vertex root = rootCandidates.first();
824 QList<Vertex> leaveCandidates = mostRemoteNodes(path.
distances);
826 if (!leaveCandidates.isEmpty())
828 std::stable_sort(leaveCandidates.begin(), leaveCandidates.end(), lessThan);
829 Vertex leave = leaveCandidates.first();
835 return (fromRoot << v << toLeave);
839 return (toLeave << v << fromRoot);
853 return QList<Vertex>();
856 QList<Vertex> verticesLst;
864 verticesLst.prepend(v1);
875 verticesLst.append(v2);
901 typename QMap<Vertex, int>::iterator it;
905 if (it.value() == std::numeric_limits<int>::max())
929 if (v.
isNull() || isEmpty())
931 return QList<Vertex>();
936 if (order == BreadthFirstOrder)
945 return verticesDominatedBy(v, root, search.
vertices);
953 template <
typename LessThan>
956 LessThan lessThan)
const
958 return verticesDominatedBy(v, root, verticesDepthFirstSorted(root, lessThan));
970 const QList<Vertex>& presortedVertices)
const
972 if (v.
isNull() || isEmpty())
974 return QList<Vertex>();
978 tree.
enter(graph, root, direction);
980 QList<Vertex> dominatedTree = treeFromPredecessors(v, tree.
predecessors);
984 QList<Vertex> orderedTree;
986 for (
const Vertex& vv : std::as_const(presortedVertices))
988 if (dominatedTree.contains(vv))
1006 return QList<Vertex>();
1013 ref = roots().first();
1016 QList<Vertex> verticesLst;
1017 verticesLst << rootsOf(ref);
1019 if (verticesLst.size() == vertexCount())
1026 QList<Vertex> bfs = search.verticesLst;
1028 for (
const Vertex& v : std::as_const(verticesLst))
1035 if (verticesLst.size() == vertexCount())
1044 for (
vertex_iter it = range.first ; it != range.second ; ++it)
1046 if (!verticesLst.contains(*it))
1050 QList<Vertex> childBfs = childSearch.
vertices;
1051 QList<Vertex> toInsert;
1055 int minIndex = verticesLst.size();
1057 for (
const Vertex& c : std::as_const(childBfs))
1059 int foundAt = verticesLst.indexOf(c);
1067 minIndex = qMin(foundAt, minIndex);
1071 for (
const Vertex& c : std::as_const(toInsert))
1073 verticesLst.insert(minIndex++, c);
1087 template <
typename LessThan>
1092 return QList<Vertex>();
1099 ref = roots().first();
1102 QList<Vertex> verticesLst;
1103 verticesLst = rootsOf(ref);
1105 if ((verticesLst.size() == vertexCount()) || verticesLst.isEmpty())
1112 QList<Vertex> dfs = search.
vertices;
1114 for (
const Vertex& v : std::as_const(verticesLst))
1128 QList<Vertex> verticesLst;
1130 treeFromPredecessorsRecursive(v, verticesLst, predecessors);
1136 QList<Vertex>& vertices,
1139 QList<Vertex> children = predecessors.keys(v);
1140 vertices << children;
1142 for (
const Vertex& child : std::as_const(children))
1144 treeFromPredecessorsRecursive(child, vertices, predecessors);
1151 template <
typename Value,
typename range_t>
1152 static QList<Value>
toList(
const range_t& range)
1154 typedef typename range_t::first_type iterator_t;
1157 for (iterator_t it = range.first ; it != range.second ; ++it)
1165 template <
typename range_t>
static QList<Vertex>
toVertexList(
const range_t& range)
1167 return toList<Vertex, range_t>(range);
1170 template <
typename range_t>
static QList<Edge>
toEdgeList(
const range_t& range)
1172 return toList<Edge, range_t>(range);
1175 template <
typename range_t>
1178 return (range.first == range.second);
1189 if (flags & CopyVertexProperties)
1194 for (
vertex_iter it = range.first ; it != range.second ; ++it)
1196 Vertex copiedVertex = copiedVertices[boost::get(indexMap, *it)];
1198 if (copiedVertex.
isNull())
1207 if (flags & CopyEdgeProperties)
1212 for (
edge_iter it = range.first ; it != range.second ; ++it)
1214 Vertex s = boost::source(*it, graph);
1215 Vertex t = boost::target(*it, graph);
1216 Vertex copiedS = copiedVertices[boost::get(indexMap, s)];
1217 Vertex copiedT = copiedVertices[boost::get(indexMap, t)];
1224 Edge copiedEdge = other.
edge(copiedS, copiedT);
1226 if (!copiedEdge.
isNull())
1240 QList<Edge> removed;
1244 for (
edge_iter it = range.first ; it != range.second ; ++it)
1246 Vertex s = boost::source(*it, graph);
1247 Vertex t = boost::target(*it, graph);
1248 Vertex copiedS = copiedVertices[boost::get(indexMap, s)];
1249 Vertex copiedT = copiedVertices[boost::get(indexMap, t)];
1256 Edge copiedEdge = other.
edge(copiedS, copiedT);
1272 QList<Vertex> verticesLst;
1275 for (
vertex_iter it = range.first ; it != range.second ; ++it)
1277 if ((inOrOut ? in_degree(*it, graph)
1278 : out_degree(*it, graph)) == 0)
1293 invertGraph = !invertGraph;
1299 QList<Vertex> verticesLst;
1303 if ((inOrOut ? in_degree(candidate, graph)
1304 : out_degree(candidate, graph)) == 0)
1306 verticesLst << candidate;
1321 template <
class GraphType>
1328 boost::dag_shortest_paths(
1333 weight_map(boost::ref_property_map<
typename boost::graph_traits<GraphType>::edge_descriptor,
int>(weight)).
1341 catch (boost::bad_graph& e)
1343 qCDebug(DIGIKAM_DATABASE_LOG) << e.what();
1347 template <
class GraphType>
1354 boost::dag_shortest_paths(
1359 weight_map(boost::ref_property_map<
typename boost::graph_traits<GraphType>::edge_descriptor,
int>(weight)).
1363 distance_compare(std::greater<int>()).
1375 catch (boost::bad_graph& e)
1377 qCDebug(DIGIKAM_DATABASE_LOG) << e.what();
1383 return (predecessors.value(v, v) != v);
1394 template <
class GraphType>
1405 boost::lengauer_tarjan_dominator_tree(boost::make_reverse_graph(graph), v,
1409 catch (boost::bad_graph& e)
1411 qCDebug(DIGIKAM_DATABASE_LOG) << e.what();
1422 template <
class GraphType>
1433 boost::depth_first_search(boost::make_reverse_graph(graph), visitor(vis).root_vertex(v));
1437 boost::depth_first_search(graph, visitor(vis).root_vertex(v));
1440 catch (boost::bad_graph& e)
1442 qCDebug(DIGIKAM_DATABASE_LOG) << e.what();
1446 template <
class GraphType,
typename LessThan>
1452 std::vector<boost::default_color_type> color_vec(boost::num_vertices(graph), boost::white_color);
1458 depth_first_search_sorted(boost::make_reverse_graph(graph), v, vis,
1459 make_iterator_property_map(color_vec.begin(), get(boost::vertex_index, graph)), lessThan);
1463 depth_first_search_sorted(graph, v, vis,
1464 make_iterator_property_map(color_vec.begin(), get(boost::vertex_index, graph)), lessThan);
1467 catch (boost::bad_graph& e)
1469 qCDebug(DIGIKAM_DATABASE_LOG) << e.what();
1473 template <
class GraphType>
1482 boost::breadth_first_search(boost::make_reverse_graph(graph), v, visitor(vis));
1486 boost::breadth_first_search(graph, v, visitor(vis));
1489 catch (boost::bad_graph& e)
1491 qCDebug(DIGIKAM_DATABASE_LOG) << e.what();
1522 template <
typename VertexType,
typename GraphType>
1539 template <
typename VertexType,
typename GraphType>
1550 template <
class GraphType,
typename VertexLessThan>
1553 typedef typename boost::graph_traits<GraphType>::edge_descriptor edge_descriptor;
1559 vertexLessThan(vertexLessThan)
1563 bool operator()(
const edge_descriptor& a,
const edge_descriptor& b)
1565 return vertexLessThan(boost::target(a, g), boost::target(b, g));
1577 template <
class Inc
idenceGraph,
class DFSVisitor,
class ColorMap,
typename LessThan>
1587 typedef typename boost::graph_traits<IncidenceGraph>::edge_descriptor edge_descriptor;
1588 QList<edge_descriptor> outEdges;
1592 boost::put(color, u, boost::gray_color);
1593 vis.discover_vertex(u, g);
1595 outEdges = toList<edge_descriptor>(boost::out_edges(u, g));
1601 std::sort(outEdges.begin(),
1605 for (
const edge_descriptor& e : std::as_const(outEdges))
1607 Vertex v = boost::target(e, g);
1608 vis.examine_edge(e, g);
1609 boost::default_color_type v_color = boost::get(color, v);
1611 if (v_color == boost::white_color)
1613 vis.tree_edge(e, g);
1614 depth_first_search_sorted(g, v, vis, color, lessThan);
1616 else if (v_color == boost::gray_color)
1618 vis.back_edge(e, g);
1622 vis.forward_or_cross_edge(e, g);
1626 put(color, u, boost::black_color);
1627 vis.finish_vertex(u, g);
1636 typename VertexIntMap::const_iterator it;
1638 QList<Vertex> candidates;
1640 for (it = distances.begin() ; it != distances.end() ; ++it)
1642 if (it.value() > maxDist)
1644 maxDist = it.value();
1651 if (it.value() >= maxDist)
1656 candidates << it.key();
1683 QList<Vertex> verticesLst;
1685 for (
Vertex v = root ; v != target ; v = predecessors.value(v))
1692 verticesLst.append(v);
1696 verticesLst.prepend(v);
1702 if (predecessors.value(v) == v)
1721#if !defined(Q_OS_DARWIN) && defined(Q_CC_GNU)
1722# pragma GCC diagnostic pop
1725#if defined(Q_CC_CLANG)
1726# pragma clang diagnostic pop
Definition itemhistorygraph_boost.h:1391
VertexVertexMap predecessors
Definition itemhistorygraph_boost.h:1415
void enter(const GraphType &graph, const Vertex &v, MeaningOfDirection direction=ParentToChild)
Definition itemhistorygraph_boost.h:1395
Definition itemhistorygraph_boost.h:228
Edge(const edge_t &e)
Definition itemhistorygraph_boost.h:234
edge_t e
Definition itemhistorygraph_boost.h:280
bool operator==(const edge_t &other) const
Definition itemhistorygraph_boost.h:268
const edge_t & toEdge() const
Definition itemhistorygraph_boost.h:258
Edge & operator=(const edge_t &other)
Definition itemhistorygraph_boost.h:240
bool isNull() const
Definition itemhistorygraph_boost.h:273
edge_t & toEdge()
Definition itemhistorygraph_boost.h:263
Definition itemhistorygraph_boost.h:1531
void discover_vertex(VertexType u, const GraphType &) const
Definition itemhistorygraph_boost.h:1540
BreadthFirstSearchVisitor(GraphSearch *const q)
Definition itemhistorygraph_boost.h:1534
Definition itemhistorygraph_boost.h:1496
CommonVisitor(GraphSearch *const qq)
Definition itemhistorygraph_boost.h:1499
void record(const Vertex &v) const
Definition itemhistorygraph_boost.h:1504
Definition itemhistorygraph_boost.h:1514
void discover_vertex(VertexType u, const GraphType &) const
Definition itemhistorygraph_boost.h:1523
DepthFirstSearchVisitor(GraphSearch *const q)
Definition itemhistorygraph_boost.h:1517
Definition itemhistorygraph_boost.h:1552
VertexLessThan vertexLessThan
Definition itemhistorygraph_boost.h:1571
bool operator()(const edge_descriptor &a, const edge_descriptor &b)
Definition itemhistorygraph_boost.h:1563
lessThanMapEdgeToTarget(const GraphType &gg, VertexLessThan vertexLessThan)
Definition itemhistorygraph_boost.h:1557
const GraphType & g
Definition itemhistorygraph_boost.h:1570
Definition itemhistorygraph_boost.h:1419
void depth_first_search_sorted(const IncidenceGraph &g, Vertex u, DFSVisitor &vis, ColorMap color, LessThan lessThan)
Definition itemhistorygraph_boost.h:1578
QList< Vertex > vertices
Definition itemhistorygraph_boost.h:1546
void depthFirstSearchSorted(const GraphType &graph, const Vertex &v, bool invertGraph, LessThan lessThan)
Definition itemhistorygraph_boost.h:1447
void breadthFirstSearch(const GraphType &graph, const Vertex &v, bool invertGraph)
Definition itemhistorygraph_boost.h:1474
void depthFirstSearch(const GraphType &graph, const Vertex &v, bool invertGraph)
Definition itemhistorygraph_boost.h:1423
Definition itemhistorygraph_boost.h:1318
VertexIntMap distances
Definition itemhistorygraph_boost.h:1387
VertexVertexMap predecessors
Definition itemhistorygraph_boost.h:1386
void longestPath(const GraphType &graph, const Vertex &v)
Definition itemhistorygraph_boost.h:1348
bool isReachable(const Vertex &v) const
Definition itemhistorygraph_boost.h:1381
void shortestPath(const GraphType &graph, const Vertex &v)
Definition itemhistorygraph_boost.h:1322
Definition itemhistorygraph_boost.h:176
Vertex & operator=(const vertex_t &other)
Definition itemhistorygraph_boost.h:190
bool operator!=(const vertex_t &other) const
Definition itemhistorygraph_boost.h:212
Vertex()
Definition itemhistorygraph_boost.h:179
vertex_t v
Definition itemhistorygraph_boost.h:224
Vertex(const vertex_t &vv)
Definition itemhistorygraph_boost.h:185
bool operator==(const vertex_t &other) const
Definition itemhistorygraph_boost.h:207
bool isNull() const
Definition itemhistorygraph_boost.h:217
Definition itemhistorygraph_boost.h:127
std::pair< vertex_iter, vertex_iter > vertex_range_t
Definition itemhistorygraph_boost.h:161
void clear()
Definition itemhistorygraph_boost.h:326
boost::adjacency_list< boost::vecS, boost::vecS, boost::bidirectionalS, boost::property< boost::vertex_index_t, int, boost::property< vertex_properties_t, VertexProperties > >, boost::property< edge_properties_t, EdgeProperties > > GraphContainer
Definition itemhistorygraph_boost.h:137
QList< Vertex > findZeroDegreeFrom(const Vertex &v, bool inOrOut) const
Definition itemhistorygraph_boost.h:1287
QList< Vertex > longestPathTouching(const Vertex &v) const
Definition itemhistorygraph_boost.h:794
QMapForAdaptors< Vertex, Vertex > VertexVertexMap
Definition itemhistorygraph_boost.h:292
const EdgeProperties & properties(const Edge &e) const
Definition itemhistorygraph_boost.h:455
Graph(const Graph &g)
Definition itemhistorygraph_boost.h:305
QList< Vertex > verticesDominatedBy(const Vertex &v, const Vertex &root, const QList< Vertex > &presortedVertices) const
Definition itemhistorygraph_boost.h:968
QList< Vertex > roots() const
Definition itemhistorygraph_boost.h:754
QList< Vertex > verticesDepthFirstSorted(const Vertex &givenRef, LessThan lessThan) const
Definition itemhistorygraph_boost.h:1088
bool hasEdge(const Vertex &v1, const Vertex &v2) const
Definition itemhistorygraph_boost.h:381
boost::property_map< GraphContainer, edge_properties_t >::const_type const_edge_property_map_t
Definition itemhistorygraph_boost.h:169
bool isEmpty() const
Definition itemhistorygraph_boost.h:526
MeaningOfDirection meaningOfDirection() const
Definition itemhistorygraph_boost.h:321
QPair< Edge, Edge > EdgePair
Definition itemhistorygraph_boost.h:290
boost::inv_adjacency_iterator_generator< GraphContainer, vertex_t, in_edge_iter >::type inv_adjacency_iter
Definition itemhistorygraph_boost.h:154
QList< Vertex > topologicalSort() const
Definition itemhistorygraph_boost.h:656
void remove(const Vertex &v)
Definition itemhistorygraph_boost.h:346
Graph & operator=(const Graph &other)
Definition itemhistorygraph_boost.h:313
bool isLeaf(const Vertex &v) const
Definition itemhistorygraph_boost.h:546
Vertex target(const Edge &e) const
Definition itemhistorygraph_boost.h:556
std::pair< edge_iter, edge_iter > edge_range_t
Definition itemhistorygraph_boost.h:162
boost::property_map< GraphContainer, boost::vertex_index_t >::type vertex_index_map_t
Definition itemhistorygraph_boost.h:164
Graph(MeaningOfDirection dir=ParentToChild)
Definition itemhistorygraph_boost.h:300
AdjacencyFlags
Definition itemhistorygraph_boost.h:479
GraphCopyFlags
Definition itemhistorygraph_boost.h:677
const GraphContainer & getGraph() const
Definition itemhistorygraph_boost.h:468
graph_traits::vertex_descriptor vertex_t
Definition itemhistorygraph_boost.h:144
QList< Vertex > verticesDominatedBy(const Vertex &v, const Vertex &root, ReturnOrder order=BreadthFirstOrder) const
Definition itemhistorygraph_boost.h:925
static QList< Vertex > toVertexList(const range_t &range)
Definition itemhistorygraph_boost.h:1165
boost::graph_traits< GraphContainer > graph_traits
Definition itemhistorygraph_boost.h:142
QList< VertexPair > edgePairs() const
Definition itemhistorygraph_boost.h:638
void setProperties(const Vertex &v, const VertexProperties &props)
Definition itemhistorygraph_boost.h:403
int edgeCount() const
Definition itemhistorygraph_boost.h:590
boost::property_map< GraphContainer, vertex_properties_t >::const_type const_vertex_property_map_t
Definition itemhistorygraph_boost.h:167
boost::property_map< GraphContainer, boost::vertex_index_t >::const_type const_vertex_index_map_t
Definition itemhistorygraph_boost.h:165
QList< Vertex > listPath(const Vertex &root, const Vertex &target, const VertexVertexMap &predecessors, MeaningOfDirection dir=ParentToChild) const
Definition itemhistorygraph_boost.h:1678
int outDegree(const Vertex &v) const
Definition itemhistorygraph_boost.h:531
QList< Vertex > treeFromPredecessors(const Vertex &v, const VertexVertexMap &predecessors) const
Definition itemhistorygraph_boost.h:1126
Edge edge(const Vertex &v1, const Vertex &v2) const
Definition itemhistorygraph_boost.h:369
static QList< Value > toList(const range_t &range)
Definition itemhistorygraph_boost.h:1152
EdgeProperties properties(const Vertex &v1, const Vertex &v2) const
Definition itemhistorygraph_boost.h:443
QList< Vertex > mostRemoteNodes(const VertexIntMap &distances) const
Definition itemhistorygraph_boost.h:1634
graph_traits::vertex_iterator vertex_iter
Definition itemhistorygraph_boost.h:147
const VertexProperties & properties(const Vertex &v) const
Definition itemhistorygraph_boost.h:408
QMapForAdaptors< Vertex, int > VertexIntMap
Definition itemhistorygraph_boost.h:293
MeaningOfDirection direction
Definition itemhistorygraph_boost.h:1714
QList< Edge > edgeDifference(const Graph &other, const std::vector< vertex_t > &copiedVertices) const
Definition itemhistorygraph_boost.h:1238
bool isRoot(const Vertex &v) const
Definition itemhistorygraph_boost.h:541
void treeFromPredecessorsRecursive(const Vertex &v, QList< Vertex > &vertices, const VertexVertexMap &predecessors) const
Definition itemhistorygraph_boost.h:1135
static QList< Edge > toEdgeList(const range_t &range)
Definition itemhistorygraph_boost.h:1170
std::pair< inv_adjacency_iter, inv_adjacency_iter > inv_adjacency_vertex_range_t
Definition itemhistorygraph_boost.h:159
graph_traits::edge_iterator edge_iter
Definition itemhistorygraph_boost.h:148
QPair< Vertex, Vertex > VertexPair
Definition itemhistorygraph_boost.h:289
QList< Vertex > vertices() const
Definition itemhistorygraph_boost.h:473
bool hasEdges() const
Definition itemhistorygraph_boost.h:628
int inDegree(const Vertex &v) const
Definition itemhistorygraph_boost.h:536
Graph transitiveClosure(GraphCopyFlags flags=CopyAllProperties) const
Definition itemhistorygraph_boost.h:686
std::pair< out_edge_iter, out_edge_iter > out_edge_range_t
Definition itemhistorygraph_boost.h:160
QList< Vertex > rootsOf(const Vertex &v) const
Definition itemhistorygraph_boost.h:764
VertexProperties & properties(const Vertex &v)
Definition itemhistorygraph_boost.h:413
QList< Edge > edges(const Vertex &v, AdjacencyFlags flags=AllEdges) const
Definition itemhistorygraph_boost.h:561
graph_traits::out_edge_iterator out_edge_iter
Definition itemhistorygraph_boost.h:150
graph_traits::degree_size_type degree_t
Definition itemhistorygraph_boost.h:156
QList< Edge > edges() const
Definition itemhistorygraph_boost.h:633
void copyProperties(Graph &other, GraphCopyFlags flags, const std::vector< vertex_t > &copiedVertices) const
Definition itemhistorygraph_boost.h:1185
QList< Vertex > shortestPath(const Vertex &v1, const Vertex &v2) const
Definition itemhistorygraph_boost.h:849
int vertexCount() const
NOTE: for "hasAdjacentVertices", simply use hasEdges(v, flags).
Definition itemhistorygraph_boost.h:521
boost::property_map< GraphContainer, edge_properties_t >::type edge_property_map_t
Definition itemhistorygraph_boost.h:168
EdgeProperties & properties(const Edge &e)
Definition itemhistorygraph_boost.h:460
Vertex findVertexByProperties(const T &value) const
Definition itemhistorygraph_boost.h:424
std::pair< adjacency_iter, adjacency_iter > adjacency_vertex_range_t
Definition itemhistorygraph_boost.h:158
boost::associative_property_map< VertexIntMap > VertexIntMapAdaptor
Definition itemhistorygraph_boost.h:296
QMap< Vertex, int > shortestDistancesFrom(const Vertex &v) const
Definition itemhistorygraph_boost.h:886
QList< Vertex > longestPathTouching(const Vertex &v, LessThan lessThan) const
Definition itemhistorygraph_boost.h:800
Edge addEdge(const Vertex &v1, const Vertex &v2)
Definition itemhistorygraph_boost.h:357
ReturnOrder
Definition itemhistorygraph_boost.h:915
@ BreadthFirstOrder
Definition itemhistorygraph_boost.h:916
bool hasEdges(const Vertex &v, AdjacencyFlags flags=AllEdges) const
Definition itemhistorygraph_boost.h:595
bool isConnected(const Vertex &v1, const Vertex &v2) const
Definition itemhistorygraph_boost.h:388
void setProperties(const Edge &e, const EdgeProperties &props)
Definition itemhistorygraph_boost.h:418
static bool alwaysFalse(const T &, const T &)
Definition itemhistorygraph_boost.h:783
graph_traits::edge_descriptor edge_t
Definition itemhistorygraph_boost.h:145
GraphContainer graph
Definition itemhistorygraph_boost.h:1713
boost::associative_property_map< VertexVertexMap > VertexVertexMapAdaptor
Definition itemhistorygraph_boost.h:295
QList< Vertex > leaves() const
Definition itemhistorygraph_boost.h:773
graph_traits::in_edge_iterator in_edge_iter
Definition itemhistorygraph_boost.h:151
QList< Vertex > adjacentVertices(const Vertex &v, AdjacencyFlags flags=AllEdges) const
Definition itemhistorygraph_boost.h:490
static bool isEmptyRange(const range_t &range)
Definition itemhistorygraph_boost.h:1176
Vertex addVertex(const VertexProperties &properties)
Definition itemhistorygraph_boost.h:338
graph_traits::adjacency_iterator adjacency_iter
Definition itemhistorygraph_boost.h:149
boost::property_map< GraphContainer, vertex_properties_t >::type vertex_property_map_t
Definition itemhistorygraph_boost.h:166
QList< Vertex > findZeroDegree(bool inOrOut) const
Definition itemhistorygraph_boost.h:1270
Vertex addVertex()
Definition itemhistorygraph_boost.h:331
QList< Vertex > leavesFrom(const Vertex &v) const
Definition itemhistorygraph_boost.h:778
QList< Vertex > verticesBreadthFirst(const Vertex &givenRef=Vertex()) const
Definition itemhistorygraph_boost.h:1002
Graph transitiveReduction(QList< Edge > *removedEdges=0, GraphCopyFlags flags=CopyAllProperties) const
Definition itemhistorygraph_boost.h:720
Vertex source(const Edge &e) const
Definition itemhistorygraph_boost.h:551
QList< Vertex > verticesDominatedByDepthFirstSorted(const Vertex &v, const Vertex &root, LessThan lessThan) const
Definition itemhistorygraph_boost.h:954
Definition itemhistorygraph_boost.h:99
Key key_type
Definition itemhistorygraph_boost.h:102
Value data_type
Definition itemhistorygraph_boost.h:103
QMapForAdaptors()=default
std::pair< const Key, Value > value_type
Definition itemhistorygraph_boost.h:104
edge_properties_t
Definition itemhistorygraph_boost.h:82
@ edge_properties
Definition itemhistorygraph_boost.h:82
vertex_properties_t
Definition itemhistorygraph_boost.h:81
@ vertex_properties
Definition itemhistorygraph_boost.h:81
qulonglong value
Definition itemviewutilities.cpp:585
Definition datefolderview.cpp:34
MeaningOfDirection
Definition itemhistorygraph_boost.h:117
@ ParentToChild
Edges are directed from a parent to its child.
Definition itemhistorygraph_boost.h:118
@ ChildToParent
Edges are direct from a child to its parent.
Definition itemhistorygraph_boost.h:119