Skip to content

Commit 44cd29c

Browse files
authored
Merge pull request #26 from nike0good/fix-compilation
pgr_transitiveClosure GSOC-2019 week 11-PR1
2 parents f9d1ca6 + 61ffa56 commit 44cd29c

File tree

16 files changed

+32
-116
lines changed

16 files changed

+32
-116
lines changed

configuration.conf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ chinese | Y | Y | Y
3737
spanningTree | Y | Y | Y
3838
mincut | Y | Y | Y
3939
version | Y | Y | Y
40-
topologicalSort | Y | Y | N
41-
transitiveClosure | Y | Y | N
40+
topologicalSort | Y | Y | Y
41+
#transitiveClosure | Y | Y | N
4242

4343

4444
#----------------------

doc/topologicalSort/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11

22
SET(LOCAL_FILES
3-
pgr_toplogicalSort.rst
3+
pgr_topologicalSort.rst
44
)
55

66
foreach (f ${LOCAL_FILES})

doc/topologicalSort/doc-pgr_toplogicalSort.queries

Lines changed: 0 additions & 92 deletions
This file was deleted.
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Do not use extensions
2+
SET(LOCAL_FILES
3+
doc-topologicalSort
4+
)
5+
6+
foreach (f ${LOCAL_FILES})
7+
configure_file("${f}.result" "${PGR_DOCUMENTATION_SOURCE_DIR}/${f}.queries")
8+
list(APPEND LOCAL_DOC_FILES "${PGR_DOCUMENTATION_SOURCE_DIR}/${f}.queries")
9+
endforeach()
10+
11+
set(PGROUTING_DOC_FILES ${PGROUTING_DOC_FILES} ${LOCAL_DOC_FILES} PARENT_SCOPE)
File renamed without changes.

include/boost/CPPLINT.cfg

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
exclude_files=detail_augment\.hpp
2+
exclude_files=dijkstra_shortest_paths\.hpp
3+
exclude_files=find_flow_cost\.hpp
4+
exclude_files=successive_shortest_path_nonnegative_weights\.hpp

