From 35085c31944d32f7fad6103790d4f3c11d259ddd Mon Sep 17 00:00:00 2001 From: cvvergara Date: Wed, 4 Feb 2026 21:45:41 -0600 Subject: [PATCH 1/4] (edwardMoore) :broom: Remove unused code --- .../drivers/bellman_ford/edwardMoore_driver.h | 76 -------- src/bellman_ford/edwardMoore_driver.cpp | 163 ------------------ 2 files changed, 239 deletions(-) delete mode 100644 include/drivers/bellman_ford/edwardMoore_driver.h delete mode 100644 src/bellman_ford/edwardMoore_driver.cpp diff --git a/include/drivers/bellman_ford/edwardMoore_driver.h b/include/drivers/bellman_ford/edwardMoore_driver.h deleted file mode 100644 index 809ba48102..0000000000 --- a/include/drivers/bellman_ford/edwardMoore_driver.h +++ /dev/null @@ -1,76 +0,0 @@ -/*PGR-GNU***************************************************************** -File: edwardMoore_driver.h - -Generated with Template by: -Copyright (c) 2007-2026 pgRouting developers -Mail: project@pgrouting.org - -Function's developer: -Copyright (c) 2019 Gudesa Venkata Sai Akhil -Mail: gvs.akhil1997@gmail.com - ------- - -This program is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - - ********************************************************************PGR-GNU*/ - -#ifndef INCLUDE_DRIVERS_BELLMAN_FORD_EDWARDMOORE_DRIVER_H_ -#define INCLUDE_DRIVERS_BELLMAN_FORD_EDWARDMOORE_DRIVER_H_ -#pragma once - -#ifdef __cplusplus -extern "C" { -#endif - -#include -#include - -#ifdef __cplusplus -} -#endif - -#include "cpp_common/undefPostgresDefine.hpp" - -#ifdef __cplusplus -# include -# include -using Path_rt = struct Path_rt; -#else -# include -# include -typedef struct Path_rt Path_rt; -#endif - -#ifdef __cplusplus -extern "C" { -#endif - - void pgr_do_edwardMoore( - const char*, - const char*, - ArrayType*, ArrayType*, - - bool, - - Path_rt**, size_t*, - char**, char**, char**); - - -#ifdef __cplusplus -} -#endif - -#endif // INCLUDE_DRIVERS_BELLMAN_FORD_EDWARDMOORE_DRIVER_H_ diff --git a/src/bellman_ford/edwardMoore_driver.cpp b/src/bellman_ford/edwardMoore_driver.cpp deleted file mode 100644 index 2a017b73c4..0000000000 --- a/src/bellman_ford/edwardMoore_driver.cpp +++ /dev/null @@ -1,163 +0,0 @@ -/*PGR-GNU***************************************************************** -File: edwardMoore_driver.cpp - -Generated with Template by: -Copyright (c) 2015-2026 pgRouting developers -Mail: project@pgrouting.org - -Function's developer: -Copyright (c) 2019 Gudesa Venkata Sai Akhil -Mail: gvs.akhil1997@gmail.com - - ------- - -This program is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program; if not, write to the Free Software -Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - - ********************************************************************PGR-GNU*/ - -#include "drivers/bellman_ford/edwardMoore_driver.h" - -#include -#include -#include -#include -#include -#include -#include - -#include "bellman_ford/edwardMoore.hpp" - -#include "cpp_common/combinations.hpp" -#include "cpp_common/pgdata_getters.hpp" -#include "cpp_common/path.hpp" -#include "cpp_common/base_graph.hpp" -#include "cpp_common/to_postgres.hpp" -#include "cpp_common/assert.hpp" - -#include "c_types/ii_t_rt.h" - -namespace { - - -template -std::deque -edwardMoore( - G &graph, - const std::map> &combinations) { - pgrouting::functions::Pgr_edwardMoore fn_edwardMoore; - return fn_edwardMoore.edwardMoore(graph, combinations); -} - -} // namespace - -void -pgr_do_edwardMoore( - const char *edges_sql, - const char *combinations_sql, - ArrayType *starts, - ArrayType *ends, - - bool directed, - - Path_rt **return_tuples, - size_t *return_count, - char ** log_msg, - char ** notice_msg, - char ** err_msg) { - using pgrouting::Path; - using pgrouting::to_pg_msg; - using pgrouting::pgr_free; - using pgrouting::utilities::get_combinations; - using pgrouting::pgget::get_edges; - - std::ostringstream log; - std::ostringstream err; - std::ostringstream notice; - const char *hint = nullptr; - - try { - pgassert(!(*log_msg)); - pgassert(!(*notice_msg)); - pgassert(!(*err_msg)); - pgassert(!(*return_tuples)); - pgassert(*return_count == 0); - - using pgrouting::to_postgres::get_tuples; - - - hint = combinations_sql; - auto combinations = get_combinations(combinations_sql, starts, ends, true); - hint = nullptr; - - if (combinations.empty() && combinations_sql) { - *notice_msg = to_pg_msg("No (source, target) pairs found"); - *log_msg = to_pg_msg(combinations_sql); - return; - } - - hint = edges_sql; - auto edges = get_edges(std::string(edges_sql), true, false); - - if (edges.empty()) { - *notice_msg = to_pg_msg("No edges found"); - *log_msg = hint? to_pg_msg(hint) : to_pg_msg(log); - return; - } - hint = nullptr; - - std::deque paths; - if (directed) { - pgrouting::DirectedGraph digraph; - digraph.insert_edges(edges); - paths = edwardMoore(digraph, combinations); - } else { - pgrouting::UndirectedGraph undigraph; - undigraph.insert_edges(edges); - paths = edwardMoore(undigraph, combinations); - } - - (*return_count) = get_tuples(paths, (*return_tuples)); - - if (*return_count == 0) { - *log_msg = to_pg_msg("No paths found"); - return; - } - - *log_msg = to_pg_msg(log); - *notice_msg = to_pg_msg(notice); - } catch (AssertFailedException &except) { - (*return_tuples) = pgr_free(*return_tuples); - (*return_count) = 0; - err << except.what(); - *err_msg = to_pg_msg(err); - *log_msg = to_pg_msg(log); - } catch (const std::string &ex) { - *err_msg = to_pg_msg(ex); - *log_msg = hint? to_pg_msg(hint) : to_pg_msg(log); - } catch (std::exception &except) { - (*return_tuples) = pgr_free(*return_tuples); - (*return_count) = 0; - err << except.what(); - *err_msg = to_pg_msg(err); - *log_msg = to_pg_msg(log); - } catch(...) { - (*return_tuples) = pgr_free(*return_tuples); - (*return_count) = 0; - err << "Caught unknown exception!"; - *err_msg = to_pg_msg(err); - *log_msg = to_pg_msg(log); - } -} From d9cfc9b1f2214e6a9ae8ceac5e903096c1eb978a Mon Sep 17 00:00:00 2001 From: cvvergara Date: Wed, 4 Feb 2026 21:47:19 -0600 Subject: [PATCH 2/4] (edwardMoore) using the shortestPath process & driver --- include/bellman_ford/edwardMoore.hpp | 13 +++ include/c_common/enums.h | 2 +- src/bellman_ford/CMakeLists.txt | 4 +- src/bellman_ford/edwardMoore.c | 123 +++++++++++---------------- src/cpp_common/utilities.cpp | 22 ++--- src/dijkstra/shortestPath_driver.cpp | 8 ++ 6 files changed, 87 insertions(+), 85 deletions(-) diff --git a/include/bellman_ford/edwardMoore.hpp b/include/bellman_ford/edwardMoore.hpp index da4e203ad8..ebc0219fdd 100644 --- a/include/bellman_ford/edwardMoore.hpp +++ b/include/bellman_ford/edwardMoore.hpp @@ -191,6 +191,19 @@ class Pgr_edwardMoore { } }; } // namespace functions + +namespace algorithms { + +template +std::deque +edwardMoore( + G &graph, + const std::map> &combinations) { + pgrouting::functions::Pgr_edwardMoore fn_edwardMoore; + return fn_edwardMoore.edwardMoore(graph, combinations); +} + +} // namespace algorithms } // namespace pgrouting #endif // INCLUDE_BELLMAN_FORD_EDWARDMOORE_HPP_ diff --git a/include/c_common/enums.h b/include/c_common/enums.h index f67da0a884..e1b3bacf83 100644 --- a/include/c_common/enums.h +++ b/include/c_common/enums.h @@ -31,7 +31,7 @@ enum Which { /** directed graph + results: vertex id */ TOPOSORT = 11, /** shortest_paths */ - DIJKSTRA = 21, WITHPOINTS, OLD_WITHPOINTS, BDDIJKSTRA, + DIJKSTRA = 21, WITHPOINTS, OLD_WITHPOINTS, BDDIJKSTRA, EDWARDMOORE, /** allpairs **/ FLOYD = 31, JOHNSON, /** metrics **/ diff --git a/src/bellman_ford/CMakeLists.txt b/src/bellman_ford/CMakeLists.txt index a1903d21d0..f8195257a2 100644 --- a/src/bellman_ford/CMakeLists.txt +++ b/src/bellman_ford/CMakeLists.txt @@ -1,11 +1,11 @@ # This file is part of the pgRouting project. # Copyright (c) 2018-2026 pgRouting developers # License: GPL-2 See https://github.com/pgRouting/pgrouting/blob/main/LICENSE + ADD_LIBRARY(bellman_ford OBJECT bellman_ford.c bellman_ford_driver.cpp #bellman_ford_neg.c #bellman_ford_neg_driver.cpp edwardMoore.c - edwardMoore_driver.cpp - ) +) diff --git a/src/bellman_ford/edwardMoore.c b/src/bellman_ford/edwardMoore.c index a9e6b16b4d..eece6b0bb1 100644 --- a/src/bellman_ford/edwardMoore.c +++ b/src/bellman_ford/edwardMoore.c @@ -35,62 +35,18 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. #include "c_common/debug_macro.h" #include "c_common/e_report.h" #include "c_common/time_msg.h" -#include "drivers/bellman_ford/edwardMoore_driver.h" +#include "process/shortestPath_process.h" PGDLLEXPORT Datum _pgr_edwardmoore(PG_FUNCTION_ARGS); PG_FUNCTION_INFO_V1(_pgr_edwardmoore); -static void -process( - char *edges_sql, - char *combinations_sql, - ArrayType *starts, - ArrayType *ends, - bool directed, - - Path_rt **result_tuples, - size_t *result_count) { - pgr_SPI_connect(); - char* log_msg = NULL; - char* notice_msg = NULL; - char* err_msg = NULL; - (*result_tuples) = NULL; - (*result_count) = 0; - - clock_t start_t = clock(); - pgr_do_edwardMoore( - edges_sql, - combinations_sql, - starts, ends, - - directed, - - result_tuples, - result_count, - - &log_msg, - ¬ice_msg, - &err_msg); - - time_msg(" processing pgr_edwardMoore", start_t, clock()); - - if (err_msg && (*result_tuples)) { - pfree(*result_tuples); - (*result_tuples) = NULL; - (*result_count) = 0; - } - - pgr_global_report(&log_msg, ¬ice_msg, &err_msg); - - pgr_SPI_finish(); -} PGDLLEXPORT Datum _pgr_edwardmoore(PG_FUNCTION_ARGS) { - FuncCallContext *funcctx; - TupleDesc tuple_desc; + FuncCallContext *funcctx; + TupleDesc tuple_desc; - Path_rt *result_tuples = NULL; - size_t result_count = 0; + Path_rt *result_tuples = NULL; + size_t result_count = 0; if (SRF_IS_FIRSTCALL()) { MemoryContext oldcontext; @@ -101,36 +57,60 @@ PGDLLEXPORT Datum _pgr_edwardmoore(PG_FUNCTION_ARGS) { /* * many to many */ - process( + pgr_process_shortestPath( text_to_cstring(PG_GETARG_TEXT_P(0)), NULL, + NULL, + PG_GETARG_ARRAYTYPE_P(1), PG_GETARG_ARRAYTYPE_P(2), + PG_GETARG_BOOL(3), + false, + true, + + 0, + true, + ' ', + true, + + EDWARDMOORE, &result_tuples, &result_count); } else if (PG_NARGS() == 3) { /* - * combinations + * Combinations */ - process( + pgr_process_shortestPath( text_to_cstring(PG_GETARG_TEXT_P(0)), - text_to_cstring(PG_GETARG_TEXT_P(1)), - NULL, NULL, + text_to_cstring(PG_GETARG_TEXT_P(1)), + + NULL, NULL, + PG_GETARG_BOOL(2), + false, + true, + + 0, + true, + ' ', + true, + + EDWARDMOORE, &result_tuples, &result_count); } funcctx->max_calls = result_count; funcctx->user_fctx = result_tuples; - if (get_call_result_type(fcinfo, NULL, &tuple_desc) != TYPEFUNC_COMPOSITE) { + if (get_call_result_type(fcinfo, NULL, &tuple_desc) + != TYPEFUNC_COMPOSITE) { ereport(ERROR, (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), errmsg("function returning record called in context " - "that cannot accept type record"))); + "that cannot accept type record"))); } funcctx->tuple_desc = tuple_desc; @@ -139,13 +119,14 @@ PGDLLEXPORT Datum _pgr_edwardmoore(PG_FUNCTION_ARGS) { funcctx = SRF_PERCALL_SETUP(); tuple_desc = funcctx->tuple_desc; - result_tuples = (Path_rt *)funcctx->user_fctx; + result_tuples = (Path_rt*) funcctx->user_fctx; if (funcctx->call_cntr < funcctx->max_calls) { - HeapTuple tuple; - Datum result; - Datum *values; - bool *nulls; + HeapTuple tuple; + Datum result; + Datum *values; + bool* nulls; + size_t call_cntr = funcctx->call_cntr; size_t numb = 8; values = palloc(numb * sizeof(Datum)); @@ -156,18 +137,18 @@ PGDLLEXPORT Datum _pgr_edwardmoore(PG_FUNCTION_ARGS) { nulls[i] = false; } - int64_t seq = funcctx->call_cntr == 0? 1 : result_tuples[funcctx->call_cntr - 1].start_id; + int64_t seq = call_cntr == 0? 1 : result_tuples[call_cntr - 1].start_id; - values[0] = Int32GetDatum((int32_t) funcctx->call_cntr + 1); + values[0] = Int32GetDatum((int32_t)call_cntr + 1); values[1] = Int32GetDatum((int32_t)seq); - values[2] = Int64GetDatum(result_tuples[funcctx->call_cntr].start_id); - values[3] = Int64GetDatum(result_tuples[funcctx->call_cntr].end_id); - values[4] = Int64GetDatum(result_tuples[funcctx->call_cntr].node); - values[5] = Int64GetDatum(result_tuples[funcctx->call_cntr].edge); - values[6] = Float8GetDatum(result_tuples[funcctx->call_cntr].cost); - values[7] = Float8GetDatum(result_tuples[funcctx->call_cntr].agg_cost); - - result_tuples[funcctx->call_cntr].start_id = result_tuples[funcctx->call_cntr].edge < 0? 1 : seq + 1; + values[2] = Int64GetDatum(result_tuples[call_cntr].start_id); + values[3] = Int64GetDatum(result_tuples[call_cntr].end_id); + values[4] = Int64GetDatum(result_tuples[call_cntr].node); + values[5] = Int64GetDatum(result_tuples[call_cntr].edge); + values[6] = Float8GetDatum(result_tuples[call_cntr].cost); + values[7] = Float8GetDatum(result_tuples[call_cntr].agg_cost); + + result_tuples[call_cntr].start_id = result_tuples[call_cntr].edge < 0? 1 : seq + 1; tuple = heap_form_tuple(tuple_desc, values, nulls); result = HeapTupleGetDatum(tuple); diff --git a/src/cpp_common/utilities.cpp b/src/cpp_common/utilities.cpp index 03ec8c608c..15ab3044b1 100644 --- a/src/cpp_common/utilities.cpp +++ b/src/cpp_common/utilities.cpp @@ -68,22 +68,21 @@ get_name(Which which, bool is_only_cost, bool is_near, bool is_matrix) { std::string suffix = ""; switch (which) { case DIJKSTRA : - { - base = "pgr_dijkstra"; - suffix = std::string(is_near? "Near" : "") + (is_only_cost? "Cost" : "") + (is_matrix? "Matrix" : ""); - break; - } + base = "pgr_dijkstra"; + suffix = std::string(is_near? "Near" : "") + (is_only_cost? "Cost" : "") + (is_matrix? "Matrix" : ""); + break; case BDDIJKSTRA : base = "pgr_bdDijkstra"; - suffix = std::string(is_near? "Near" : "") + (is_only_cost? "Cost" : "") + (is_matrix? "Matrix" : ""); + suffix = std::string(is_only_cost? "Cost" : "") + (is_matrix? "Matrix" : ""); + break; + case EDWARDMOORE: + base = "pgr_edwardMoore"; break; case OLD_WITHPOINTS: case WITHPOINTS: - { - base = "pgr_withPoints"; - suffix = std::string(is_only_cost? "Cost" : "") + (is_matrix? "Matrix" : ""); - break; - } + base = "pgr_withPoints"; + suffix = std::string(is_only_cost? "Cost" : "") + (is_matrix? "Matrix" : ""); + break; default : base = "unknown"; } @@ -97,6 +96,7 @@ estimate_drivingSide(char driving_side, Which which) { d_side = ' '; } switch (which) { + case EDWARDMOORE: case BDDIJKSTRA: case DIJKSTRA: { diff --git a/src/dijkstra/shortestPath_driver.cpp b/src/dijkstra/shortestPath_driver.cpp index e46dad8d8b..d6cb788678 100644 --- a/src/dijkstra/shortestPath_driver.cpp +++ b/src/dijkstra/shortestPath_driver.cpp @@ -51,6 +51,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. #include "cpp_common/to_postgres.hpp" #include "dijkstra/dijkstra.hpp" +#include "bellman_ford/edwardMoore.hpp" #include "bdDijkstra/bdDijkstra.hpp" #include "withPoints/withPoints.hpp" @@ -151,6 +152,7 @@ do_shortestPath( using pgrouting::algorithms::dijkstra; using pgrouting::algorithms::bdDijkstra; + using pgrouting::algorithms::edwardMoore; hint = combinations_sql; auto combinations = get_combinations(combinations_sql, starts, ends, normal, is_matrix); @@ -233,6 +235,9 @@ do_shortestPath( case BDDIJKSTRA: paths = bdDijkstra(digraph, combinations, only_cost); break; + case EDWARDMOORE: + paths = edwardMoore(digraph, combinations); + break; default: err << "INTERNAL: wrong function call: " << which; return; @@ -249,6 +254,9 @@ do_shortestPath( case BDDIJKSTRA: paths = bdDijkstra(undigraph, combinations, only_cost); break; + case EDWARDMOORE: + paths = edwardMoore(undigraph, combinations); + break; default: err << "INTERNAL: wrong function call: " << which; return; From b8cb84e99e8a782b8ca3786d91cc54e863fc8023 Mon Sep 17 00:00:00 2001 From: cvvergara Date: Thu, 5 Feb 2026 13:47:49 -0600 Subject: [PATCH 3/4] Updating news and release notes --- NEWS.md | 1 + doc/src/release_notes.rst | 1 + locale/en/LC_MESSAGES/pgrouting_doc_strings.po | 7 ++++++- locale/pot/pgrouting_doc_strings.pot | 5 ++++- pgtap/bellman_ford/edwardMoore/no_crash_test.pg | 3 ++- 5 files changed, 14 insertions(+), 3 deletions(-) diff --git a/NEWS.md b/NEWS.md index f83a9d0acb..e2d3d32bd8 100644 --- a/NEWS.md +++ b/NEWS.md @@ -17,6 +17,7 @@ To see all issues & pull requests closed by this release see the * [#3049](https://github.com/pgRouting/pgrouting/issues/3049): Use enumeration on drivers and process. * [#3054](https://github.com/pgRouting/pgrouting/issues/3054): Change error message when edges_sql is empty * [#3055](https://github.com/pgRouting/pgrouting/issues/3055): bdDijkstra: use the shortest_path process and driver +* [#3056](https://github.com/pgRouting/pgrouting/issues/3056): edwardMoore: use the shortest_path process and driver ## pgRouting 4.0 diff --git a/doc/src/release_notes.rst b/doc/src/release_notes.rst index b7b7e69c18..3562cd1f43 100644 --- a/doc/src/release_notes.rst +++ b/doc/src/release_notes.rst @@ -42,6 +42,7 @@ To see all issues & pull requests closed by this release see the * :issue:`3049`: Use enumeration on drivers and process. * :issue:`3054`: Change error message when edges_sql is empty * :issue:`3055`: bdDijkstra: use the shortest_path process and driver +* :issue:`3056`: edwardMoore: use the shortest_path process and driver pgRouting 4.0 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ diff --git a/locale/en/LC_MESSAGES/pgrouting_doc_strings.po b/locale/en/LC_MESSAGES/pgrouting_doc_strings.po index 6ebbf3bb27..07c9b1af42 100644 --- a/locale/en/LC_MESSAGES/pgrouting_doc_strings.po +++ b/locale/en/LC_MESSAGES/pgrouting_doc_strings.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: pgRouting v4.1\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2026-02-05 18:16+0000\n" +"POT-Creation-Date: 2026-02-06 17:38+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -3941,6 +3941,11 @@ msgid "" "use the shortest_path process and driver" msgstr "" +msgid "" +"`#3056 `__: edwardMoore: " +"use the shortest_path process and driver" +msgstr "" + msgid "All releases" msgstr "" diff --git a/locale/pot/pgrouting_doc_strings.pot b/locale/pot/pgrouting_doc_strings.pot index 17df7879e9..0f446e9380 100644 --- a/locale/pot/pgrouting_doc_strings.pot +++ b/locale/pot/pgrouting_doc_strings.pot @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: pgRouting v4.1\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2026-02-05 18:16+0000\n" +"POT-Creation-Date: 2026-02-06 17:38+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -3538,6 +3538,9 @@ msgstr "" msgid "`#3055 `__: bdDijkstra: use the shortest_path process and driver" msgstr "" +msgid "`#3056 `__: edwardMoore: use the shortest_path process and driver" +msgstr "" + msgid "All releases" msgstr "" diff --git a/pgtap/bellman_ford/edwardMoore/no_crash_test.pg b/pgtap/bellman_ford/edwardMoore/no_crash_test.pg index 39b7708a5c..dec7a0fe93 100644 --- a/pgtap/bellman_ford/edwardMoore/no_crash_test.pg +++ b/pgtap/bellman_ford/edwardMoore/no_crash_test.pg @@ -7,10 +7,11 @@ BEGIN; UPDATE edges SET cost = sign(cost), reverse_cost = sign(reverse_cost); -SELECT CASE WHEN min_version('3.2.0') THEN plan (97) ELSE plan(84) END; +SELECT CASE WHEN min_version('3.2.0') THEN plan (98) ELSE plan(85) END; SELECT general_no_crash('pgr_edwardMoore'); +SELECT throw_on_empty_edges_sql('pgr_edwardMoore', ',1,2'); SELECT finish(); ROLLBACK; From 32cba838ac53a7b26aa17f08461f81cf14bdfd6c Mon Sep 17 00:00:00 2001 From: cvvergara Date: Thu, 5 Feb 2026 15:00:12 -0600 Subject: [PATCH 4/4] (lint) Clean up include files --- src/allpairs/floydWarshall.c | 5 ----- src/allpairs/johnson.c | 5 ----- src/bdDijkstra/bdDijkstra.c | 4 ---- src/bellman_ford/edwardMoore.c | 4 ---- src/dijkstra/dijkstra.c | 4 ---- src/metrics/bandwidth.c | 7 ------- src/ordering/cuthillMckeeOrdering.c | 5 ----- src/ordering/kingOrdering.c | 5 ----- src/ordering/sloanOrdering.c | 5 ----- src/ordering/topologicalSort.c | 5 ----- src/withPoints/withPoints.c | 6 ------ 11 files changed, 55 deletions(-) diff --git a/src/allpairs/floydWarshall.c b/src/allpairs/floydWarshall.c index 2258b8d166..ec40f5a3bf 100644 --- a/src/allpairs/floydWarshall.c +++ b/src/allpairs/floydWarshall.c @@ -28,12 +28,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. #include #include "c_common/postgres_connection.h" - #include "c_types/iid_t_rt.h" -#include "c_common/debug_macro.h" -#include "c_common/e_report.h" -#include "c_common/time_msg.h" - #include "process/allpairs_process.h" PGDLLEXPORT Datum _pgr_floydwarshall(PG_FUNCTION_ARGS); diff --git a/src/allpairs/johnson.c b/src/allpairs/johnson.c index bb2c6ef55a..c99f732f20 100644 --- a/src/allpairs/johnson.c +++ b/src/allpairs/johnson.c @@ -29,12 +29,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. #include #include "c_common/postgres_connection.h" - #include "c_types/iid_t_rt.h" -#include "c_common/debug_macro.h" -#include "c_common/e_report.h" -#include "c_common/time_msg.h" - #include "process/allpairs_process.h" PGDLLEXPORT Datum _pgr_johnson(PG_FUNCTION_ARGS); diff --git a/src/bdDijkstra/bdDijkstra.c b/src/bdDijkstra/bdDijkstra.c index 459208af87..b7ff64d7fe 100644 --- a/src/bdDijkstra/bdDijkstra.c +++ b/src/bdDijkstra/bdDijkstra.c @@ -30,11 +30,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. #include #include "c_common/postgres_connection.h" - #include "c_types/path_rt.h" -#include "c_common/debug_macro.h" -#include "c_common/e_report.h" -#include "c_common/time_msg.h" #include "process/shortestPath_process.h" PGDLLEXPORT Datum _pgr_bddijkstra(PG_FUNCTION_ARGS); diff --git a/src/bellman_ford/edwardMoore.c b/src/bellman_ford/edwardMoore.c index eece6b0bb1..1d43f5d7df 100644 --- a/src/bellman_ford/edwardMoore.c +++ b/src/bellman_ford/edwardMoore.c @@ -30,11 +30,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. #include #include "c_common/postgres_connection.h" - #include "c_types/path_rt.h" -#include "c_common/debug_macro.h" -#include "c_common/e_report.h" -#include "c_common/time_msg.h" #include "process/shortestPath_process.h" PGDLLEXPORT Datum _pgr_edwardmoore(PG_FUNCTION_ARGS); diff --git a/src/dijkstra/dijkstra.c b/src/dijkstra/dijkstra.c index 16a3e9fd14..9ca158f6b1 100644 --- a/src/dijkstra/dijkstra.c +++ b/src/dijkstra/dijkstra.c @@ -34,11 +34,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. #include #include "c_common/postgres_connection.h" - #include "c_types/path_rt.h" -#include "c_common/debug_macro.h" -#include "c_common/e_report.h" -#include "c_common/time_msg.h" #include "process/shortestPath_process.h" PG_MODULE_MAGIC; diff --git a/src/metrics/bandwidth.c b/src/metrics/bandwidth.c index 828e45c3cf..652e8bfe51 100644 --- a/src/metrics/bandwidth.c +++ b/src/metrics/bandwidth.c @@ -27,14 +27,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. ********************************************************************PGR-GNU*/ -#include #include "c_common/postgres_connection.h" - -#include "c_types/iid_t_rt.h" -#include "c_common/debug_macro.h" -#include "c_common/e_report.h" -#include "c_common/time_msg.h" - #include "process/metrics_process.h" PGDLLEXPORT Datum _pgr_bandwidth(PG_FUNCTION_ARGS); diff --git a/src/ordering/cuthillMckeeOrdering.c b/src/ordering/cuthillMckeeOrdering.c index 53ac298b1b..6d0f035d40 100644 --- a/src/ordering/cuthillMckeeOrdering.c +++ b/src/ordering/cuthillMckeeOrdering.c @@ -27,11 +27,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. #include #include "c_common/postgres_connection.h" - -#include "c_common/debug_macro.h" -#include "c_common/e_report.h" -#include "c_common/time_msg.h" - #include "process/ordering_process.h" PGDLLEXPORT Datum _pgr_cuthillmckeeordering(PG_FUNCTION_ARGS); diff --git a/src/ordering/kingOrdering.c b/src/ordering/kingOrdering.c index 1d36d23b8d..9c89b1d121 100644 --- a/src/ordering/kingOrdering.c +++ b/src/ordering/kingOrdering.c @@ -27,11 +27,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. #include #include "c_common/postgres_connection.h" - -#include "c_common/debug_macro.h" -#include "c_common/e_report.h" -#include "c_common/time_msg.h" - #include "process/ordering_process.h" PGDLLEXPORT Datum _pgr_kingordering(PG_FUNCTION_ARGS); diff --git a/src/ordering/sloanOrdering.c b/src/ordering/sloanOrdering.c index 556be51234..8c35313550 100644 --- a/src/ordering/sloanOrdering.c +++ b/src/ordering/sloanOrdering.c @@ -27,11 +27,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. #include #include "c_common/postgres_connection.h" - -#include "c_common/debug_macro.h" -#include "c_common/e_report.h" -#include "c_common/time_msg.h" - #include "process/ordering_process.h" PGDLLEXPORT Datum _pgr_sloanordering(PG_FUNCTION_ARGS); diff --git a/src/ordering/topologicalSort.c b/src/ordering/topologicalSort.c index cf7dcb151f..7a07723c1e 100644 --- a/src/ordering/topologicalSort.c +++ b/src/ordering/topologicalSort.c @@ -29,11 +29,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. #include #include "c_common/postgres_connection.h" - -#include "c_common/debug_macro.h" -#include "c_common/e_report.h" -#include "c_common/time_msg.h" - #include "process/ordering_process.h" PGDLLEXPORT Datum _pgr_topologicalsort(PG_FUNCTION_ARGS); diff --git a/src/withPoints/withPoints.c b/src/withPoints/withPoints.c index 6a9c858012..1bfaddd47f 100644 --- a/src/withPoints/withPoints.c +++ b/src/withPoints/withPoints.c @@ -29,18 +29,12 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. #include #include "c_common/postgres_connection.h" - #include "c_types/path_rt.h" -#include "c_common/debug_macro.h" -#include "c_common/e_report.h" -#include "c_common/time_msg.h" #include "process/shortestPath_process.h" PGDLLEXPORT Datum _pgr_withpoints_v4(PG_FUNCTION_ARGS); PG_FUNCTION_INFO_V1(_pgr_withpoints_v4); - - PGDLLEXPORT Datum _pgr_withpoints_v4(PG_FUNCTION_ARGS) { FuncCallContext *funcctx;