diff --git a/NEWS.md b/NEWS.md index dc378716eb8..ede59539ed1 100644 --- a/NEWS.md +++ b/NEWS.md @@ -115,6 +115,14 @@ Summary of changes by function * Output columns standardized to ``(node, color)`` +* pgr_topologicalSort + + * Standardize output to ``(node)``-order + +* pgr_transitiveClosure + + * Standardized output to ``(node,targets)`` + * pgr_trsp * Function promoted to official. @@ -294,6 +302,13 @@ Standardize output columns of functions with different output columns within ove * [#2905](https://github.com/pgRouting/pgrouting/issues/2905) pgr_withPointsCostMatrix +**Standardized to ``(seq, path_id, path_seq, start_vid, end_vid, node, edge, cost, agg_cost)``** + +* [#2909](https://github.com/pgRouting/pgrouting/issues/2909) + pgr_edgeDisjointPaths +* [#2909](https://github.com/pgRouting/pgrouting/issues/2909) + pgr_turnRestrictedPaths + **Standardized to ``(edge, color)``** * [#2924](https://github.com/pgRouting/pgrouting/issues/2924) @@ -313,12 +328,15 @@ Standardize output columns of functions with different output columns within ove * [#2931](https://github.com/pgRouting/pgrouting/issues/2931) pgr_depthFirstSearch -**Standardized to ``(seq, path_id, path_seq, start_vid, end_vid, node, edge, cost, agg_cost)``** +**Standardized to ``(node)``-order** -* [#2909](https://github.com/pgRouting/pgrouting/issues/2909) - pgr_edgeDisjointPaths -* [#2909](https://github.com/pgRouting/pgrouting/issues/2909) - pgr_turnRestrictedPaths +* [#2934](https://github.com/pgRouting/pgrouting/issues/2934) + pgr_topologicalSort + +**Standardized to ``(node,targets)``** + +* [#2934](https://github.com/pgRouting/pgrouting/issues/2934) + pgr_transitiveClosure Removal of SQL deprecated signatures diff --git a/ci/winnie/build_pgrouting.sh b/ci/winnie/build_pgrouting.sh index bf820df0d74..a9f2018d93e 100644 --- a/ci/winnie/build_pgrouting.sh +++ b/ci/winnie/build_pgrouting.sh @@ -73,7 +73,7 @@ if [ $JENKINS_DEBUG -eq 1 ] then echo echo "***************************" - echo Recived variables used in this script + echo Received variables used in this script echo "**************************" echo "OS_BUILD ${OS_BUILD}" diff --git a/doc/CMakeLists.txt b/doc/CMakeLists.txt index 9608406041e..f01fdec0a98 100644 --- a/doc/CMakeLists.txt +++ b/doc/CMakeLists.txt @@ -68,7 +68,7 @@ message(STATUS "PROJECT_DOC_TARGETS = ${PROJECT_DOC_TARGETS}") #--------------------------------------------- #--------------------------------------------- -# LANGUAGES SETINGS +# LANGUAGES SETTINGS #--------------------------------------------- #--------------------------------------------- diff --git a/doc/categories/withPoints-category.rst b/doc/categories/withPoints-category.rst index 0daf52273db..408a3bea3c6 100644 --- a/doc/categories/withPoints-category.rst +++ b/doc/categories/withPoints-category.rst @@ -198,7 +198,7 @@ Points SQL * - ``fraction`` - **ANY-NUMERICAL** - - - Value in <0,1> that indicates the relative postition from the first end + - Value in <0,1> that indicates the relative position from the first end point of the edge. * - ``side`` - ``CHAR`` diff --git a/doc/conf.py.in b/doc/conf.py.in index b2b2c2a57a2..027c6d68b10 100644 --- a/doc/conf.py.in +++ b/doc/conf.py.in @@ -369,8 +369,7 @@ rst_epilog=""" .. |result-extract| replace:: ``(id, in_edges, out_edges, x, y, geom)`` .. |result-find| replace:: ``(edge_id, fraction, side, distance, geom, edge)`` .. |result-version| replace:: ``(version, build_type, compile_date, library, system, PostgreSQL, compiler, boost, hash)`` -.. |result-toposort| replace:: ``(seq, sorted_v)`` -.. |result-closure| replace:: ``(seq, vid, target_array)`` +.. |result-closure| replace:: ``(node,targets)`` .. |result-component-E| replace:: ``(seq, component, edge)`` .. |result-component-V| replace:: ``(seq, component, node)`` .. |result-component-make| replace:: ``(seq, start_vid, end_vid)`` diff --git a/doc/ordering/pgr_topologicalSort.rst b/doc/ordering/pgr_topologicalSort.rst index c65c30f5347..9b64c48c144 100644 --- a/doc/ordering/pgr_topologicalSort.rst +++ b/doc/ordering/pgr_topologicalSort.rst @@ -25,9 +25,13 @@ graphs (DAG). .. rubric:: Availability -* Version 3.0.0 +.. rubric:: Version 4.0.0 - * New experimental function. +* Standardize output to |result-node-order| + +.. rubric:: Version 3.0.0 + +* New experimental function. Description ------------------------------------------------------------------------------- @@ -60,7 +64,7 @@ Signatures | pgr_topologicalSort(`Edges SQL`_) - | Returns set of |result-toposort| + | Returns set of |result-node-order| | OR EMPTY SET :Example: Topologically sorting the graph @@ -89,7 +93,7 @@ Edges SQL Result columns ------------------------------------------------------------------------------- -Returns set of |result-toposort| +Returns set of |result-node-order| .. list-table:: :width: 81 @@ -102,7 +106,7 @@ Returns set of |result-toposort| * - ``seq`` - ``INTEGER`` - Sequential value starting from :math:`1` - * - ``sorted_v`` + * - ``node`` - ``BIGINT`` - Linear topological ordering of the vertices diff --git a/doc/src/migration.rst b/doc/src/migration.rst index 373242045c6..1d88924a069 100644 --- a/doc/src/migration.rst +++ b/doc/src/migration.rst @@ -53,6 +53,9 @@ Migration to standardized columns .. |result-disjoint-1-m| replace:: ``(seq, path_id, path_seq, end_vid, node, edge, cost, agg_cost)`` .. |result-disjoint-m-1| replace:: ``(seq, path_id, path_seq, start_vid, node, edge, cost, agg_cost)`` +.. |result-toposort| replace:: ``(seq, sorted_v)`` +.. |result-old-closure| replace:: ``(seq, vid, target_array)`` + There has been an effort to standardize function output columns names and types. @@ -118,6 +121,8 @@ types. - `Migration of multiple paths functions`_ * - .. versionchanged:: 4.0.0 :doc:`pgr_sequentialVertexColoring` - `Migration of output column name change`_ + * - .. versionchanged:: 4.0.0 :doc:`pgr_topologicalSort` + - `Migration of output column name change`_ * - .. versionchanged:: 4.0.0 :doc:`pgr_withPoints` - `Migration of single path functions`_ * - .. versionchanged:: 4.0.0 :doc:`pgr_withPointsCost` @@ -922,14 +927,15 @@ After updating pgRouting: Migration of output column name change ------------------------------------------------------------------------------- -The standardized result columns for color functions are +The standardized result columns: * |result_edge_color| * |result_node_color| +* |result-node-order| .. warning:: Breaking change - Changes must be done after updating pgRouting. + Changes on column names must be done after updating pgRouting. .. list-table:: :header-rows: 1 @@ -946,6 +952,43 @@ The standardized result columns for color functions are * - ``pgr_sequentialVertexColoring`` - v < 4.0.0 - :ref:`from_old_node_color` + * - ``pgr_topologicalSort`` + - v < 4.0.0 + - :ref:`from_toposort` + * - ``pgr_transitiveClosure`` + - v < 4.0.0 + - :ref:`from_old_closure` + +.. _from_old_closure: + +Migration from |result-old-closure| +................................................................................. + +Migration to: |result-old-closure| + +.. warning:: Breaking change + + Changes must be done after updating pgRouting. + +After update: + +* Remove column ``seq`` +* Rename ``vid`` to ``node`` and ``target_array`` to ``targets`` + +.. _from_toposort: + +Migration from |result-toposort| +................................................................................. + +Migration to: |result-node-order| + +.. warning:: Breaking change + + Changes must be done after updating pgRouting. + +After update: + +* Rename ``sorted_v`` to ``node`` .. _from_old_edge_color: @@ -962,8 +1005,6 @@ After update: * Rename ``edge_id`` to ``edge`` and ``color_id`` to ``color``. -.. TODO examples - .. _from_old_node_color: Migration from |old-node-color| @@ -979,8 +1020,6 @@ After update: * Rename ``vertex_id`` to ``node`` and ``color_id`` to ``color``. -.. TODO examples - Migration of deleted functions +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ diff --git a/doc/src/release_notes.rst b/doc/src/release_notes.rst index 264713c7562..41bfd1463f6 100644 --- a/doc/src/release_notes.rst +++ b/doc/src/release_notes.rst @@ -194,6 +194,18 @@ Summary of changes by function :start-after: Version 4.0.0 :end-before: .. rubric +* pgr_topologicalSort + + .. include:: pgr_topologicalSort.rst + :start-after: Version 4.0.0 + :end-before: .. rubric + +* pgr_transitiveClosure + + .. include:: pgr_transitiveClosure.rst + :start-after: Version 4.0.0 + :end-before: .. rubric + * pgr_trsp .. include:: pgr_trsp.rst @@ -342,6 +354,13 @@ Standardize output columns of functions with different output columns within ove * `#2905 `__ pgr_withPointsCostMatrix +.. rubric:: Standardized to |generic-result| + +* `#2909 `__ + pgr_edgeDisjointPaths +* `#2909 `__ + pgr_turnRestrictedPaths + .. rubric:: Standardized to |result_edge_color| * `#2924 `__ @@ -361,12 +380,15 @@ Standardize output columns of functions with different output columns within ove * `#2931 `__ pgr_depthFirstSearch -.. rubric:: Standardized to |generic-result| +.. rubric:: Standardized to |result-node-order| -* `#2909 `__ - pgr_edgeDisjointPaths -* `#2909 `__ - pgr_turnRestrictedPaths +* `#2934 `__ + pgr_topologicalSort + +.. rubric:: Standardized to |result-closure| + +* `#2934 `__ + pgr_transitiveClosure Removal of SQL deprecated signatures ............................................................................... diff --git a/doc/transitiveClosure/pgr_transitiveClosure.rst b/doc/transitiveClosure/pgr_transitiveClosure.rst index 5546035fc0b..b7c9a4a6097 100644 --- a/doc/transitiveClosure/pgr_transitiveClosure.rst +++ b/doc/transitiveClosure/pgr_transitiveClosure.rst @@ -24,9 +24,13 @@ .. rubric:: Availability -* Version 3.0.0 +.. rubric:: Version 4.0.0 - * New experimental function. +* Standardized output to |result-closure| + +.. rubric:: Version 3.0.0 + +* New experimental function. Description diff --git a/docqueries/ordering/topologicalSort.result b/docqueries/ordering/topologicalSort.result index ac0fd1cad1b..0c53f1bab25 100644 --- a/docqueries/ordering/topologicalSort.result +++ b/docqueries/ordering/topologicalSort.result @@ -9,25 +9,25 @@ SELECT * FROM pgr_topologicalsort( UNION SELECT id, target, source, reverse_cost FROM edges WHERE cost < 0$$); - seq | sorted_v ------+---------- - 1 | 1 - 2 | 5 - 3 | 2 - 4 | 4 - 5 | 3 - 6 | 13 - 7 | 14 - 8 | 15 - 9 | 10 - 10 | 6 - 11 | 7 - 12 | 8 - 13 | 9 - 14 | 11 - 15 | 16 - 16 | 12 - 17 | 17 + seq | node +-----+------ + 1 | 1 + 2 | 5 + 3 | 2 + 4 | 4 + 5 | 3 + 6 | 13 + 7 | 14 + 8 | 15 + 9 | 10 + 10 | 6 + 11 | 7 + 12 | 8 + 13 | 9 + 14 | 11 + 15 | 16 + 16 | 12 + 17 | 17 (17 rows) /* -- q2 */ @@ -37,25 +37,25 @@ SELECT * FROM pgr_topologicalsort( UNION SELECT id, source, target, -1, reverse_cost FROM edges WHERE cost < 0$$); - seq | sorted_v ------+---------- - 1 | 5 - 2 | 2 - 3 | 4 - 4 | 13 - 5 | 14 - 6 | 1 - 7 | 3 - 8 | 15 - 9 | 10 - 10 | 6 - 11 | 7 - 12 | 8 - 13 | 9 - 14 | 11 - 15 | 12 - 16 | 16 - 17 | 17 + seq | node +-----+------ + 1 | 5 + 2 | 2 + 3 | 4 + 4 | 13 + 5 | 14 + 6 | 1 + 7 | 3 + 8 | 15 + 9 | 10 + 10 | 6 + 11 | 7 + 12 | 8 + 13 | 9 + 14 | 11 + 15 | 12 + 16 | 16 + 17 | 17 (17 rows) /* -- q3 */ diff --git a/docqueries/transitiveClosure/transitiveClosure.pg b/docqueries/transitiveClosure/transitiveClosure.pg index a2503eb6661..e244f404460 100644 --- a/docqueries/transitiveClosure/transitiveClosure.pg +++ b/docqueries/transitiveClosure/transitiveClosure.pg @@ -4,5 +4,5 @@ SELECT * FROM pgr_transitiveclosure( 'SELECT id, source, target, cost, reverse_cost FROM edges WHERE id IN (2, 3, 5, 11, 12, 13, 15)') -ORDER BY vid; +ORDER BY node; /* -- q2 */ diff --git a/docqueries/transitiveClosure/transitiveClosure.result b/docqueries/transitiveClosure/transitiveClosure.result index e31a0fd6bf3..cfa529afa29 100644 --- a/docqueries/transitiveClosure/transitiveClosure.result +++ b/docqueries/transitiveClosure/transitiveClosure.result @@ -6,17 +6,17 @@ SET SELECT * FROM pgr_transitiveclosure( 'SELECT id, source, target, cost, reverse_cost FROM edges WHERE id IN (2, 3, 5, 11, 12, 13, 15)') -ORDER BY vid; - seq | vid | target_array ------+-----+-------------------- - 1 | 6 | {} - 6 | 8 | {12,17,16} - 2 | 10 | {12,17,16,11,6} - 4 | 11 | {12,17,16} - 5 | 12 | {17,16} - 3 | 15 | {12,17,16,10,11,6} - 8 | 16 | {17,16} - 7 | 17 | {17,16} +ORDER BY node; + node | targets +------+-------------------- + 6 | {} + 8 | {12,17,16} + 10 | {12,17,16,11,6} + 11 | {12,17,16} + 12 | {17,16} + 15 | {12,17,16,10,11,6} + 16 | {17,16} + 17 | {17,16} (8 rows) /* -- q2 */ diff --git a/doxygen/Doxyfile.in b/doxygen/Doxyfile.in index 516939a811a..871c7f6d015 100644 --- a/doxygen/Doxyfile.in +++ b/doxygen/Doxyfile.in @@ -1064,7 +1064,7 @@ HTML_STYLESHEET = # defined cascading style sheet that is included after the standard style sheets # created by doxygen. Using this option one can overrule certain style aspects. # This is preferred over using HTML_STYLESHEET since it does not replace the -# standard style sheet and is therefor more robust against future updates. +# standard style sheet and is therefore more robust against future updates. # Doxygen will copy the style sheet file to the output directory. For an example # see the documentation. # This tag requires that the tag GENERATE_HTML is set to YES. diff --git a/doxygen/contraction.dox b/doxygen/contraction.dox index c37f436c0cf..160b7ec2ec2 100644 --- a/doxygen/contraction.dox +++ b/doxygen/contraction.dox @@ -36,7 +36,7 @@ And with the additional characteristics: @subsection contraction_skeleton The contraction skeleton -In general we have an initial set up that may involve analizing the graph given as input and setting the +In general we have an initial set up that may involve analyzing the graph given as input and setting the non contractable nodes or edges. We have a cycle that will go and perform a contraction operation until while possible, and then move to the next contraction operation. Adding a new operation then becomes an "easy" task but more things might be involved, because the @@ -282,7 +282,7 @@ digraph G { @subsection contraction_examples_Sample Contraction of Sample Data - A weight different than 1 will be expressed explicitly. -* Perform dead end operation follwed with a linear operation. +* Perform dead end operation followed with a linear operation. * 1 cycle of contraction. diff --git a/doxygen/mainpage.dox b/doxygen/mainpage.dox index 2aa7dd396e8..bffc6a69ac7 100644 --- a/doxygen/mainpage.dox +++ b/doxygen/mainpage.dox @@ -15,7 +15,7 @@ A developer might want to: The following steps are based on: - [My Experience with GitHub](https://github.com/pgRouting/pgrouting/wiki/My-Experience-with-GitHub) -wirtten by Mohamed Zia +written by Mohamed Zia - [Git Branch Model](http://nvie.com/posts/a-successful-git-branching-model) @section install_sec Installation for developing diff --git a/include/bgraph/graph_to_edges.hpp b/include/bgraph/graph_to_edges.hpp index 945c2b9989c..92dbfcd02cc 100644 --- a/include/bgraph/graph_to_edges.hpp +++ b/include/bgraph/graph_to_edges.hpp @@ -42,7 +42,7 @@ namespace b_g { /** @brief converts a bg to Edges_t * @param[in] bg the boost graph - * @param[in] add_self_loop flagg to include self loops on the graph + * @param[in] add_self_loop flag to include self loops on the graph * @returns a set of Edges_t that exist on the graph * id, source, target, cost, reverse_cost * source < target diff --git a/include/cpp_common/basePath_SSEC.hpp b/include/cpp_common/basePath_SSEC.hpp index 82e1ac293e9..f55808eea24 100644 --- a/include/cpp_common/basePath_SSEC.hpp +++ b/include/cpp_common/basePath_SSEC.hpp @@ -318,7 +318,7 @@ class Path { */ while (target != v_source) { /* - * done when the predecesor of the target is the target + * done when the predecessor of the target is the target */ if (target == predecessors[target]) break; diff --git a/include/cpp_common/base_graph.hpp b/include/cpp_common/base_graph.hpp index d0115001e70..e014588eabd 100644 --- a/include/cpp_common/base_graph.hpp +++ b/include/cpp_common/base_graph.hpp @@ -117,7 +117,7 @@ boost::vecS, ~~~~ Initializing the graph ------------------------------ -Graph initialization is for seting the Vertices of the graph. +Graph initialization is for setting the Vertices of the graph. //TODO discuss if also the edges Vector of unique vertices of the graph ~~~~{.c} @@ -149,7 +149,7 @@ pgrouting::DirectedGraph digraph( 2. Initializes a graph based on the vertices: - vertices vector size is vertices.size() - the vertices are inserted - - vertices container can be clared to free memory + - vertices container can be cleared to free memory 3. Initializes a graph based on the vertices extracted - from edges stored on a C array - the vertices are inserted @@ -384,7 +384,7 @@ class Pgr_base_graph { /** @brief out degree of a vertex * - * regardles of undirected or directed graph + * regardless of undirected or directed graph * - out degree is returned */ degree_size_type out_degree(V &v) const { @@ -397,7 +397,7 @@ class Pgr_base_graph { /**@{*/ /** @brief get the vertex descriptor of the vertex When the vertex does not exist - - creates a new vetex + - creates a new vertex @return V: The vertex descriptor of the vertex */ V get_V(const T_V &vertex) { @@ -600,7 +600,7 @@ class Pgr_base_graph { size_t num_edges() const { return boost::num_edges(graph);} /**@}*/ - /** @name edge disconection/reconnection */ + /** @name edge disconnection/reconnection */ /**@{*/ /** @brief Disconnects all edges from p_from to p_to - No edge is disconnected if the vertices id's do not exist in the graph diff --git a/include/cpp_common/get_data.hpp b/include/cpp_common/get_data.hpp index 91c6bc43887..77a8df28991 100644 --- a/include/cpp_common/get_data.hpp +++ b/include/cpp_common/get_data.hpp @@ -41,7 +41,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. namespace pgrouting { -/** @brief Retrives the tuples +/** @brief Retrieves the tuples * @tparam Data_type Scructure of data * @tparam Func fetcher function * @param[in] sql Query to be processed @@ -104,7 +104,7 @@ void get_data( } namespace pgget { -/** @brief Retrives the tuples +/** @brief Retrieves the tuples * @tparam Data_type Scructure of data * @tparam Func fetcher function * @param[in] sql Query to be processed diff --git a/include/cpp_common/undefPostgresDefine.hpp b/include/cpp_common/undefPostgresDefine.hpp index ffa6b737bbd..84106842185 100644 --- a/include/cpp_common/undefPostgresDefine.hpp +++ b/include/cpp_common/undefPostgresDefine.hpp @@ -35,7 +35,7 @@ Has the line `#define snprintf pg_snprintf` Being `snprintf` part of [stdio.h](https://en.cppreference.com/w/cpp/header/cstdio) since C++11 -Work arount is to undef it. +Work around is to undef it. It's affecting boost 83+ diff --git a/include/dijkstra/drivingDist.hpp b/include/dijkstra/drivingDist.hpp index 897cd4ef627..d34ef120320 100644 --- a/include/dijkstra/drivingDist.hpp +++ b/include/dijkstra/drivingDist.hpp @@ -202,7 +202,7 @@ void remove_details(const G &graph, u = predecessors[v]; } - /* the vertex (or initial point) that is a predecesor of p */ + /* the vertex (or initial point) that is a predecessor of p */ predecessors[node] = u; } } diff --git a/include/spanningTree/pgr_randomSpanningTree.hpp b/include/spanningTree/pgr_randomSpanningTree.hpp index e385fd00b4e..70f5d8149c6 100644 --- a/include/spanningTree/pgr_randomSpanningTree.hpp +++ b/include/spanningTree/pgr_randomSpanningTree.hpp @@ -92,8 +92,8 @@ class Pgr_randomSpanningTree { log << "Unknown exception caught"; } - std::vector< SpanTree_rt > resul; - return resul; + std::vector< SpanTree_rt > result; + return result; #if 0 std::vector< SpanTree_rt > results; double totalcost = 0; diff --git a/include/trsp/trspHandler.hpp b/include/trsp/trspHandler.hpp index 5305202e04f..5f56797c3e1 100644 --- a/include/trsp/trspHandler.hpp +++ b/include/trsp/trspHandler.hpp @@ -57,7 +57,7 @@ class TrspHandler : public pgrouting::Pgr_messages { */ typedef std::pair> PDP; - /** @brief predecesor edge + /** @brief predecessor edge * * because each row represents 2 edges, this enumeration * is needed for the predecessors @@ -155,7 +155,7 @@ class TrspHandler : public pgrouting::Pgr_messages { std::vector m_edges; /** - * Used only to veryfy that there are no reppetitions inserted + * Used only to verify that there are no reppetitions inserted * the way it works, repeating edges id is not allowed * TODO when using points edges id are repeated */ diff --git a/include/vrp/initials_code.hpp b/include/vrp/initials_code.hpp index 466359d39d3..2c2374e1f1f 100644 --- a/include/vrp/initials_code.hpp +++ b/include/vrp/initials_code.hpp @@ -35,8 +35,8 @@ namespace vrp { enum Initials_code { OneTruck, /*! All orders in one truck */ OnePerTruck, /*! One Order per truck */ - FrontTruck, /*! Insetion at the front of the truck */ - BackTruck, /*! Insetion at the back of the truck */ + FrontTruck, /*! Insertion, at the front of the truck */ + BackTruck, /*! Insertion, at the back of the truck */ BestInsert, /*! Best place to insert Order */ BestBack, /*! Push back order that allows more orders to be inserted at the back */ BestFront, /*! Push front order that allows more orders to be inserted at the front */ diff --git a/include/vrp/order.hpp b/include/vrp/order.hpp index e63b4943420..17f6decff74 100644 --- a/include/vrp/order.hpp +++ b/include/vrp/order.hpp @@ -102,7 +102,7 @@ class Order : public Identifier { * An order is valid when: * - The pickup is well formed * - The delivery is well formed - * - isCompatibleIJ to go to delivery after inmediatly visiting pickup + * - isCompatibleIJ to go to delivery after immediately visiting pickup */ bool is_valid(double speed) const; diff --git a/include/vrp/pd_problem.hpp b/include/vrp/pd_problem.hpp index 717347daa81..8d6514ae051 100644 --- a/include/vrp/pd_problem.hpp +++ b/include/vrp/pd_problem.hpp @@ -46,7 +46,7 @@ class PD_problem { /** @brief Not wllowing to copy the problem */ PD_problem(const PD_problem &problem) = delete; - /** @brief Not allwing initialization without information */ + /** @brief Not allowing initialization without information */ PD_problem() = delete; }; diff --git a/include/vrp/vehicle.hpp b/include/vrp/vehicle.hpp index 5c08f0826b2..05ed66b7fdc 100644 --- a/include/vrp/vehicle.hpp +++ b/include/vrp/vehicle.hpp @@ -108,7 +108,7 @@ class Vehicle : public Identifier { @returns True if the operation was performed @warning Assertions are performed for out of range operations - @warning no feasability nor time window or capacity violations + @warning no feasibility nor time window or capacity violations checks are performed @todo TODO more deque like functions here */ diff --git a/include/yen/ksp.hpp b/include/yen/ksp.hpp index ce610d9b22f..6539e72cf4c 100644 --- a/include/yen/ksp.hpp +++ b/include/yen/ksp.hpp @@ -202,8 +202,7 @@ class Pgr_ksp : public Pgr_messages { protected: //! stores in subPath the first i elements of path void removeVertices(G &graph, const Path &subpath) { - for (const auto &e : subpath) - graph.disconnect_vertex(e.node); + for (const auto &e : subpath) graph.disconnect_vertex(e.node); } std::deque get_results() { @@ -258,12 +257,10 @@ namespace algorithms { pgrouting::yen::Pgr_ksp fn_yen; for (const auto &c : combinations) { - if (!graph.has_vertex(c.first)) - continue; + if (!graph.has_vertex(c.first)) continue; for (const auto &destination : c.second) { - if (!graph.has_vertex(destination)) - continue; + if (!graph.has_vertex(destination)) continue; fn_yen.clear(); auto result_path = fn_yen.Yen(graph, c.first, destination, k, heap_paths); diff --git a/include/yen/turnRestrictedPath.hpp b/include/yen/turnRestrictedPath.hpp index d6b737b15df..27badadb528 100644 --- a/include/yen/turnRestrictedPath.hpp +++ b/include/yen/turnRestrictedPath.hpp @@ -239,7 +239,7 @@ class Pgr_turnRestrictedPath : public Pgr_ksp< G > { /*! sets an inf value on agg_cost on the vertex/edge where the restriction begins * - * @param[in] paths that is being analized + * @param[in] paths that is being analyzed */ std::deque inf_cost_on_restriction(std::deque &paths) { if (paths.empty()) return paths; diff --git a/locale/en/LC_MESSAGES/pgrouting_doc_strings.po b/locale/en/LC_MESSAGES/pgrouting_doc_strings.po index 15808851882..984e42f6389 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 v3.8\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-06-29 15:49+0000\n" +"POT-Creation-Date: 2025-06-29 18:06+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -3005,7 +3005,7 @@ msgid "``fraction``" msgstr "" msgid "" -"Value in <0,1> that indicates the relative postition from the first end " +"Value in <0,1> that indicates the relative position from the first end " "point of the edge." msgstr "" @@ -4038,6 +4038,18 @@ msgstr "" msgid "pgr_sequentialVertexColoring" msgstr "" +msgid "pgr_topologicalSort" +msgstr "" + +msgid "Standardize output to |result-node-order|" +msgstr "" + +msgid "pgr_transitiveClosure" +msgstr "" + +msgid "Standardized output to |result-closure|" +msgstr "" + msgid "pgr_trsp" msgstr "" @@ -4342,6 +4354,19 @@ msgid "" "pgr_withPointsCostMatrix" msgstr "" +msgid "Standardized to |generic-result|" +msgstr "" + +msgid "" +"`#2909 `__ " +"pgr_edgeDisjointPaths" +msgstr "" + +msgid "" +"`#2909 `__ " +"pgr_turnRestrictedPaths" +msgstr "" + msgid "Standardized to |result_edge_color|" msgstr "" @@ -4376,17 +4401,20 @@ msgid "" "pgr_depthFirstSearch" msgstr "" -msgid "Standardized to |generic-result|" +msgid "Standardized to |result-node-order|" msgstr "" msgid "" -"`#2909 `__ " -"pgr_edgeDisjointPaths" +"`#2934 `__ " +"pgr_topologicalSort" +msgstr "" + +msgid "Standardized to |result-closure|" msgstr "" msgid "" -"`#2909 `__ " -"pgr_turnRestrictedPaths" +"`#2934 `__ " +"pgr_transitiveClosure" msgstr "" msgid "Removal of SQL deprecated signatures" @@ -5028,6 +5056,9 @@ msgstr "" msgid ":doc:`pgr_sequentialVertexColoring`" msgstr "" +msgid ":doc:`pgr_topologicalSort`" +msgstr "" + msgid ":doc:`pgr_withPoints`" msgstr "" @@ -5614,7 +5645,7 @@ msgstr "" msgid "Migration of output column name change" msgstr "" -msgid "The standardized result columns for color functions are" +msgid "The standardized result columns:" msgstr "" msgid "|result_edge_color|" @@ -5623,6 +5654,12 @@ msgstr "" msgid "|result_node_color|" msgstr "" +msgid "|result-node-order|" +msgstr "" + +msgid "Changes on column names must be done after updating pgRouting." +msgstr "" + msgid "``pgr_edgeColoring``" msgstr "" @@ -5638,15 +5675,48 @@ msgstr "" msgid "``pgr_sequentialVertexColoring``" msgstr "" -msgid "Migration from |old-edge-color|" +msgid "``pgr_topologicalSort``" msgstr "" -msgid "Migration to: |result_edge_color|" +msgid ":ref:`from_toposort`" +msgstr "" + +msgid "``pgr_transitiveClosure``" +msgstr "" + +msgid ":ref:`from_old_closure`" +msgstr "" + +msgid "Migration from |result-old-closure|" +msgstr "" + +msgid "Migration to: |result-old-closure|" msgstr "" msgid "After update:" msgstr "" +msgid "Remove column ``seq``" +msgstr "" + +msgid "Rename ``vid`` to ``node`` and ``target_array`` to ``targets``" +msgstr "" + +msgid "Migration from |result-toposort|" +msgstr "" + +msgid "Migration to: |result-node-order|" +msgstr "" + +msgid "Rename ``sorted_v`` to ``node``" +msgstr "" + +msgid "Migration from |old-edge-color|" +msgstr "" + +msgid "Migration to: |result_edge_color|" +msgstr "" + msgid "Rename ``edge_id`` to ``edge`` and ``color_id`` to ``color``." msgstr "" @@ -14537,18 +14607,12 @@ msgstr "" msgid "pgr_topologicalSort(`Edges SQL`_)" msgstr "" -msgid "Returns set of |result-toposort|" -msgstr "" - msgid "Topologically sorting the graph" msgstr "" msgid "Sequential value starting from :math:`1`" msgstr "" -msgid "``sorted_v``" -msgstr "" - msgid "Linear topological ordering of the vertices" msgstr "" @@ -17195,12 +17259,6 @@ msgstr "" msgid "pgr_dagShortestpath" msgstr "" -msgid "pgr_topologicalSort" -msgstr "" - -msgid "pgr_transitiveClosure" -msgstr "" - msgid "VRP category" msgstr "" diff --git a/locale/pot/pgrouting_doc_strings.pot b/locale/pot/pgrouting_doc_strings.pot index 3c3f84d9670..c4a33b38bb2 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.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-06-29 15:49+0000\n" +"POT-Creation-Date: 2025-06-29 18:06+0000\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -2758,7 +2758,7 @@ msgstr "" msgid "``fraction``" msgstr "" -msgid "Value in <0,1> that indicates the relative postition from the first end point of the edge." +msgid "Value in <0,1> that indicates the relative position from the first end point of the edge." msgstr "" msgid "``side``" @@ -3637,6 +3637,18 @@ msgstr "" msgid "pgr_sequentialVertexColoring" msgstr "" +msgid "pgr_topologicalSort" +msgstr "" + +msgid "Standardize output to |result-node-order|" +msgstr "" + +msgid "pgr_transitiveClosure" +msgstr "" + +msgid "Standardized output to |result-closure|" +msgstr "" + msgid "pgr_trsp" msgstr "" @@ -3874,6 +3886,15 @@ msgstr "" msgid "`#2905 `__ pgr_withPointsCostMatrix" msgstr "" +msgid "Standardized to |generic-result|" +msgstr "" + +msgid "`#2909 `__ pgr_edgeDisjointPaths" +msgstr "" + +msgid "`#2909 `__ pgr_turnRestrictedPaths" +msgstr "" + msgid "Standardized to |result_edge_color|" msgstr "" @@ -3898,13 +3919,16 @@ msgstr "" msgid "`#2931 `__ pgr_depthFirstSearch" msgstr "" -msgid "Standardized to |generic-result|" +msgid "Standardized to |result-node-order|" msgstr "" -msgid "`#2909 `__ pgr_edgeDisjointPaths" +msgid "`#2934 `__ pgr_topologicalSort" msgstr "" -msgid "`#2909 `__ pgr_turnRestrictedPaths" +msgid "Standardized to |result-closure|" +msgstr "" + +msgid "`#2934 `__ pgr_transitiveClosure" msgstr "" msgid "Removal of SQL deprecated signatures" @@ -4438,6 +4462,9 @@ msgstr "" msgid ":doc:`pgr_sequentialVertexColoring`" msgstr "" +msgid ":doc:`pgr_topologicalSort`" +msgstr "" + msgid ":doc:`pgr_withPoints`" msgstr "" @@ -4936,7 +4963,7 @@ msgstr "" msgid "Migration of output column name change" msgstr "" -msgid "The standardized result columns for color functions are" +msgid "The standardized result columns:" msgstr "" msgid "|result_edge_color|" @@ -4945,6 +4972,12 @@ msgstr "" msgid "|result_node_color|" msgstr "" +msgid "|result-node-order|" +msgstr "" + +msgid "Changes on column names must be done after updating pgRouting." +msgstr "" + msgid "``pgr_edgeColoring``" msgstr "" @@ -4960,15 +4993,48 @@ msgstr "" msgid "``pgr_sequentialVertexColoring``" msgstr "" -msgid "Migration from |old-edge-color|" +msgid "``pgr_topologicalSort``" msgstr "" -msgid "Migration to: |result_edge_color|" +msgid ":ref:`from_toposort`" +msgstr "" + +msgid "``pgr_transitiveClosure``" +msgstr "" + +msgid ":ref:`from_old_closure`" +msgstr "" + +msgid "Migration from |result-old-closure|" +msgstr "" + +msgid "Migration to: |result-old-closure|" msgstr "" msgid "After update:" msgstr "" +msgid "Remove column ``seq``" +msgstr "" + +msgid "Rename ``vid`` to ``node`` and ``target_array`` to ``targets``" +msgstr "" + +msgid "Migration from |result-toposort|" +msgstr "" + +msgid "Migration to: |result-node-order|" +msgstr "" + +msgid "Rename ``sorted_v`` to ``node``" +msgstr "" + +msgid "Migration from |old-edge-color|" +msgstr "" + +msgid "Migration to: |result_edge_color|" +msgstr "" + msgid "Rename ``edge_id`` to ``edge`` and ``color_id`` to ``color``." msgstr "" @@ -12337,18 +12403,12 @@ msgstr "" msgid "pgr_topologicalSort(`Edges SQL`_)" msgstr "" -msgid "Returns set of |result-toposort|" -msgstr "" - msgid "Topologically sorting the graph" msgstr "" msgid "Sequential value starting from :math:`1`" msgstr "" -msgid "``sorted_v``" -msgstr "" - msgid "Linear topological ordering of the vertices" msgstr "" @@ -14347,12 +14407,6 @@ msgstr "" msgid "pgr_dagShortestpath" msgstr "" -msgid "pgr_topologicalSort" -msgstr "" - -msgid "pgr_transitiveClosure" -msgstr "" - msgid "VRP category" msgstr "" diff --git a/pgtap/astar/astar/compare_dijkstra/combinations.pg b/pgtap/astar/astar/compare_dijkstra/combinations.pg index e26e6f9aec6..836e70b5b69 100644 --- a/pgtap/astar/astar/compare_dijkstra/combinations.pg +++ b/pgtap/astar/astar/compare_dijkstra/combinations.pg @@ -27,7 +27,7 @@ SELECT CASE WHEN min_version('3.2.0') THEN plan(4) ELSE plan(1) END; UPDATE edges SET cost = sign(cost) + 0.001 * id * id, reverse_cost = sign(reverse_cost) + 0.001 * id * id; -CREATE or REPLACE FUNCTION astarCompareDijkstra(cant INTEGER default 17) +CREATE or REPLACE FUNCTION astarCompareDijkstra(lim INTEGER default 17) RETURNS SETOF TEXT AS $BODY$ DECLARE diff --git a/pgtap/astar/astar/compare_dijkstra/many_to_many.pg b/pgtap/astar/astar/compare_dijkstra/many_to_many.pg index bcd15bb190e..a46b35ef5d4 100644 --- a/pgtap/astar/astar/compare_dijkstra/many_to_many.pg +++ b/pgtap/astar/astar/compare_dijkstra/many_to_many.pg @@ -27,7 +27,7 @@ SELECT plan(4); UPDATE edges SET cost = sign(cost) + 0.001 * id * id, reverse_cost = sign(reverse_cost) + 0.001 * id * id; -CREATE or REPLACE FUNCTION astarCompareDijkstra(cant INTEGER default 17) +CREATE or REPLACE FUNCTION astarCompareDijkstra(lim INTEGER default 17) RETURNS SETOF TEXT AS $BODY$ DECLARE diff --git a/pgtap/astar/astar/compare_dijkstra/many_to_one.pg b/pgtap/astar/astar/compare_dijkstra/many_to_one.pg index 277f116dbd7..73524265f33 100644 --- a/pgtap/astar/astar/compare_dijkstra/many_to_one.pg +++ b/pgtap/astar/astar/compare_dijkstra/many_to_one.pg @@ -29,7 +29,7 @@ SET client_min_messages TO ERROR; UPDATE edges SET cost = sign(cost) + 0.001 * id * id, reverse_cost = sign(reverse_cost) + 0.001 * id * id; -CREATE or REPLACE FUNCTION astarCompareDijkstra(cant INTEGER default 17) +CREATE or REPLACE FUNCTION astarCompareDijkstra(lim INTEGER default 17) RETURNS SETOF TEXT AS $BODY$ DECLARE @@ -47,7 +47,7 @@ BEGIN vids := ' ARRAY[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18] '; - FOR i IN 1.. cant LOOP + FOR i IN 1.. lim LOOP ----------------------- -- with reverse cost diff --git a/pgtap/astar/astar/compare_dijkstra/one_to_many.pg b/pgtap/astar/astar/compare_dijkstra/one_to_many.pg index f448a22e046..1e4dcedc673 100644 --- a/pgtap/astar/astar/compare_dijkstra/one_to_many.pg +++ b/pgtap/astar/astar/compare_dijkstra/one_to_many.pg @@ -29,7 +29,7 @@ SET client_min_messages TO ERROR; UPDATE edges SET cost = sign(cost) + 0.001 * id * id, reverse_cost = sign(reverse_cost) + 0.001 * id * id; -CREATE or REPLACE FUNCTION astarCompareDijkstra(cant INTEGER default 17) +CREATE or REPLACE FUNCTION astarCompareDijkstra(lim INTEGER default 17) RETURNS SETOF TEXT AS $BODY$ DECLARE @@ -47,7 +47,7 @@ BEGIN vids = ' ARRAY[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18] '; - FOR i IN 1.. cant LOOP + FOR i IN 1.. lim LOOP ----------------------- -- with reverse cost diff --git a/pgtap/astar/astar/compare_dijkstra/one_to_one.pg b/pgtap/astar/astar/compare_dijkstra/one_to_one.pg index ec6d0436212..9c3dd88130e 100644 --- a/pgtap/astar/astar/compare_dijkstra/one_to_one.pg +++ b/pgtap/astar/astar/compare_dijkstra/one_to_one.pg @@ -27,7 +27,7 @@ SELECT plan(612); UPDATE edges SET cost = sign(cost) + 0.001 * id * id, reverse_cost = sign(reverse_cost) + 0.001 * id * id; -CREATE or REPLACE FUNCTION astarCompareDijkstra(cant INTEGER default 17) +CREATE or REPLACE FUNCTION astarCompareDijkstra(lim INTEGER default 17) RETURNS SETOF TEXT AS $BODY$ DECLARE @@ -42,8 +42,8 @@ BEGIN result_columns := ' seq, path_seq, round(cost::numeric,8) AS cost, round(agg_cost::numeric,8) AS agg_cost '; END IF; - FOR i IN 1.. cant BY 2 LOOP - FOR j IN 1.. cant LOOP + FOR i IN 1.. lim BY 2 LOOP + FOR j IN 1.. lim LOOP -- DIRECTED WITH REVERSE COST inner_sql := 'SELECT id, source, target, cost, reverse_cost, x1, y1, x2, y2 FROM edges'; diff --git a/pgtap/astar/edge_cases/many_to_many_eq_combinations.pg b/pgtap/astar/edge_cases/many_to_many_eq_combinations.pg index 9b197cfe81c..70b830ba731 100644 --- a/pgtap/astar/edge_cases/many_to_many_eq_combinations.pg +++ b/pgtap/astar/edge_cases/many_to_many_eq_combinations.pg @@ -24,7 +24,7 @@ SELECT plan(2); UPDATE edges SET cost = sign(cost) + 0.001 * id * id, reverse_cost = sign(reverse_cost) + 0.001 * id * id; -CREATE OR REPLACE FUNCTION astar_combinations(sql_TestFunction TEXT, cant INTEGER DEFAULT 18 ) +CREATE OR REPLACE FUNCTION astar_combinations(sql_TestFunction TEXT, lim INTEGER DEFAULT 18 ) RETURNS SETOF TEXT AS $BODY$ DECLARE @@ -39,15 +39,15 @@ BEGIN sql_Combinations := ''; sql_Many := ''; - FOR i IN 1.. cant LOOP + FOR i IN 1.. lim LOOP IF (i > 1) THEN sql_Many := sql_Many ||', '; END IF; sql_Many := sql_Many || i ; END LOOP; - FOR i IN 1.. cant LOOP - FOR j IN 1..cant LOOP + FOR i IN 1.. lim LOOP + FOR j IN 1..lim LOOP IF NOT (i = j) THEN sql_Combinations := sql_Combinations || '(' || i || ',' || j || '),' ; END IF; diff --git a/pgtap/bdAstar/bdAstar/compare_dijkstra/one_to_one.pg b/pgtap/bdAstar/bdAstar/compare_dijkstra/one_to_one.pg index 8bd45a8c2db..39eab96ec54 100644 --- a/pgtap/bdAstar/bdAstar/compare_dijkstra/one_to_one.pg +++ b/pgtap/bdAstar/bdAstar/compare_dijkstra/one_to_one.pg @@ -26,7 +26,7 @@ SELECT plan(544); UPDATE edges SET cost = sign(cost) + 0.001 * id * id, reverse_cost = sign(reverse_cost) + 0.001 * id * id; -CREATE or REPLACE FUNCTION bdastar_compare_dijkstra(cant INTEGER default 17) +CREATE or REPLACE FUNCTION bdastar_compare_dijkstra(lim INTEGER default 17) RETURNS SETOF TEXT AS $BODY$ DECLARE @@ -34,8 +34,8 @@ inner_sql TEXT; dijkstra_sql TEXT; bdastar_sql TEXT; BEGIN - FOR i IN 1.. cant LOOP - FOR j IN 2.. cant BY 2 LOOP + FOR i IN 1.. lim LOOP + FOR j IN 2.. lim BY 2 LOOP -- DIRECTED -- with reverse_cost diff --git a/pgtap/bdAstar/edge_cases/many_to_many_eq_combinations.pg b/pgtap/bdAstar/edge_cases/many_to_many_eq_combinations.pg index baf5a536b1e..52dccf956c2 100644 --- a/pgtap/bdAstar/edge_cases/many_to_many_eq_combinations.pg +++ b/pgtap/bdAstar/edge_cases/many_to_many_eq_combinations.pg @@ -24,7 +24,7 @@ SELECT plan(2); UPDATE edges SET cost = sign(cost) + 0.001 * id * id, reverse_cost = sign(reverse_cost) + 0.001 * id * id; -create or REPLACE FUNCTION foo( sql_TestFunction TEXT, cant INTEGER default 18 ) +create or REPLACE FUNCTION foo( sql_TestFunction TEXT, lim INTEGER default 18 ) RETURNS SETOF TEXT AS $BODY$ DECLARE @@ -40,15 +40,15 @@ BEGIN sql_Combinations := ''; sql_Many := ''; - FOR i IN 1.. cant LOOP + FOR i IN 1.. lim LOOP IF (i > 1) THEN sql_Many := sql_Many ||', '; END IF; sql_Many := sql_Many || i ; END LOOP; - FOR i IN 1.. cant LOOP - FOR j IN 1..cant LOOP + FOR i IN 1.. lim LOOP + FOR j IN 1..lim LOOP IF NOT (i = j) THEN sql_Combinations := sql_Combinations || '(' || i || ',' || j || '),' ; END IF; diff --git a/pgtap/bdDijkstra/bdDijkstra/compare_dijkstra/one_to_one.pg b/pgtap/bdDijkstra/bdDijkstra/compare_dijkstra/one_to_one.pg index bf9e8150237..9d0e45e881c 100644 --- a/pgtap/bdDijkstra/bdDijkstra/compare_dijkstra/one_to_one.pg +++ b/pgtap/bdDijkstra/bdDijkstra/compare_dijkstra/one_to_one.pg @@ -25,7 +25,7 @@ SELECT plan(544); UPDATE edges SET cost = sign(cost) + 0.001 * id * id, reverse_cost = sign(reverse_cost) + 0.001 * id * id; -CREATE or REPLACE FUNCTION bddijkstra_compare_dijkstra(cant INTEGER default 17) +CREATE or REPLACE FUNCTION bddijkstra_compare_dijkstra(lim INTEGER default 17) RETURNS SETOF TEXT AS $BODY$ DECLARE @@ -34,8 +34,8 @@ dijkstra_sql TEXT; bddijkstra_sql TEXT; BEGIN - FOR i IN 1.. cant LOOP - FOR j IN 2.. cant BY 2 LOOP + FOR i IN 1.. lim LOOP + FOR j IN 2.. lim BY 2 LOOP -- DIRECTED inner_sql := 'SELECT id, source, target, cost, reverse_cost FROM edges'; diff --git a/pgtap/bdDijkstra/bdDijkstra/edge_cases/remaining_tests.pg b/pgtap/bdDijkstra/bdDijkstra/edge_cases/remaining_tests.pg index 8404a4a1a50..9e17e51df29 100644 --- a/pgtap/bdDijkstra/bdDijkstra/edge_cases/remaining_tests.pg +++ b/pgtap/bdDijkstra/bdDijkstra/edge_cases/remaining_tests.pg @@ -44,7 +44,7 @@ SELECT 'integer'::text AS t1,'integer'::text AS t2, SELECT set_eq('v21q00', 'v21q01','Expected columns names & types in version 2.4'); --- CHECKING WORKS WITH & WITOUT REVERSE COST +-- CHECKING WORKS WITH & WITHOUT REVERSE COST PREPARE v20q1 AS SELECT * FROM pgr_bddijkstra( diff --git a/pgtap/bdDijkstra/edge_cases/many_to_many_eq_combinations.pg b/pgtap/bdDijkstra/edge_cases/many_to_many_eq_combinations.pg index 6d245e68382..bea9a056062 100644 --- a/pgtap/bdDijkstra/edge_cases/many_to_many_eq_combinations.pg +++ b/pgtap/bdDijkstra/edge_cases/many_to_many_eq_combinations.pg @@ -24,7 +24,7 @@ SELECT plan(2); UPDATE edges SET cost = sign(cost) + 0.001 * id * id, reverse_cost = sign(reverse_cost) + 0.001 * id * id; -create or REPLACE FUNCTION test_function( sql_TestFunction TEXT, cant INTEGER default 18 ) +create or REPLACE FUNCTION test_function( sql_TestFunction TEXT, lim INTEGER default 18 ) RETURNS SETOF TEXT AS $BODY$ DECLARE @@ -40,15 +40,15 @@ BEGIN sql_Combinations := ''; sql_Many := ''; - FOR i IN 1.. cant LOOP + FOR i IN 1.. lim LOOP IF (i > 1) THEN sql_Many := sql_Many ||', '; END IF; sql_Many := sql_Many || i ; END LOOP; - FOR i IN 1.. cant LOOP - FOR j IN 1..cant LOOP + FOR i IN 1.. lim LOOP + FOR j IN 1..lim LOOP IF NOT (i = j) THEN sql_Combinations := sql_Combinations || '(' || i || ',' || j || '),' ; END IF; diff --git a/pgtap/bellman_ford/bellman_ford/compare_dijkstra.pg b/pgtap/bellman_ford/bellman_ford/compare_dijkstra.pg index 5b79397d12d..08213e19b04 100644 --- a/pgtap/bellman_ford/bellman_ford/compare_dijkstra.pg +++ b/pgtap/bellman_ford/bellman_ford/compare_dijkstra.pg @@ -23,7 +23,7 @@ SELECT plan(1300); UPDATE edges SET cost = sign(cost) + 0.001 * id * id, reverse_cost = sign(reverse_cost) + 0.001 * id * id; -CREATE or REPLACE FUNCTION bellman_ford_compare_dijkstra(cant INTEGER default 17) +CREATE or REPLACE FUNCTION bellman_ford_compare_dijkstra(lim INTEGER default 17) RETURNS SETOF TEXT AS $BODY$ DECLARE @@ -48,7 +48,7 @@ BEGIN END IF; - -- All These tests should work when pgr_bellmanFord 's output is standarized + -- All These tests should work when pgr_bellmanFord 's output is standardized RETURN QUERY SELECT compare_dijkstra_one_one('pgr_bellmanFord', true); RETURN QUERY SELECT compare_dijkstra_one_one('pgr_bellmanFord', false); diff --git a/pgtap/bellman_ford/bellman_ford/edge_cases/many_to_many_eq_combinations.pg b/pgtap/bellman_ford/bellman_ford/edge_cases/many_to_many_eq_combinations.pg index 0e05e2f8f31..2558c0b505b 100644 --- a/pgtap/bellman_ford/bellman_ford/edge_cases/many_to_many_eq_combinations.pg +++ b/pgtap/bellman_ford/bellman_ford/edge_cases/many_to_many_eq_combinations.pg @@ -23,7 +23,7 @@ SELECT plan(1); UPDATE edges SET cost = sign(cost) + 0.001 * id * id, reverse_cost = sign(reverse_cost) + 0.001 * id * id; -CREATE OR REPLACE FUNCTION foo( sql_TestFunction TEXT, cant INTEGER default 18 ) +CREATE OR REPLACE FUNCTION foo( sql_TestFunction TEXT, lim INTEGER default 18 ) RETURNS SETOF TEXT AS $BODY$ DECLARE @@ -38,15 +38,15 @@ BEGIN sql_Combinations := ''; sql_Many := ''; - FOR i IN 1.. cant LOOP + FOR i IN 1.. lim LOOP IF (i > 1) THEN sql_Many := sql_Many ||', '; END IF; sql_Many := sql_Many || i ; END LOOP; - FOR i IN 1.. cant LOOP - FOR j IN 1..cant LOOP + FOR i IN 1.. lim LOOP + FOR j IN 1..lim LOOP IF NOT (i = j) THEN sql_Combinations := sql_Combinations || '(' || i || ',' || j || '),' ; END IF; diff --git a/pgtap/bellman_ford/edwardMoore/compare_dijkstra.pg b/pgtap/bellman_ford/edwardMoore/compare_dijkstra.pg index 19f8eb51db9..01bb42b0881 100644 --- a/pgtap/bellman_ford/edwardMoore/compare_dijkstra.pg +++ b/pgtap/bellman_ford/edwardMoore/compare_dijkstra.pg @@ -23,7 +23,7 @@ SELECT CASE WHEN min_version('3.1.1') THEN plan(1300) ELSE plan(1) END; UPDATE edges SET cost = sign(cost) + 0.001 * id * id, reverse_cost = sign(reverse_cost) + 0.001 * id * id; -CREATE or REPLACE FUNCTION edwardMoore_compare_dijkstra(cant INTEGER default 17) +CREATE or REPLACE FUNCTION edwardMoore_compare_dijkstra(lim INTEGER default 17) RETURNS SETOF TEXT AS $BODY$ DECLARE @@ -40,7 +40,7 @@ BEGIN IF min_version('3.5.0') THEN -- v3.5.0+ - -- pgr_edwardMoore has out put is not standarized + -- pgr_edwardMoore has out put is not standardized RETURN QUERY SELECT compare_dijkstra_one_one('pgr_edwardMoore', true, 'seq, path_seq, node, edge, cost, agg_cost'); RETURN QUERY SELECT compare_dijkstra_one_one('pgr_edwardMoore', false, 'seq, path_seq, node, edge, cost, agg_cost'); RETURN QUERY SELECT compare_dijkstra_one_many('pgr_edwardMoore', true, 'seq, path_seq, end_vid, node, edge, cost, agg_cost'); @@ -55,7 +55,7 @@ BEGIN END IF; - -- All These tests should work when pgr_edwardMoore 's output is standarized + -- All These tests should work when pgr_edwardMoore 's output is standardized RETURN QUERY SELECT compare_dijkstra_one_one('pgr_edwardMoore', true); RETURN QUERY SELECT compare_dijkstra_one_one('pgr_edwardMoore', false); RETURN QUERY SELECT compare_dijkstra_one_many('pgr_edwardMoore', true); diff --git a/pgtap/bellman_ford/edwardMoore/edge_cases/many_to_many_eq_combinations.pg b/pgtap/bellman_ford/edwardMoore/edge_cases/many_to_many_eq_combinations.pg index 5e84cba2ef6..ad8df06acf3 100644 --- a/pgtap/bellman_ford/edwardMoore/edge_cases/many_to_many_eq_combinations.pg +++ b/pgtap/bellman_ford/edwardMoore/edge_cases/many_to_many_eq_combinations.pg @@ -23,7 +23,7 @@ SELECT plan(1); UPDATE edges SET cost = sign(cost) + 0.001 * id * id, reverse_cost = sign(reverse_cost) + 0.001 * id * id; -CREATE OR REPLACE FUNCTION compare_many_to_many( sql_TestFunction TEXT, cant INTEGER default 18 ) +CREATE OR REPLACE FUNCTION compare_many_to_many( sql_TestFunction TEXT, lim INTEGER default 18 ) RETURNS SETOF TEXT AS $BODY$ DECLARE @@ -38,15 +38,15 @@ BEGIN sql_Combinations := ''; sql_Many := ''; - FOR i IN 1.. cant LOOP + FOR i IN 1.. lim LOOP IF (i > 1) THEN sql_Many := sql_Many ||', '; END IF; sql_Many := sql_Many || i ; END LOOP; - FOR i IN 1.. cant LOOP - FOR j IN 1..cant LOOP + FOR i IN 1.. lim LOOP + FOR j IN 1..lim LOOP IF NOT (i = j) THEN sql_Combinations := sql_Combinations || '(' || i || ',' || j || '),' ; END IF; diff --git a/pgtap/coloring/bipartite/edge_cases.pg b/pgtap/coloring/bipartite/edge_cases.pg index e6fd7774246..0ee3acc6904 100644 --- a/pgtap/coloring/bipartite/edge_cases.pg +++ b/pgtap/coloring/bipartite/edge_cases.pg @@ -145,7 +145,7 @@ SELECT set_eq('bipartite5', $$VALUES (5, 0), (6, 1), (10, 0), (15, 1)$$, '10: Bi --- even lenght cycle test +-- even length cycle test -- 4 vertices length PREPARE q6 AS @@ -213,7 +213,7 @@ FROM pgr_bipartite( RETURN QUERY -SELECT is_empty('bipartite7', '14: Graph with odd lenght cycle -> Empty row is returned'); +SELECT is_empty('bipartite7', '14: Graph with odd length cycle -> Empty row is returned'); -- 5 vertices cyclic @@ -257,7 +257,7 @@ FROM pgr_bipartite( RETURN QUERY -SELECT is_empty('bipartite8', '16: Graph with odd lenght cycle -> Empty row is returned'); +SELECT is_empty('bipartite8', '16: Graph with odd length cycle -> Empty row is returned'); END; diff --git a/pgtap/components/makeConnected/edge_cases.pg b/pgtap/components/makeConnected/edge_cases.pg index 9d409dfe586..c7a7318f745 100644 --- a/pgtap/components/makeConnected/edge_cases.pg +++ b/pgtap/components/makeConnected/edge_cases.pg @@ -122,7 +122,7 @@ RETURN QUERY SELECT results_eq('twoVerticesTest10', 'SELECT 1::BIGINT', '10: u<->u v<->v => One row'); --- 3 vertices tests ====> Already Connnected +-- 3 vertices tests ====> Already Connected PREPARE q11 AS SELECT id, source, target, cost, reverse_cost @@ -141,7 +141,7 @@ SELECT is_empty('threeVerticesTest12', '12: u<->v<-w already Connected => Empty' --- 3 vertices tests ====> Not Connnected +-- 3 vertices tests ====> Not Connected PREPARE q13 AS SELECT id, source, source AS target, cost, reverse_cost FROM edges WHERE id = 2 diff --git a/pgtap/dijkstra/dijkstra/edge_cases/manyToMany_equiv_combinations.pg b/pgtap/dijkstra/dijkstra/edge_cases/manyToMany_equiv_combinations.pg index c6f8e1ba87c..43b70ebb8e3 100644 --- a/pgtap/dijkstra/dijkstra/edge_cases/manyToMany_equiv_combinations.pg +++ b/pgtap/dijkstra/dijkstra/edge_cases/manyToMany_equiv_combinations.pg @@ -24,7 +24,7 @@ SELECT plan(2); UPDATE edges SET cost = sign(cost) + 0.001 * id * id, reverse_cost = sign(reverse_cost) + 0.001 * id * id; -create or REPLACE FUNCTION foo( sql_TestFunction TEXT, cant INTEGER default 18 ) +create or REPLACE FUNCTION foo( sql_TestFunction TEXT, lim INTEGER default 18 ) RETURNS SETOF TEXT AS $BODY$ DECLARE @@ -40,15 +40,15 @@ BEGIN sql_Combinations := ''; sql_Many := ''; - FOR i IN 1.. cant LOOP + FOR i IN 1.. lim LOOP IF (i > 1) THEN sql_Many := sql_Many ||', '; END IF; sql_Many := sql_Many || i ; END LOOP; - FOR i IN 1.. cant LOOP - FOR j IN 1..cant LOOP + FOR i IN 1.. lim LOOP + FOR j IN 1..lim LOOP IF NOT (i = j) THEN sql_Combinations := sql_Combinations || '(' || i || ',' || j || '),' ; END IF; diff --git a/pgtap/dijkstra/dijkstra/edge_cases/oneToOne_equiv_manyToMany.pg b/pgtap/dijkstra/dijkstra/edge_cases/oneToOne_equiv_manyToMany.pg index 3569e029aaa..8d39ab7aabf 100644 --- a/pgtap/dijkstra/dijkstra/edge_cases/oneToOne_equiv_manyToMany.pg +++ b/pgtap/dijkstra/dijkstra/edge_cases/oneToOne_equiv_manyToMany.pg @@ -25,7 +25,7 @@ SELECT plan(1); UPDATE edges SET cost = sign(cost) + 0.001 * id * id, reverse_cost = sign(reverse_cost) + 0.001 * id * id; -create or REPLACE FUNCTION foo(cant INTEGER default 18 ) +create or REPLACE FUNCTION foo(lim INTEGER default 18 ) RETURNS SETOF TEXT AS $BODY$ DECLARE @@ -35,13 +35,13 @@ BEGIN sql_OneToOne := ''; sql_Many := ''; - FOR i IN 1.. cant LOOP + FOR i IN 1.. lim LOOP IF (i > 1) THEN sql_Many := sql_Many ||', '; END IF; sql_Many := sql_Many || i ; END LOOP; - FOR i IN 1.. cant LOOP - FOR j IN 1..cant LOOP + FOR i IN 1.. lim LOOP + FOR j IN 1..lim LOOP IF NOT (i = 1 AND j = 1) THEN sql_OneToOne := sql_OneToOne ||' UNION ALL'; diff --git a/pgtap/dijkstra/dijkstra/edge_cases/oneToOne_equiv_manyToOne.pg b/pgtap/dijkstra/dijkstra/edge_cases/oneToOne_equiv_manyToOne.pg index 3271c97cfe0..d333e6cc32e 100644 --- a/pgtap/dijkstra/dijkstra/edge_cases/oneToOne_equiv_manyToOne.pg +++ b/pgtap/dijkstra/dijkstra/edge_cases/oneToOne_equiv_manyToOne.pg @@ -25,7 +25,7 @@ SELECT plan(18); UPDATE edges SET cost = sign(cost) + 0.001 * id * id, reverse_cost = sign(reverse_cost) + 0.001 * id * id; -create or REPLACE FUNCTION foo(cant INTEGER default 18 ) +create or REPLACE FUNCTION foo(lim INTEGER default 18 ) RETURNS SETOF TEXT AS $BODY$ DECLARE @@ -33,10 +33,10 @@ sql_OneToOne TEXT; sql_Many TEXT; BEGIN - FOR i IN 1.. cant LOOP + FOR i IN 1.. lim LOOP sql_OneToOne := ''; sql_Many := ''; - FOR j IN 1..cant LOOP + FOR j IN 1..lim LOOP IF j > 1 THEN sql_OneToOne := sql_OneToOne diff --git a/pgtap/dijkstra/dijkstra/edge_cases/oneToOne_equiv_oneToMany.pg b/pgtap/dijkstra/dijkstra/edge_cases/oneToOne_equiv_oneToMany.pg index 304fe89111e..1087624e595 100644 --- a/pgtap/dijkstra/dijkstra/edge_cases/oneToOne_equiv_oneToMany.pg +++ b/pgtap/dijkstra/dijkstra/edge_cases/oneToOne_equiv_oneToMany.pg @@ -24,7 +24,7 @@ SELECT plan(36); UPDATE edges SET cost = sign(cost) + 0.001 * id * id, reverse_cost = sign(reverse_cost) + 0.001 * id * id; -create or REPLACE FUNCTION foo(cant INTEGER default 18, flag boolean default true ) +create or REPLACE FUNCTION foo(lim INTEGER default 18, flag boolean default true ) RETURNS SETOF TEXT AS $BODY$ DECLARE @@ -33,10 +33,10 @@ sql_OneToMany TEXT; BEGIN sql_OneToMany := ''; - FOR i IN 1.. cant LOOP + FOR i IN 1.. lim LOOP sql_OneToOne := ''; sql_OneToMany := ''; - FOR j IN 1..cant LOOP + FOR j IN 1..lim LOOP IF j > 1 THEN sql_OneToOne := sql_OneToOne diff --git a/pgtap/dijkstra/dijkstraVia/edge_cases/remaining_tests.pg b/pgtap/dijkstra/dijkstraVia/edge_cases/remaining_tests.pg index d3be03c2a8a..6c1b6b64a15 100644 --- a/pgtap/dijkstra/dijkstraVia/edge_cases/remaining_tests.pg +++ b/pgtap/dijkstra/dijkstraVia/edge_cases/remaining_tests.pg @@ -50,7 +50,7 @@ SELECT 'integer'::text AS t1,'integer'::text AS path_id, 'integer'::text AS t2, SELECT set_eq('v21q30', 'v21q31','many to many: Expected returning, columns names & types'); --- CHECKING WORKS WITH & WITOUT REVERSE COST +-- CHECKING WORKS WITH & WITHOUT REVERSE COST PREPARE v20q1 AS SELECT * FROM pgr_dijkstravia( diff --git a/pgtap/dijkstra/driving_distance/no_crash_test.pg b/pgtap/dijkstra/driving_distance/no_crash_test.pg index 890633d90e5..5c6eb8c04e0 100644 --- a/pgtap/dijkstra/driving_distance/no_crash_test.pg +++ b/pgtap/dijkstra/driving_distance/no_crash_test.pg @@ -20,7 +20,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. BEGIN; UPDATE edges SET cost = sign(cost), reverse_cost = sign(reverse_cost); -SELECT CASE WHEN NOT min_version('3.6.0') AND min_lib_version('5.0.0') THEN plan(1) ELSE plan(34) END; +SELECT CASE WHEN min_version('3.6.0') THEN plan(34) ELSE plan(3) END; PREPARE edges AS SELECT id, source, target, cost, reverse_cost FROM edges; @@ -39,11 +39,15 @@ DECLARE params TEXT[]; subs TEXT[]; BEGIN - IF NOT min_version('3.6.0') AND min_lib_version('5.0.0') THEN - RETURN NEXT skip(1, 'Internal function deprecated on 3.6.0 and removed on 5.0.0'); + IF NOT min_version('3.6.0') THEN + RETURN NEXT skip(1, 'Function standardized on 3.6.0'); RETURN; END IF; + IF min_lib_version('4.0.0') AND NOT min_version('4.0.0') THEN + SET client_min_messages TO WARNING; + END IF; + -- 1 to distance params = ARRAY['$$SELECT id, source, target, cost, reverse_cost FROM edges$$','1', '1.3::FLOAT']::TEXT[]; subs = ARRAY[ diff --git a/pgtap/lineGraph/lineGraphFull/compare_dijkstra.pg b/pgtap/lineGraph/lineGraphFull/compare_dijkstra.pg index b3526f81ceb..417a1b97d48 100644 --- a/pgtap/lineGraph/lineGraphFull/compare_dijkstra.pg +++ b/pgtap/lineGraph/lineGraphFull/compare_dijkstra.pg @@ -39,7 +39,7 @@ CREATE TABLE result2_vertices_pgr( id bigint, original_id bigint); -CREATE or REPLACE FUNCTION lineGraphFullDijkstraEquivalence(cant INTEGER default 17) +CREATE or REPLACE FUNCTION lineGraphFullDijkstraEquivalence(lim INTEGER default 17) RETURNS SETOF TEXT AS $BODY$ DECLARE diff --git a/pgtap/lineGraph/lineGraphFull/edge_cases/original_edge_check.pg b/pgtap/lineGraph/lineGraphFull/edge_cases/original_edge_check.pg index 52069183032..5d52222cece 100644 --- a/pgtap/lineGraph/lineGraphFull/edge_cases/original_edge_check.pg +++ b/pgtap/lineGraph/lineGraphFull/edge_cases/original_edge_check.pg @@ -26,7 +26,7 @@ BEGIN; UPDATE edges SET cost = sign(cost), reverse_cost = sign(reverse_cost); SELECT plan(1); -CREATE or REPLACE FUNCTION lineGraphFullOriginalEdgeCheck(cant INTEGER default 17) +CREATE or REPLACE FUNCTION lineGraphFullOriginalEdgeCheck(lim INTEGER default 17) RETURNS SETOF TEXT AS $BODY$ DECLARE diff --git a/pgtap/lineGraph/lineGraphFull/edge_cases/original_vertex_mapping.pg b/pgtap/lineGraph/lineGraphFull/edge_cases/original_vertex_mapping.pg index 7fe00588a65..0b3d47fa2e4 100644 --- a/pgtap/lineGraph/lineGraphFull/edge_cases/original_vertex_mapping.pg +++ b/pgtap/lineGraph/lineGraphFull/edge_cases/original_vertex_mapping.pg @@ -39,7 +39,7 @@ CREATE TABLE result2_vertices_pgr( id bigint, original_id bigint); -CREATE or REPLACE FUNCTION lineGraphFullOriginalVertexMapping(cant INTEGER default 17) +CREATE or REPLACE FUNCTION lineGraphFullOriginalVertexMapping(lim INTEGER default 17) RETURNS SETOF TEXT AS $BODY$ DECLARE diff --git a/pgtap/max_flow/edge_cases/many_to_many_eq_combinations.pg b/pgtap/max_flow/edge_cases/many_to_many_eq_combinations.pg index e3d33079e99..45080edc646 100644 --- a/pgtap/max_flow/edge_cases/many_to_many_eq_combinations.pg +++ b/pgtap/max_flow/edge_cases/many_to_many_eq_combinations.pg @@ -23,7 +23,7 @@ BEGIN; SELECT CASE WHEN NOT min_version('3.2.0') THEN plan(1) ELSE plan(119) END; -CREATE OR REPLACE FUNCTION flow_combinations_eq_test(TestFunction TEXT, sql_EdgesQuery TEXT, cant INTEGER default 18 ) +CREATE OR REPLACE FUNCTION flow_combinations_eq_test(TestFunction TEXT, sql_EdgesQuery TEXT, lim INTEGER default 18 ) RETURNS SETOF TEXT AS $BODY$ DECLARE @@ -32,7 +32,7 @@ sql_ManySource TEXT; sql_ManyTarget TEXT; sql_Many TEXT; BEGIN - FOR id IN 1.. (cant - 1) LOOP + FOR id IN 1.. (lim - 1) LOOP sql_Combinations := ''; sql_ManySource := ''; sql_ManyTarget := ''; @@ -44,7 +44,7 @@ BEGIN sql_ManySource := sql_ManySource || i ; END LOOP; - FOR i IN (id + 1).. cant LOOP + FOR i IN (id + 1).. lim LOOP IF (i > id + 1) THEN sql_ManyTarget := sql_ManyTarget ||', '; END IF; @@ -52,7 +52,7 @@ BEGIN END LOOP; FOR i IN 1.. id LOOP - FOR j IN (id + 1).. cant LOOP + FOR j IN (id + 1).. lim LOOP sql_Combinations := sql_Combinations || '(' || i || ',' || j || '),' ; END LOOP; END LOOP; diff --git a/pgtap/ordering/topologicalSort/no_crash_test.pg b/pgtap/ordering/topologicalSort/no_crash_test.pg index cd7578c73af..baeaad80b19 100644 --- a/pgtap/ordering/topologicalSort/no_crash_test.pg +++ b/pgtap/ordering/topologicalSort/no_crash_test.pg @@ -20,20 +20,9 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. BEGIN; UPDATE edges SET cost = sign(cost), reverse_cost = sign(reverse_cost); -SELECT plan(5); - -CREATE TABLE edges1 ( - id serial, - source integer, - target integer, - cost double precision, - reverse_cost double precision -); -INSERT INTO edges1 (source,target,cost,reverse_cost) VALUES ( 1, 2,0,0); -INSERT INTO edges1 (source,target,cost,reverse_cost) VALUES (2,3,0,0); +SELECT plan(4); SELECT has_function('pgr_topologicalsort'); - SELECT function_returns('pgr_topologicalsort', ARRAY['text'], 'setof record'); -- flags @@ -53,24 +42,5 @@ SELECT lives_ok( '4: Documentation says works with no flags'); --- prepare for testing return types - -PREPARE all_return AS -SELECT - 'integer'::text AS t1, - 'bigint'::text AS t2; - -PREPARE q1 AS -SELECT pg_typeof(seq)::text AS t1, - pg_typeof(sorted_v)::text AS t2 - FROM ( - SELECT * FROM pgr_topologicalsort( - 'SELECT id, source, target, cost, reverse_cost FROM edges WHERE id = 2' - ) ) AS a - limit 1; - - -SELECT set_eq('q1', 'all_return', 'Expected returning, columns names & types'); - SELECT * FROM finish(); ROLLBACK; diff --git a/pgtap/ordering/topologicalSort/types_check.pg b/pgtap/ordering/topologicalSort/types_check.pg index 0cf51b5c54d..ca8efce6ad4 100644 --- a/pgtap/ordering/topologicalSort/types_check.pg +++ b/pgtap/ordering/topologicalSort/types_check.pg @@ -19,7 +19,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. ********************************************************************PGR-GNU*/ BEGIN; -SELECT plan(5); +SELECT CASE WHEN min_version('4.0.0') THEN plan(5) ELSE plan(4) END; CREATE OR REPLACE FUNCTION types_check() RETURNS SETOF TEXT AS @@ -30,9 +30,15 @@ BEGIN RETURN QUERY SELECT has_function('pgr_topologicalsort', ARRAY['text']); RETURN QUERY SELECT function_returns('pgr_topologicalsort', ARRAY['text'], 'setof record'); + IF NOT min_version('4.0.0') THEN + RETURN QUERY + SELECT skip(1, 'pgr_topologicalsort: testing only signatures standardaized in v4.0.0.'); + RETURN; + END IF; + RETURN QUERY SELECT function_args_eq('pgr_topologicalsort', - $$SELECT '{"","seq","sorted_v"}'::TEXT[] $$ + $$SELECT '{"",seq,node}'::TEXT[] $$ ); RETURN QUERY diff --git a/pgtap/others/dagShortestPath/edge_cases/many_to_many_eq_combinations.pg b/pgtap/others/dagShortestPath/edge_cases/many_to_many_eq_combinations.pg index 7454b242529..6c45c9c368f 100644 --- a/pgtap/others/dagShortestPath/edge_cases/many_to_many_eq_combinations.pg +++ b/pgtap/others/dagShortestPath/edge_cases/many_to_many_eq_combinations.pg @@ -24,7 +24,7 @@ SELECT plan(1); UPDATE edges SET cost = sign(cost), reverse_cost = -1 * sign(cost); UPDATE edges SET cost = sign(cost) + 0.001 * id * id, reverse_cost = sign(reverse_cost) + 0.001 * id * id; -CREATE OR REPLACE FUNCTION eq_many( sql_TestFunction TEXT, cant INTEGER default 18 ) +CREATE OR REPLACE FUNCTION eq_many( sql_TestFunction TEXT, lim INTEGER default 18 ) RETURNS SETOF TEXT AS $BODY$ DECLARE @@ -39,15 +39,15 @@ BEGIN sql_Combinations := ''; sql_Many := ''; - FOR i IN 1.. cant LOOP + FOR i IN 1.. lim LOOP IF (i > 1) THEN sql_Many := sql_Many ||', '; END IF; sql_Many := sql_Many || i ; END LOOP; - FOR i IN 1.. cant LOOP - FOR j IN 1..cant LOOP + FOR i IN 1.. lim LOOP + FOR j IN 1..lim LOOP IF NOT (i = j) THEN sql_Combinations := sql_Combinations || '(' || i || ',' || j || '),' ; END IF; diff --git a/pgtap/others/transitiveClosure/types_check.pg b/pgtap/others/transitiveClosure/types_check.pg index ef3119f6868..425822ffccb 100644 --- a/pgtap/others/transitiveClosure/types_check.pg +++ b/pgtap/others/transitiveClosure/types_check.pg @@ -19,7 +19,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. ********************************************************************PGR-GNU*/ BEGIN; -SELECT plan(5); +SELECT CASE WHEN min_version('4.0.0') THEN plan(5) ELSE plan(4) END; CREATE OR REPLACE FUNCTION types_check() RETURNS SETOF TEXT AS @@ -30,15 +30,21 @@ BEGIN RETURN QUERY SELECT has_function('pgr_transitiveclosure', ARRAY['text']); RETURN QUERY SELECT function_returns('pgr_transitiveclosure', ARRAY['text'], 'setof record'); + IF NOT min_version('4.0.0') THEN + RETURN QUERY + SELECT skip(1, 'pgr_transitiveclosure: testing only signatures standardaized in v4.0.0.'); + RETURN; + END IF; + RETURN QUERY SELECT function_args_eq('pgr_transitiveclosure', - $$SELECT '{"","seq","vid","target_array"}'::TEXT[] $$ + $$SELECT '{"",node,targets}'::TEXT[] $$ ); RETURN QUERY SELECT function_types_eq('pgr_transitiveclosure', $$VALUES - ('{text,int4,int8,_int8}'::TEXT[]) + ('{text,int8,_int8}'::TEXT[]) $$ ); diff --git a/pgtap/traversal/binaryBreadthFirstSearch/compare_dijkstra.pg b/pgtap/traversal/binaryBreadthFirstSearch/compare_dijkstra.pg index 96fe815596d..eb2068af0e4 100644 --- a/pgtap/traversal/binaryBreadthFirstSearch/compare_dijkstra.pg +++ b/pgtap/traversal/binaryBreadthFirstSearch/compare_dijkstra.pg @@ -22,7 +22,7 @@ BEGIN; SELECT plan(1300); -- Compare final row of result (Only final row due to existence of multiple valid paths) -CREATE or REPLACE FUNCTION binaryBreadthFirstSearch_compare_dijkstra(cant INTEGER default 17) +CREATE or REPLACE FUNCTION binaryBreadthFirstSearch_compare_dijkstra(lim INTEGER default 17) RETURNS SETOF TEXT AS $BODY$ DECLARE @@ -32,7 +32,7 @@ binaryBreadthFirstSearch TEXT; BEGIN IF NOT min_version('3.5.0') THEN - -- All These tests should work when binaryBreadthFirstSearch 's output is standarized + -- All These tests should work when binaryBreadthFirstSearch 's output is standardized RETURN QUERY SELECT compare_dijkstra_one_one('pgr_binaryBreadthFirstSearch', true, '*', 'WHERE edge = -1'); RETURN QUERY SELECT compare_dijkstra_one_one('pgr_binaryBreadthFirstSearch', false, '*', 'WHERE edge = -1'); diff --git a/pgtap/traversal/binaryBreadthFirstSearch/edge_cases/edge_cases.pg b/pgtap/traversal/binaryBreadthFirstSearch/edge_cases/edge_cases.pg index 4b355903e32..f9c1541d1a0 100644 --- a/pgtap/traversal/binaryBreadthFirstSearch/edge_cases/edge_cases.pg +++ b/pgtap/traversal/binaryBreadthFirstSearch/edge_cases/edge_cases.pg @@ -82,7 +82,7 @@ FROM pgr_binaryBreadthFirstSearch( SELECT throws_ok('errorTestManyWeights', 'XX000', - 'Graph Condition Failed: Graph should have atmost two distinct non-negative edge costs! If there are exactly two distinct edge costs, one of them must equal zero!', + 'Graph Condition Failed: Graph should have at most two distinct non-negative edge costs! If there are exactly two distinct edge costs, one of them must equal zero!', '17: Graph has more than 2 distinct weights'); SELECT * INTO edges_invalid_2 FROM edges; @@ -100,7 +100,7 @@ FROM pgr_binaryBreadthFirstSearch( SELECT throws_ok('errorTestNoZeroWeight', 'XX000', - 'Graph Condition Failed: Graph should have atmost two distinct non-negative edge costs! If there are exactly two distinct edge costs, one of them must equal zero!', + 'Graph Condition Failed: Graph should have at most two distinct non-negative edge costs! If there are exactly two distinct edge costs, one of them must equal zero!', '17: If graph has 2 distinct weights, one must be zero'); diff --git a/pgtap/traversal/binaryBreadthFirstSearch/edge_cases/many_to_many_eq_combinations.pg b/pgtap/traversal/binaryBreadthFirstSearch/edge_cases/many_to_many_eq_combinations.pg index 92f7b337c0f..3704a278d88 100644 --- a/pgtap/traversal/binaryBreadthFirstSearch/edge_cases/many_to_many_eq_combinations.pg +++ b/pgtap/traversal/binaryBreadthFirstSearch/edge_cases/many_to_many_eq_combinations.pg @@ -23,7 +23,7 @@ SELECT plan(1); UPDATE edges SET cost = sign(cost), reverse_cost = sign(reverse_cost); -CREATE OR REPLACE FUNCTION foo( sql_TestFunction TEXT, cant INTEGER default 18 ) +CREATE OR REPLACE FUNCTION foo( sql_TestFunction TEXT, lim INTEGER default 18 ) RETURNS SETOF TEXT AS $BODY$ DECLARE @@ -39,15 +39,15 @@ BEGIN sql_Combinations := ''; sql_Many := ''; - FOR i IN 1.. cant LOOP + FOR i IN 1.. lim LOOP IF (i > 1) THEN sql_Many := sql_Many ||', '; END IF; sql_Many := sql_Many || i ; END LOOP; - FOR i IN 1.. cant LOOP - FOR j IN 1..cant LOOP + FOR i IN 1.. lim LOOP + FOR j IN 1..lim LOOP IF NOT (i = j) THEN sql_Combinations := sql_Combinations || '(' || i || ',' || j || '),' ; END IF; diff --git a/pgtap/traversal/depthFirstSearch/edge_cases/singleVertex_equiv_multipleVertices.pg b/pgtap/traversal/depthFirstSearch/edge_cases/singleVertex_equiv_multipleVertices.pg index 34dd8655ae0..c82ef9dc77d 100644 --- a/pgtap/traversal/depthFirstSearch/edge_cases/singleVertex_equiv_multipleVertices.pg +++ b/pgtap/traversal/depthFirstSearch/edge_cases/singleVertex_equiv_multipleVertices.pg @@ -24,7 +24,7 @@ SELECT CASE WHEN min_version('3.2.0') THEN plan (22) ELSE plan(2) END; UPDATE edges SET cost = sign(cost) + 0.001 * id * id, reverse_cost = sign(reverse_cost) + 0.001 * id * id; -CREATE OR REPLACE FUNCTION foo(cant INTEGER default 18, flag boolean default true) +CREATE OR REPLACE FUNCTION foo(lim INTEGER default 18, flag boolean default true) RETURNS SETOF TEXT AS $BODY$ DECLARE @@ -41,7 +41,7 @@ BEGIN FOR depth IN 1..11 LOOP sql_SingleVertex := ''; sql_MultipleVertices := ''; - FOR i IN 1..cant LOOP + FOR i IN 1..lim LOOP IF i > 1 THEN sql_SingleVertex := sql_SingleVertex diff --git a/pgtap/trsp/trsp/edge_cases/compare_dijkstraVia.pg b/pgtap/trsp/trsp/edge_cases/compare_dijkstraVia.pg index 7f60a76c592..50ee71061dd 100644 --- a/pgtap/trsp/trsp/edge_cases/compare_dijkstraVia.pg +++ b/pgtap/trsp/trsp/edge_cases/compare_dijkstraVia.pg @@ -63,7 +63,7 @@ BEGIN 'SELECT id, source, target, cost, reverse_cost from edges', 5, 10, true); - RETURN QUERY SELECT set_eq('q21','q21_expected','Directed: without retrictions expected the same as pgr_dijkstra'); + RETURN QUERY SELECT set_eq('q21','q21_expected','Directed: without restrictions, expected the same as pgr_dijkstra'); PREPARE q31 AS SELECT seq-1, node, edge, cost::TEXT FROM pgr_trsp( @@ -79,7 +79,7 @@ BEGIN true) WHERE edge != -1; - RETURN QUERY SELECT set_eq('q31','q31_expected','Directed: with retrictions expected the same as pgr_dijkstraVia'); + RETURN QUERY SELECT set_eq('q31','q31_expected','Directed: with restrictions, expected the same as pgr_dijkstraVia'); /* Undirected */ PREPARE q41 AS @@ -100,7 +100,7 @@ BEGIN 'SELECT id, source, target, cost, reverse_cost from edges', 5, 10, false); - RETURN QUERY SELECT set_eq('q51','q51_expected','6: Undirected: without retrictions returns the same as pgr_dijkstra'); + RETURN QUERY SELECT set_eq('q51','q51_expected','6: Undirected: without restrictions, returns the same as pgr_dijkstra'); PREPARE q61 AS SELECT seq-1, node, edge, cost::TEXT from pgr_trsp( @@ -116,7 +116,7 @@ BEGIN ARRAY[5, 6, 10], false) WHERE edge != -1; - RETURN QUERY SELECT set_eq('q61','q61_expected','7: Undirected: with retrictions returns expected path'); + RETURN QUERY SELECT set_eq('q61','q61_expected','7: Undirected: with restrictions, returns expected path'); END; $BODY$ LANGUAGE plpgsql; diff --git a/pgtap/trsp/trsp/edge_cases/directed_compare_dijkstraVia.pg b/pgtap/trsp/trsp/edge_cases/directed_compare_dijkstraVia.pg index 5aae5d32d72..a3cb52a1385 100644 --- a/pgtap/trsp/trsp/edge_cases/directed_compare_dijkstraVia.pg +++ b/pgtap/trsp/trsp/edge_cases/directed_compare_dijkstraVia.pg @@ -62,7 +62,7 @@ BEGIN SELECT seq, node, edge, cost from pgr_dijkstra( 'select id, source, target, cost, reverse_cost from edges', 10, 15); - RETURN QUERY SELECT set_eq('q2','q2_expected','2: without retrictions returns the same as pgr_dijkstra'); + RETURN QUERY SELECT set_eq('q2','q2_expected','2: without restrictions, returns the same as pgr_dijkstra'); PREPARE q3 AS SELECT seq-1, node, edge, cost::TEXT from pgr_trsp( @@ -78,7 +78,7 @@ BEGIN ARRAY[10, 6, 15], true) where edge != -1; - RETURN QUERY SELECT set_eq('q3','q3_expected','2: without retrictions returns the same as pgr_dijkstraVia'); + RETURN QUERY SELECT set_eq('q3','q3_expected','2: without restrictions, returns the same as pgr_dijkstraVia'); END; $BODY$ diff --git a/pgtap/trsp/trsp/edge_cases/emptyset_from_i_to_i.pg b/pgtap/trsp/trsp/edge_cases/emptyset_from_i_to_i.pg index 6ae7d79bc42..92ae13620cc 100644 --- a/pgtap/trsp/trsp/edge_cases/emptyset_from_i_to_i.pg +++ b/pgtap/trsp/trsp/edge_cases/emptyset_from_i_to_i.pg @@ -28,7 +28,7 @@ PREPARE restriction AS SELECT * FROM restrictions; PREPARE with_reverse AS SELECT id, source, target, cost, reverse_cost FROM edges ORDER BY id; PREPARE no_reverse AS SELECT id, source, target, cost FROM edges ORDER BY id; -CREATE OR REPLACE FUNCTION edge_cases(cant INTEGER DEFAULT 18, flag BOOLEAN DEFAULT true ) +CREATE OR REPLACE FUNCTION edge_cases(lim INTEGER DEFAULT 18, flag BOOLEAN DEFAULT true ) RETURNS SETOF TEXT AS $BODY$ DECLARE @@ -60,7 +60,7 @@ BEGIN no_reverse_cost = quote_literal('no_reverse'); restrictions_sql = quote_literal('restriction'); - FOR i IN 1.. cant LOOP + FOR i IN 1.. lim LOOP parameters = restrictions_sql || ', ' || i || ', ' || i || ', ' || flag; diff --git a/pgtap/trsp/trspVia_withPoints/edge_cases/point_in_vertex.pg b/pgtap/trsp/trspVia_withPoints/edge_cases/point_in_vertex.pg index 752b0ff44a6..9a5a94b6d33 100644 --- a/pgtap/trsp/trspVia_withPoints/edge_cases/point_in_vertex.pg +++ b/pgtap/trsp/trspVia_withPoints/edge_cases/point_in_vertex.pg @@ -40,7 +40,7 @@ SELECT agg_cost::TEXT FROM pgr_dijkstraVia( $$SELECT id, source, target, cost, reverse_cost FROM four_edges$$, ARRAY[$1, $2], true) WHERE node = $2 and edge < 0; --- its a straigh line and one extreme are reachable +-- its a straight line and one extreme are reachable RETURN QUERY SELECT results_eq($$dijkstra1(5,9)$$, ARRAY[4]::TEXT[]); RETURN QUERY SELECT results_eq($$dijkstra1(9,5)$$, ARRAY[4]::TEXT[]); diff --git a/sql/common/parameter_check.sql b/sql/common/parameter_check.sql index a5eca7d27bd..c9249611892 100644 --- a/sql/common/parameter_check.sql +++ b/sql/common/parameter_check.sql @@ -70,7 +70,7 @@ CREATE FUNCTION _pgr_parameter_check(fn text, sql text, big boolean default fals WHEN OTHERS THEN RAISE EXCEPTION 'An expected column was not found in the query' USING ERRCODE = 'XX000', - HINT = 'Please veryfy the column names: id, source, target, cost'; + HINT = 'Please verify the column names: id, source, target, cost'; END; execute 'select pg_typeof(id)::text as id_type, pg_typeof(source)::text as source_type, pg_typeof(target)::text as target_type, pg_typeof(cost)::text as cost_type' || ' from ('||safesql||') AS __b__ ' into rec; @@ -92,7 +92,7 @@ CREATE FUNCTION _pgr_parameter_check(fn text, sql text, big boolean default fals WHEN OTHERS THEN RAISE EXCEPTION 'An expected column was not found in the query' USING ERRCODE = 'XX000', - HINT = 'Please veryfy the column names: x1,y1, x2,y2'; + HINT = 'Please verify the column names: x1,y1, x2,y2'; END; execute 'select pg_typeof(x1)::text as x1_type, pg_typeof(y1)::text as y1_type, pg_typeof(x2)::text as x2_type, pg_typeof(y2)::text as y2_type' || ' from ('||safesql||') AS __b__ ' into rec; @@ -113,7 +113,7 @@ CREATE FUNCTION _pgr_parameter_check(fn text, sql text, big boolean default fals EXCEPTION WHEN OTHERS THEN RAISE EXCEPTION 'An expected column was not found in the query' - USING HINT = 'Please veryfy the column names: id, source, target, cost', + USING HINT = 'Please verify the column names: id, source, target, cost', ERRCODE = 'XX000'; END; diff --git a/sql/driving_distance/drivingDistance.sql b/sql/driving_distance/drivingDistance.sql index 1d02e1b77ab..e5ac8e48315 100644 --- a/sql/driving_distance/drivingDistance.sql +++ b/sql/driving_distance/drivingDistance.sql @@ -57,7 +57,7 @@ ROWS 1000; --v3.6 CREATE FUNCTION pgr_drivingDistance( TEXT, -- edges_sql (required) - BIGINT, -- from_vid (requierd) + BIGINT, -- from_vid (required) FLOAT, -- distance (required) directed BOOLEAN DEFAULT TRUE, diff --git a/sql/scripts/build-extension-update-files.pl b/sql/scripts/build-extension-update-files.pl index 56c7e6cfe9c..9dff56a9b99 100755 --- a/sql/scripts/build-extension-update-files.pl +++ b/sql/scripts/build-extension-update-files.pl @@ -303,6 +303,8 @@ sub generate_upgrade_script { push @commands, drop_special_case_function("pgr_binarybreadthfirstsearch(text,anyarray,bigint,boolean)"); push @commands, drop_special_case_function("pgr_binarybreadthfirstsearch(text,bigint,anyarray,boolean)"); + push @commands, drop_special_case_function("pgr_topologicalsort(text)"); + push @commands, drop_special_case_function("pgr_transitiveclosure(text)"); push @commands, drop_special_case_function("pgr_dagshortestpath(text,bigint,bigint)"); push @commands, drop_special_case_function("pgr_dagshortestpath(text,bigint,anyarray)"); diff --git a/sql/topologicalSort/topologicalSort.sql b/sql/topologicalSort/topologicalSort.sql index f3805c990a9..990120bdd28 100644 --- a/sql/topologicalSort/topologicalSort.sql +++ b/sql/topologicalSort/topologicalSort.sql @@ -34,7 +34,7 @@ CREATE FUNCTION pgr_topologicalSort( TEXT, -- edges_sql (required) OUT seq INTEGER, - OUT sorted_v BIGINT) + OUT node BIGINT) RETURNS SETOF RECORD AS $BODY$ SELECT seq, sorted_v diff --git a/sql/transitiveClosure/transitiveClosure.sql b/sql/transitiveClosure/transitiveClosure.sql index 479fd0db753..8d2ff91fae4 100644 --- a/sql/transitiveClosure/transitiveClosure.sql +++ b/sql/transitiveClosure/transitiveClosure.sql @@ -5,7 +5,7 @@ Mail: project@pgrouting.org Function's developer: Copyright (c) 2019 Hang Wu -mail: nike0good@gmail.com +mail: nike0good at gmail.com ------ This program is free software; you can redistribute it and/or modify @@ -24,35 +24,26 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. ********************************************************************PGR-GNU*/ ---------------- --- pgr_transitiveClosure ---------------- - - --v3.0 CREATE FUNCTION pgr_transitiveClosure( TEXT, -- edges_sql (required) - OUT seq INTEGER, - OUT vid BIGINT, - OUT target_array BIGINT[]) + OUT node BIGINT, + OUT targets BIGINT[]) RETURNS SETOF RECORD AS $BODY$ - SELECT seq, vid, target_array + SELECT vid, target_array FROM _pgr_transitiveClosure(_pgr_get_statement($1)); $BODY$ LANGUAGE SQL VOLATILE STRICT; --- COMMENTS - - COMMENT ON FUNCTION pgr_transitiveClosure(TEXT) IS 'pgr_transitiveClosure - EXPERIMENTAL - Directed graph - Parameters: - - edges SQL with columns: id, source, target, cost [,reverse_cost] + - Edges SQL with columns: id, source, target, cost [,reverse_cost] - Documentation: - ${PROJECT_DOC_LINK}/pgr_transitiveClosure.html '; diff --git a/sql/vrp_basic/vrpOneDepot.sql b/sql/vrp_basic/vrpOneDepot.sql index a650ceae2e4..3f131a4c48f 100644 --- a/sql/vrp_basic/vrpOneDepot.sql +++ b/sql/vrp_basic/vrpOneDepot.sql @@ -21,7 +21,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. ********************************************************************PGR-GNU*/ ----------------------------------------------------------------------- --- Core function for vrp with sigle depot computation +-- Core function for vrp with single depot computation -- See README for description ----------------------------------------------------------------------- diff --git a/src/breadthFirstSearch/binaryBreadthFirstSearch_driver.cpp b/src/breadthFirstSearch/binaryBreadthFirstSearch_driver.cpp index ab92f3b3081..bbea3eab6ed 100644 --- a/src/breadthFirstSearch/binaryBreadthFirstSearch_driver.cpp +++ b/src/breadthFirstSearch/binaryBreadthFirstSearch_driver.cpp @@ -74,7 +74,7 @@ pgr_binaryBreadthFirstSearch( } const size_t MAX_UNIQUE_EDGE_COSTS = 2; -const char COST_ERR_MSG[] = "Graph Condition Failed: Graph should have atmost two distinct non-negative edge costs! " +const char COST_ERR_MSG[] = "Graph Condition Failed: Graph should have at most two distinct non-negative edge costs! " "If there are exactly two distinct edge costs, one of them must equal zero!"; #endif @@ -145,7 +145,7 @@ pgr_do_binaryBreadthFirstSearch( std::ostringstream err; std::ostringstream notice; const char *hint = nullptr; - const char c_err_msg[] = "Graph Condition Failed: Graph should have atmost two distinct non-negative edge costs! " + const char c_err_msg[] = "Graph Condition Failed: Graph should have at most two distinct non-negative edge costs! " "If there are exactly two distinct edge costs, one of them must equal zero!"; try { diff --git a/src/cpp_common/pgdata_getters.cpp b/src/cpp_common/pgdata_getters.cpp index 552ba8ea9ea..e31fae37933 100644 --- a/src/cpp_common/pgdata_getters.cpp +++ b/src/cpp_common/pgdata_getters.cpp @@ -215,7 +215,7 @@ std::vector get_costFlow_edges(const std::string &sql) { SELECT id, source, target, cost, [reverse_cost] FROM edge_table; ~~~~ - For backward compatability it also accepts: + For backward compatibility it also accepts: ~~~~{.c} SELECT id, source, target, going, [coming] FROM edge_table; ~~~~ @@ -321,7 +321,7 @@ std::vector get_matrixRows(const std::string &sql) { ~~~~ @param[in] sql The orders query - @param[in] with_id flag that idicates if id is to be used + @param[in] with_id flag that indicates if id is to be used @returns vector of `Orders_t` */ std::vector get_orders( @@ -413,7 +413,7 @@ std::vector get_restrictions(const std::string &sql) { ~~~~ @param[in] sql The vehicles query - @param[in] with_id flag that idicates if id is to be used + @param[in] with_id flag that indicates if id is to be used @returns vector of `Vehicle_t` */ std::vector get_vehicles(const std::string &sql, bool with_id) { diff --git a/src/ksp/ksp.c b/src/ksp/ksp.c index 1b2ff38c0de..6666aa71815 100644 --- a/src/ksp/ksp.c +++ b/src/ksp/ksp.c @@ -201,9 +201,12 @@ _pgr_ksp_v4(PG_FUNCTION_ARGS) { } } -/* - * TODO (v5) v5 remove deprecated code - * TODO (v4 last micro) warn about deprecated code +/* Deprecated code starts here + * This code is used on v3.5 and under + * + * TODO(v4.2) define SHOWMSG + * TODO(v4.3) change to WARNING + * TODO(v5) Move to legacy */ PGDLLEXPORT Datum _pgr_ksp(PG_FUNCTION_ARGS); PG_FUNCTION_INFO_V1(_pgr_ksp); @@ -221,6 +224,14 @@ _pgr_ksp(PG_FUNCTION_ARGS) { funcctx = SRF_FIRSTCALL_INIT(); oldcontext = MemoryContextSwitchTo(funcctx->multi_call_memory_ctx); +#ifdef SHOWMSG + ereport(NOTICE, ( + errcode(ERRCODE_WARNING_DEPRECATED_FEATURE), + errmsg("A stored procedure is using deprecated C internal function '%s'", __func__), + errdetail("Library function '%s' was deprecated in pgRouting %s", __func__, "4.0.0"), + errhint("Consider upgrade pgRouting"))); +#endif + if (PG_NARGS() == 7) { /* * many to many diff --git a/src/pickDeliver/optimize.cpp b/src/pickDeliver/optimize.cpp index 983aeb52906..cde884f0e00 100644 --- a/src/pickDeliver/optimize.cpp +++ b/src/pickDeliver/optimize.cpp @@ -222,7 +222,7 @@ Optimize::swap_worse(Vehicle_pickDeliver &to, Vehicle_pickDeliver &from) { estimated_delta < 0 || estimated_duration < best_solution.duration()) { /* - * this acctually makes the swapping + * this actually makes the swapping */ to = to_truck; from = from_truck; @@ -429,7 +429,7 @@ Optimize::move_order( * Optimize decreasing truck * * - Objective: try to remove truck with less duration - * - Secundary objective, acts like a shake operation + * - Secondary objective, acts like a shake operation * */ void diff --git a/src/pickDeliver/order.cpp b/src/pickDeliver/order.cpp index d68341693e7..486851a17d9 100644 --- a/src/pickDeliver/order.cpp +++ b/src/pickDeliver/order.cpp @@ -101,7 +101,7 @@ Order::is_valid(double speed) const { /* * Initializing the set of nodes that can be placed - * inmediately after \bthis node + * immediately after \bthis node * * (*this) -> J * diff --git a/src/pickDeliver/vehicle.cpp b/src/pickDeliver/vehicle.cpp index 6813eff026e..700a2f98450 100644 --- a/src/pickDeliver/vehicle.cpp +++ b/src/pickDeliver/vehicle.cpp @@ -311,7 +311,7 @@ Vehicle::drop_position_limits(const Vehicle_node node) const { } /* - * start searching from postition low = pos(E) + * start searching from position low = pos(E) * * S 1 2 3 4 5 6 7 ..... E * node -> E @@ -344,7 +344,7 @@ Vehicle::getDropPosLowLimit(const Vehicle_node &nodeI) const { } /* - * start searching from postition low = pos(E) + * start searching from position low = pos(E) * * S 1 2 3 4 5 6 7 ..... E * node -> E @@ -377,7 +377,7 @@ Vehicle::getPosLowLimit(const Vehicle_node &nodeI) const { /* - * start searching from postition low = pos(S) + * start searching from position low = pos(S) * * S 1 2 3 4 5 6 7 ..... E * S -> node diff --git a/src/pickDeliver/vehicle_node.cpp b/src/pickDeliver/vehicle_node.cpp index 3fdf584db74..f10253448c0 100644 --- a/src/pickDeliver/vehicle_node.cpp +++ b/src/pickDeliver/vehicle_node.cpp @@ -112,7 +112,7 @@ operator << (std::ostream &log, const Vehicle_node &v) { } -/*! @brief Creates a disconected vehicle node +/*! @brief Creates a disconnected vehicle node * * A node that is not served by any vehicle * diff --git a/src/pickDeliver/vehicle_pickDeliver.cpp b/src/pickDeliver/vehicle_pickDeliver.cpp index 5aa62b8d42a..aecd27a22bb 100644 --- a/src/pickDeliver/vehicle_pickDeliver.cpp +++ b/src/pickDeliver/vehicle_pickDeliver.cpp @@ -88,14 +88,14 @@ Vehicle_pickDeliver::insert(const Order &order) { if (pick_pos.second < pick_pos.first) { /* - * pickup generates twv evrywhere + * pickup generates twv everywhere */ return false; } if (deliver_pos.second < deliver_pos.first) { /* - * delivery generates twv evrywhere + * delivery generates twv everywhere */ return false; } diff --git a/src/tsp/TSP.c b/src/tsp/TSP.c index 3f7b99910ad..139d719f3c2 100644 --- a/src/tsp/TSP.c +++ b/src/tsp/TSP.c @@ -148,9 +148,12 @@ PGDLLEXPORT Datum _pgr_tsp_v4(PG_FUNCTION_ARGS) { } -/* - * TODO (v5) v5 remove deprecated code - * TODO (v4 last micro) warn about deprecated code +/* Deprecated code starts here + * This code is used on v3.8 and under + * + * TODO(v4.2) define SHOWMSG + * TODO(v4.3) change to WARNING + * TODO(v5) Move to legacy */ PGDLLEXPORT Datum _pgr_tsp(PG_FUNCTION_ARGS); PG_FUNCTION_INFO_V1(_pgr_tsp); @@ -167,6 +170,14 @@ _pgr_tsp(PG_FUNCTION_ARGS) { funcctx = SRF_FIRSTCALL_INIT(); oldcontext = MemoryContextSwitchTo(funcctx->multi_call_memory_ctx); +#ifdef SHOWMSG + ereport(NOTICE, ( + errcode(ERRCODE_WARNING_DEPRECATED_FEATURE), + errmsg("A stored procedure is using deprecated C internal function '%s'", __func__), + errdetail("Library function '%s' was deprecated in pgRouting %s", __func__, "4.0.0"), + errhint("Consider upgrade pgRouting"))); +#endif + process( text_to_cstring(PG_GETARG_TEXT_P(0)), PG_GETARG_INT64(1), diff --git a/src/tsp/euclideanTSP.c b/src/tsp/euclideanTSP.c index d4c8710f19b..32576d34ba2 100644 --- a/src/tsp/euclideanTSP.c +++ b/src/tsp/euclideanTSP.c @@ -148,9 +148,12 @@ PGDLLEXPORT Datum _pgr_tspeuclidean_v4(PG_FUNCTION_ARGS) { } } -/* - * TODO (v5) v5 remove deprecated code - * TODO (v4 last micro) warn about deprecated code +/* Deprecated code starts here + * This code is used on v3.8 and under + * + * TODO(v4.2) define SHOWMSG + * TODO(v4.3) change to WARNING + * TODO(v5) Move to legacy */ PGDLLEXPORT Datum _pgr_tspeuclidean(PG_FUNCTION_ARGS); PG_FUNCTION_INFO_V1(_pgr_tspeuclidean); @@ -167,6 +170,14 @@ _pgr_tspeuclidean(PG_FUNCTION_ARGS) { funcctx = SRF_FIRSTCALL_INIT(); oldcontext = MemoryContextSwitchTo(funcctx->multi_call_memory_ctx); +#ifdef SHOWMSG + ereport(NOTICE, ( + errcode(ERRCODE_WARNING_DEPRECATED_FEATURE), + errmsg("A stored procedure is using deprecated C internal function '%s'", __func__), + errdetail("Library function '%s' was deprecated in pgRouting %s", __func__, "4.0.0"), + errhint("Consider upgrade pgRouting"))); +#endif + process( text_to_cstring(PG_GETARG_TEXT_P(0)), PG_GETARG_INT64(1), diff --git a/tools/developer/README.md b/tools/developer/README.md index 85ccab31429..b2aba89b35d 100644 --- a/tools/developer/README.md +++ b/tools/developer/README.md @@ -19,7 +19,7 @@ And needs to be 3.3: ... ``` -To achive the change: from the root of the repository: +To achieve, the change: from the root of the repository: ```bash ./tools/developer/addNewVersionLink.sh "3\.2" "3\.3"' ``` diff --git a/tools/licences/add-licenses b/tools/licences/add-licenses index e082d11cc79..660248eed42 100755 --- a/tools/licences/add-licenses +++ b/tools/licences/add-licenses @@ -87,7 +87,7 @@ sub loadLicense { return @file_storage; } -# When the first line is not equal it doesnt have the +# When the first line is not equal it does not, have the # generated license. # The generated license has to be added # And Manually fixed. diff --git a/tools/scripts/README.txt b/tools/scripts/README.txt index 74d3a3c4e18..68ddd5c15f6 100644 --- a/tools/scripts/README.txt +++ b/tools/scripts/README.txt @@ -10,7 +10,7 @@ Spell checker sh tools/scripts/fix_typos.sh - creates a directory fix_typos: - - contains the code and dictonaries + - contains the code and dictionaries - checks the spelling of the: - src - doc @@ -21,7 +21,7 @@ sh tools/scripts/fix_typos.sh Code linter ........... -Requierements +Requirements - python sh tools/scripts/code_checker.sh diff --git a/tools/testers/compare_dijkstra.sql b/tools/testers/compare_dijkstra.sql index eb14ed61fdd..11daca5538a 100644 --- a/tools/testers/compare_dijkstra.sql +++ b/tools/testers/compare_dijkstra.sql @@ -24,7 +24,7 @@ CREATE OR REPLACE FUNCTION compare_dijkstra_one_one( ret_c TEXT default '*', where_c TEXT default '', restricted BOOLEAN default false, - cant INTEGER default 17) + lim INTEGER default 17) RETURNS SETOF TEXT AS $BODY$ DECLARE @@ -41,8 +41,8 @@ BEGIN END IF; - FOR i IN 1.. cant LOOP - FOR j IN 1.. cant LOOP + FOR i IN 1.. lim LOOP + FOR j IN 1.. lim LOOP -- with reverse cost inner_sql := 'SELECT id, source, target, cost, reverse_cost FROM edges'; @@ -74,7 +74,7 @@ CREATE OR REPLACE FUNCTION compare_dijkstra_many_one( fn TEXT, directed BOOLEAN, ret_c TEXT default '*', where_c TEXT default '', - cant INTEGER default 17) + lim INTEGER default 17) RETURNS SETOF TEXT AS $BODY$ DECLARE @@ -84,7 +84,7 @@ DECLARE arr TEXT; BEGIN - FOR j IN 1.. cant LOOP + FOR j IN 1.. lim LOOP arr := 'ARRAY[1,2,3,4,5,6,7,8]'; -- with reverse cost @@ -108,7 +108,7 @@ CREATE OR REPLACE FUNCTION compare_dijkstra_one_many( fn TEXT, directed BOOLEAN, ret_c TEXT default '*', where_c TEXT default '', - cant INTEGER default 17) + lim INTEGER default 17) RETURNS SETOF TEXT AS $BODY$ DECLARE @@ -118,7 +118,7 @@ DECLARE arr TEXT; BEGIN - FOR j IN 1.. cant LOOP + FOR j IN 1.. lim LOOP arr := 'ARRAY[1,2,3,4,5,6,7,8]'; -- with reverse cost diff --git a/tools/testers/doc_queries_generator.pl b/tools/testers/doc_queries_generator.pl index edcdf5f16fb..a498ba71c81 100755 --- a/tools/testers/doc_queries_generator.pl +++ b/tools/testers/doc_queries_generator.pl @@ -312,7 +312,7 @@ sub process_single_test{ print PSQL "BEGIN;\n"; print PSQL "SET client_min_messages TO $LEVEL;\n"; - # prints the whole fle stored in @queries + # prints the whole file stored in @queries print PSQL @queries; print PSQL "\nROLLBACK;"; @@ -381,7 +381,7 @@ sub createTestDB { die " Unsupported postgreSQL version $dbver - Minimum requierment is $POSGRESQL_MIN_VERSION version + Minimum requirement is $POSGRESQL_MIN_VERSION version Use -force to force the tests\n" unless version_greater_eq($dbver, $POSGRESQL_MIN_VERSION); @@ -473,7 +473,7 @@ sub findPsql { } # getSharePath is complicated by the fact that on Debian we can have multiple -# versions installed in a cluster. So we get the DB version by connectiong +# versions installed in a cluster. So we get the DB version by connection, # to the port for the server we want. Then we get the share path for the # newest version od pg installed on the cluster. And finally we change the # in the path to the version of the server. diff --git a/tools/testers/trsp_tests.sql b/tools/testers/trsp_tests.sql index d747fb698e5..1fd60e609bf 100644 --- a/tools/testers/trsp_tests.sql +++ b/tools/testers/trsp_tests.sql @@ -1,4 +1,4 @@ -CREATE OR REPLACE FUNCTION compare_trsp_dijkstra_new(cant INTEGER, flag boolean, restrictions_sql TEXT) +CREATE OR REPLACE FUNCTION compare_trsp_dijkstra_new(lim INTEGER, flag boolean, restrictions_sql TEXT) RETURNS SETOF TEXT AS $BODY$ DECLARE @@ -23,8 +23,8 @@ BEGIN directed = 'Undirected'; IF flag THEN directed = 'Directed'; END IF; - FOR i IN 1..cant BY 2 LOOP - FOR j IN 1..cant LOOP + FOR i IN 1..lim BY 2 LOOP + FOR j IN 1..lim LOOP params = ' ' || i || ', ' || j || ', ' || flag;