include/drivers/transitiveClosure/transitiveClosure_driver.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ extern "C" {
5252
do_pgr_contractGraph(
5353
pgr_edge_t *data_edges,
5454
size_t total_tuples,
55-
5655
transitiveClosure_rt **return_tuples,
5756
size_t *return_count,
5857
char **log_msg,

include/topologicalSort/pgr_topologicalSort.hpp

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -61,19 +61,18 @@ class Pgr_topologicalSort {
6161
std::vector< pgr_topologicalSort_t >
6262
generatetopologicalSort(
6363
const G &graph ) {
64-
6564
std::vector< pgr_topologicalSort_t > results;
6665

6766
typedef typename std::vector< V > container;
6867
container c;
6968

7069
boost::topological_sort(graph.graph, std::back_inserter(c));
71-
70+
7271
typename std::vector< V >::reverse_iterator ii;
73-
for (ii=c.rbegin(); ii!=c.rend(); ++ii) {
74-
auto t=*ii;
72+
for (ii = c.rbegin(); ii != c.rend(); ++ii) {
73+
auto t = *ii;
7574
pgr_topologicalSort_t tmp;
76-
tmp.sorted_v=graph.graph[t].id;
75+
tmp.sorted_v = graph.graph[t].id;
7776
results.push_back(tmp);
7877
}
7978

@@ -85,7 +84,6 @@ template < class G >
8584
std::vector<pgr_topologicalSort_t>
8685
Pgr_topologicalSort< G >::topologicalSort(
8786
G &graph) {
88-
8987
return generatetopologicalSort(
9088
graph);
9189
}

include/transitiveClosure/pgr_transitiveClosure.hpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ class Pgr_transitiveClosure {
8585
Identifiers<int64_t> &remaining_vertices,
8686
std::vector<pgrouting::CH_edge> &shortcut_edges,
8787
std::ostringstream& debug) {
88-
//std::deque<int64_t> contract_order;
88+
// std::deque<int64_t> contract_order;
8989
// push -1 to indicate the start of the queue
9090
// contract_order.push_back(-1);
9191
// contract_order.insert(
@@ -126,7 +126,6 @@ class Pgr_transitiveClosure {
126126
// shortcut_edges.push_back(shortcut);
127127
// }
128128
}
129-
130129
};
131130

132131
} // namespace transitiveClosure

sql/sigs/pgrouting--3.0.0.sig

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,8 @@ _pgr_stoerwagner(text)
180180
pgr_stoerwagner(text)
181181
_pgr_strongcomponents(text)
182182
pgr_strongcomponents(text)
183+
_pgr_topologicalsort(text)
184+
pgr_topologicalsort(text)
183185
_pgr_trsp(text,integer,double precision,integer,double precision,boolean,boolean,text)
184186
pgr_trsp(text,integer,double precision,integer,double precision,boolean,boolean,text)
185187
pgr_trsp(text,integer,integer,boolean,boolean,text)

src/topologicalSort/topologicalSort.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -57,18 +57,16 @@ process(
5757
pgr_edge_t *edges = NULL;
5858
size_t total_edges = 0;
5959
pgr_get_edges(edges_sql, &edges, &total_edges);
60-
60+
6161
PGR_DBG("Starting timer");
6262
clock_t start_t = clock();
6363
char* log_msg = NULL;
6464
char* notice_msg = NULL;
6565
char* err_msg = NULL;
6666
do_pgr_topologicalSort(
6767
edges, total_edges,
68-
6968
result_tuples,
7069
result_count,
71-
7270
&log_msg,
7371
&notice_msg,
7472
&err_msg);

src/topologicalSort/topologicalSort_driver.cpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,10 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
3737

3838
#include "topologicalSort/pgr_topologicalSort.hpp"
3939

40-
//TODO(nike0good) : Remove below headers once pgr_topologicalSort.hpp is implemented.
40+
// TODO(nike0good) : Remove below headers once pgr_topologicalSort.hpp is implemented.
4141
#include "cpp_common/basePath_SSEC.hpp"
4242
#include "cpp_common/pgr_base_graph.hpp"
43-
//TODO(nike0good) : Complete file once pgr_topologicalSort.hpp is implemented.
43+
// TODO(nike0good) : Complete file once pgr_topologicalSort.hpp is implemented.
4444

4545
#include "cpp_common/pgr_alloc.hpp"
4646
#include "cpp_common/pgr_assert.h"
@@ -56,7 +56,6 @@ pgr_topologicalSort(
5656
std::vector<pgr_topologicalSort_t> vv;
5757
return vv;
5858
#endif
59-
6059
}
6160

6261

@@ -66,7 +65,7 @@ void
6665
do_pgr_topologicalSort(
6766
pgr_edge_t *data_edges,
6867
size_t total_edges,
69-
68+
7069

7170
pgr_topologicalSort_t **return_tuples,
7271
size_t *return_count,
@@ -87,7 +86,7 @@ do_pgr_topologicalSort(
8786

8887
graphType gType = DIRECTED;
8988

90-
std::vector<pgr_topologicalSort_t> results;
89+
std::vector<pgr_topologicalSort_t> results;
9190

9291
log << "Working with Directed Graph\n";
9392
pgrouting::DirectedGraph digraph(gType);

src/transitiveClosure/transitiveClosure.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@ process(char* edges_sql,
5656

5757
transitiveClosure_rt **result_tuples,
5858
size_t *result_count) {
59-
6059
pgr_SPI_connect();
6160

6261

@@ -89,7 +88,7 @@ process(char* edges_sql,
8988
(*result_tuples) = NULL;
9089
(*result_count) = 0;
9190
}
92-
91+
9392
pgr_global_report(log_msg, notice_msg, err_msg);
9493

9594
if (log_msg) pfree(log_msg);
@@ -211,7 +210,7 @@ transitiveClosure(PG_FUNCTION_ARGS) {
211210

212211
values[0] = Int32GetDatum(call_cntr + 1);
213212
values[1] = PointerGetDatum(arrayType);
214-
213+
215214
/*********************************************************************/
216215
tuple = heap_form_tuple(tuple_desc, values, nulls);
217216
result = HeapTupleGetDatum(tuple);

src/transitiveClosure/transitiveClosure_driver.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@ static void process_transitiveClosure(
5454
pgrouting::ransitiveClosure::Pgr_transitiveClosure<G> result(graph,
5555
remaining_vertices,
5656
shortcut_edges, log);
57-
5857
}
5958

6059
template <typename G>

0 commit comments

Comments
 (0)