Skip to content

Commit 74c2981

Browse files
nike0goodnike0good
authored andcommitted
[transitiveClosure] Add id to sql.
1 parent 3b41976 commit 74c2981

3 files changed

Lines changed: 4 additions & 24 deletions

File tree

sql/transitiveClosure/_transitiveClosure.sql

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ CREATE OR REPLACE FUNCTION _pgr_transitiveClosure(
3333
edges_sql TEXT,
3434

3535
OUT seq INTEGER,
36+
OUT id BIGINT,
3637
OUT target_array BIGINT[])
3738
RETURNS SETOF RECORD AS
3839
'MODULE_PATHNAME', 'transitiveClosure'

sql/transitiveClosure/transitiveClosure.sql

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ CREATE OR REPLACE FUNCTION pgr_transitiveClosure(
3333
edges_sql TEXT, -- edges_sql (required)
3434

3535
OUT seq INTEGER,
36+
OUT id BIGINT,
3637
OUT target_array BIGINT[])
3738
RETURNS SETOF RECORD AS
3839
$BODY$

src/transitiveClosure/transitiveClosure_driver.cpp

Lines changed: 2 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -47,36 +47,14 @@ static void process_transitiveClosure(
4747
std::ostringstream &log,
4848
std::ostringstream &err) {
4949
graph.insert_edges(edges);
50-
/*
51-
* this check does not ignore vertices ids that do not belong to the graph
52-
*/
53-
54-
#ifndef NDEBUG
55-
log << "Before contraction\n";
56-
graph.print_graph(log);
57-
#endif
5850

5951
/*
6052
* Function call to get the contracted graph.
6153
*/
62-
pgrouting::contraction::Pgr_contract<G> result(graph,
63-
forbid_vertices,
64-
contraction_order,
65-
max_cycles, remaining_vertices,
54+
pgrouting::ransitiveClosure::Pgr_transitiveClosure<G> result(graph,
55+
remaining_vertices,
6656
shortcut_edges, log);
6757

68-
#ifndef NDEBUG
69-
log << "After contraction\n";
70-
log << graph;
71-
log << "Remaining Vertices:" << "\n";
72-
for (const auto vertex : remaining_vertices) {
73-
log << vertex << "\n";
74-
}
75-
log << "Added Edges:" << "\n";
76-
for (const auto edge : shortcut_edges) {
77-
log << edge << "\n";
78-
}
79-
#endif
8058
}
8159

8260
template <typename G>

0 commit comments

Comments
 (0)