Skip to content

Commit c3e092e

Browse files
committed
Standardizing pgr_edwardMoore to one path result columns
1 parent 4885035 commit c3e092e

6 files changed

Lines changed: 79 additions & 151 deletions

File tree

doc/bellman_ford/pgr_edwardMoore.rst

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
Copyright(c) pgRouting Contributors
55
66
This documentation is licensed under a Creative Commons Attribution-Share
7-
Alike 3.0 License: http://creativecommons.org/licenses/by-sa/3.0/
7+
Alike 3.0 License: https://creativecommons.org/licenses/by-sa/3.0/
88
****************************************************************************
99

1010
.. index::
@@ -25,6 +25,10 @@
2525

2626
.. rubric:: Availability
2727

28+
.. rubric:: Version 4.0.0
29+
30+
* Output columns standardized to |short-generic-result|
31+
2832
.. rubric:: Version 3.2.0
2933

3034
* New experimental signature:
@@ -95,7 +99,7 @@ Signatures
9599
| pgr_edwardMoore(`Edges SQL`_, **start vids**, **end vids**, [``directed``])
96100
| pgr_edwardMoore(`Edges SQL`_, `Combinations SQL`_, [``directed``])
97101
98-
| Returns set of |old-generic-result|
102+
| Returns set of |short-generic-result|
99103
| OR EMPTY SET
100104
101105
.. index::
@@ -109,7 +113,7 @@ One to One
109113

110114
| pgr_edwardMoore(`Edges SQL`_, **start vid**, **end vid**, [``directed``])
111115
112-
| Returns set of |result-1-1|
116+
| Returns set of |short-generic-result|
113117
| OR EMPTY SET
114118
115119
:Example: From vertex :math:`6` to vertex :math:`10` on a **directed** graph
@@ -129,11 +133,11 @@ One to Many
129133

130134
| pgr_edwardMoore(`Edges SQL`_, **start vid**, **end vids**, [``directed``])
131135
132-
| Returns set of |result-1-m|
136+
| Returns set of |short-generic-result|
133137
| OR EMPTY SET
134138
135-
:Example: From vertex :math:`6` to vertices :math:`\{ 10, 17\}` on a
136-
**directed** graph
139+
:Example: From vertex :math:`6` to vertices :math:`\{10, 17\}` on a **directed**
140+
graph
137141

138142
.. literalinclude:: edwardMoore.queries
139143
:start-after: -- q3
@@ -150,7 +154,7 @@ Many to One
150154

151155
| pgr_edwardMoore(`Edges SQL`_, **start vids**, **end vid**, [``directed``])
152156
153-
| Returns set of |result-m-1|
157+
| Returns set of |short-generic-result|
154158
| OR EMPTY SET
155159
156160
:Example: From vertices :math:`\{6, 1\}` to vertex :math:`17` on a **directed**
@@ -244,8 +248,8 @@ Result columns
244248
-------------------------------------------------------------------------------
245249

246250
.. include:: pgRouting-concepts.rst
247-
:start-after: return_path_short_start
248-
:end-before: return_path_short_end
251+
:start-after: return_path_complete_start
252+
:end-before: return_path_complete_end
249253

250254
Additional Examples
251255
-------------------------------------------------------------------------------

doc/src/migration.rst

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,8 @@ types.
7979
- `Migration of spanning tree functions`_
8080
* - .. versionchanged:: 4.0.0 :doc:`pgr_bdDijkstra` [1]_
8181
- `Migration of single path functions`_
82+
* - .. versionchanged:: 4.0.0 ``pgr_edwardMoore`` [3]_
83+
- `Migration of single path functions`_
8284
* - .. versionchanged:: 4.0.0 :doc:`pgr_withPoints` [2]_
8385
- `Migration of single path functions`_
8486
* - .. versionchanged:: 4.0.0 :doc:`pgr_withPointsCost` [2]_
@@ -92,11 +94,10 @@ types.
9294
- `Migration of single path functions`_
9395
* - .. versionchanged:: 4.0.0 :doc:`pgr_binaryBreadthFirstSearch`
9496
- `Migration of single path functions`_
95-
* - .. versionchanged:: 4.0.0 :doc:`pgr_edwardMoore` [1]_
96-
- `Migration of single path functions`_
9797
9898
.. [1] Official function before v4.0.0
9999
.. [2] Official function in v4.0.0
100+
.. [3] Experimental or proposed in v4.0.0
100101
101102
.. contents:: Contents
102103
:local:
@@ -317,6 +318,9 @@ application.
317318
* - ``pgr_withPoints``
318319
- v < 4.0
319320
- |old-pid-result|
321+
* - ``pgr_edwardMoore``
322+
- v < 4.0
323+
- |old-generic-result|
320324

321325
..
322326
* - ``pgr_bellmanFord``
@@ -325,9 +329,6 @@ application.
325329
* - ``pgr_BinaryBreadthFirstSearch``
326330
- v < 4.0
327331
- |old-generic-result|
328-
* - ``pgr_edwardMoore``
329-
- v < 4.0
330-
- |old-generic-result|
331332
332333
:to: |short-generic-result|
333334

docqueries/bellman_ford/edwardMoore.result

Lines changed: 34 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -6,52 +6,52 @@ SET
66
SELECT * FROM pgr_edwardMoore(
77
'SELECT id, source, target, cost, reverse_cost FROM edges',
88
6, 10, true);
9-
seq | path_seq | node | edge | cost | agg_cost
10-
-----+----------+------+------+------+----------
11-
1 | 1 | 6 | 4 | 1 | 0
12-
2 | 2 | 7 | 8 | 1 | 1
13-
3 | 3 | 11 | 9 | 1 | 2
14-
4 | 4 | 16 | 16 | 1 | 3
15-
5 | 5 | 15 | 3 | 1 | 4
16-
6 | 6 | 10 | -1 | 0 | 5
9+
seq | path_seq | start_vid | end_vid | node | edge | cost | agg_cost
10+
-----+----------+-----------+---------+------+------+------+----------
11+
1 | 1 | 6 | 10 | 6 | 4 | 1 | 0
12+
2 | 2 | 6 | 10 | 7 | 8 | 1 | 1
13+
3 | 3 | 6 | 10 | 11 | 9 | 1 | 2
14+
4 | 4 | 6 | 10 | 16 | 16 | 1 | 3
15+
5 | 5 | 6 | 10 | 15 | 3 | 1 | 4
16+
6 | 6 | 6 | 10 | 10 | -1 | 0 | 5
1717
(6 rows)
1818

1919
/* -- q3 */
2020
SELECT * FROM pgr_edwardMoore(
2121
'SELECT id, source, target, cost, reverse_cost FROM edges',
2222
6, ARRAY[10, 17]);
23-
seq | path_seq | end_vid | node | edge | cost | agg_cost
24-
-----+----------+---------+------+------+------+----------
25-
1 | 1 | 10 | 6 | 4 | 1 | 0
26-
2 | 2 | 10 | 7 | 8 | 1 | 1
27-
3 | 3 | 10 | 11 | 9 | 1 | 2
28-
4 | 4 | 10 | 16 | 16 | 1 | 3
29-
5 | 5 | 10 | 15 | 3 | 1 | 4
30-
6 | 6 | 10 | 10 | -1 | 0 | 5
31-
7 | 1 | 17 | 6 | 4 | 1 | 0
32-
8 | 2 | 17 | 7 | 8 | 1 | 1
33-
9 | 3 | 17 | 11 | 11 | 1 | 2
34-
10 | 4 | 17 | 12 | 13 | 1 | 3
35-
11 | 5 | 17 | 17 | -1 | 0 | 4
23+
seq | path_seq | start_vid | end_vid | node | edge | cost | agg_cost
24+
-----+----------+-----------+---------+------+------+------+----------
25+
1 | 1 | 6 | 10 | 6 | 4 | 1 | 0
26+
2 | 2 | 6 | 10 | 7 | 8 | 1 | 1
27+
3 | 3 | 6 | 10 | 11 | 9 | 1 | 2
28+
4 | 4 | 6 | 10 | 16 | 16 | 1 | 3
29+
5 | 5 | 6 | 10 | 15 | 3 | 1 | 4
30+
6 | 6 | 6 | 10 | 10 | -1 | 0 | 5
31+
7 | 1 | 6 | 17 | 6 | 4 | 1 | 0
32+
8 | 2 | 6 | 17 | 7 | 8 | 1 | 1
33+
9 | 3 | 6 | 17 | 11 | 11 | 1 | 2
34+
10 | 4 | 6 | 17 | 12 | 13 | 1 | 3
35+
11 | 5 | 6 | 17 | 17 | -1 | 0 | 4
3636
(11 rows)
3737

3838
/* -- q4 */
3939
SELECT * FROM pgr_edwardMoore(
4040
'SELECT id, source, target, cost, reverse_cost FROM edges',
4141
ARRAY[6, 1], 17);
42-
seq | path_seq | start_vid | node | edge | cost | agg_cost
43-
-----+----------+-----------+------+------+------+----------
44-
1 | 1 | 1 | 1 | 6 | 1 | 0
45-
2 | 2 | 1 | 3 | 7 | 1 | 1
46-
3 | 3 | 1 | 7 | 8 | 1 | 2
47-
4 | 4 | 1 | 11 | 11 | 1 | 3
48-
5 | 5 | 1 | 12 | 13 | 1 | 4
49-
6 | 6 | 1 | 17 | -1 | 0 | 5
50-
7 | 1 | 6 | 6 | 4 | 1 | 0
51-
8 | 2 | 6 | 7 | 8 | 1 | 1
52-
9 | 3 | 6 | 11 | 11 | 1 | 2
53-
10 | 4 | 6 | 12 | 13 | 1 | 3
54-
11 | 5 | 6 | 17 | -1 | 0 | 4
42+
seq | path_seq | start_vid | end_vid | node | edge | cost | agg_cost
43+
-----+----------+-----------+---------+------+------+------+----------
44+
1 | 1 | 1 | 17 | 1 | 6 | 1 | 0
45+
2 | 2 | 1 | 17 | 3 | 7 | 1 | 1
46+
3 | 3 | 1 | 17 | 7 | 8 | 1 | 2
47+
4 | 4 | 1 | 17 | 11 | 11 | 1 | 3
48+
5 | 5 | 1 | 17 | 12 | 13 | 1 | 4
49+
6 | 6 | 1 | 17 | 17 | -1 | 0 | 5
50+
7 | 1 | 6 | 17 | 6 | 4 | 1 | 0
51+
8 | 2 | 6 | 17 | 7 | 8 | 1 | 1
52+
9 | 3 | 6 | 17 | 11 | 11 | 1 | 2
53+
10 | 4 | 6 | 17 | 12 | 13 | 1 | 3
54+
11 | 5 | 6 | 17 | 17 | -1 | 0 | 4
5555
(11 rows)
5656

5757
/* -- q5 */
Lines changed: 2 additions & 84 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
/*PGR-GNU*****************************************************************
32

43
Copyright (c) 2018 pgRouting developers
@@ -19,90 +18,9 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
1918
********************************************************************PGR-GNU*/
2019
BEGIN;
2120

22-
SELECT plan(13);
23-
24-
CREATE OR REPLACE FUNCTION types_check()
25-
RETURNS SETOF TEXT AS
26-
$BODY$
27-
BEGIN
28-
29-
RETURN QUERY SELECT has_function('pgr_edwardmoore');
30-
31-
RETURN QUERY SELECT has_function('pgr_edwardmoore', ARRAY['text','bigint','bigint','boolean']);
32-
RETURN QUERY SELECT has_function('pgr_edwardmoore', ARRAY['text','bigint','anyarray','boolean']);
33-
RETURN QUERY SELECT has_function('pgr_edwardmoore', ARRAY['text','anyarray','bigint','boolean']);
34-
RETURN QUERY SELECT has_function('pgr_edwardmoore', ARRAY['text','anyarray','anyarray','boolean']);
35-
36-
RETURN QUERY SELECT function_returns('pgr_edwardmoore', ARRAY['text','bigint','bigint','boolean'], 'setof record');
37-
RETURN QUERY SELECT function_returns('pgr_edwardmoore', ARRAY['text','bigint','anyarray','boolean'], 'setof record');
38-
RETURN QUERY SELECT function_returns('pgr_edwardmoore', ARRAY['text','anyarray','bigint','boolean'], 'setof record');
39-
RETURN QUERY SELECT function_returns('pgr_edwardmoore', ARRAY['text','anyarray','anyarray','boolean'], 'setof record');
40-
41-
RETURN QUERY
42-
SELECT CASE
43-
WHEN min_version('3.2.0') THEN
44-
collect_tap(
45-
has_function('pgr_edwardmoore', ARRAY['text','text','boolean']),
46-
function_returns('pgr_edwardmoore', ARRAY['text','text','boolean'], 'setof record')
47-
)
48-
ELSE
49-
skip(2, 'Combinations signature added on version 3.2.0')
50-
END;
51-
52-
RETURN QUERY
53-
SELECT CASE
54-
WHEN min_version('3.2.0') THEN
55-
collect_tap(
56-
57-
function_args_eq('pgr_edwardmoore',
58-
$$VALUES
59-
('{"","","","directed","seq","path_seq","node","edge","cost","agg_cost"}'::TEXT[]),
60-
('{"","","","directed","seq","path_seq","start_vid","node","edge","cost","agg_cost"}'::TEXT[]),
61-
('{"","","","directed","seq","path_seq","end_vid","node","edge","cost","agg_cost"}'::TEXT[]),
62-
('{"","","","directed","seq","path_seq","start_vid","end_vid","node","edge","cost","agg_cost"}'::TEXT[]),
63-
('{"","",directed,seq,path_seq,start_vid,end_vid,node,edge,cost,agg_cost}'::TEXT[])
64-
$$
65-
),
66-
67-
function_types_eq('pgr_edwardmoore',
68-
$$VALUES
69-
('{text,int8,int8,bool,int4,int4,int8,int8,float8,float8}'::TEXT[]),
70-
('{text,int8,anyarray,bool,int4,int4,int8,int8,int8,float8,float8}'::TEXT[]),
71-
('{text,anyarray,int8,bool,int4,int4,int8,int8,int8,float8,float8}'::TEXT[]),
72-
('{text,anyarray,anyarray,bool,int4,int4,int8,int8,int8,int8,float8,float8}'::TEXT[]),
73-
('{text,text,bool,int4,int4,int8,int8,int8,int8,float8,float8}'::TEXT[])
74-
$$
75-
)
76-
)
77-
ELSE
78-
collect_tap(
79-
80-
function_args_eq('pgr_edwardmoore',
81-
$$VALUES
82-
('{"","","","directed","seq","path_seq","node","edge","cost","agg_cost"}'::TEXT[]),
83-
('{"","","","directed","seq","path_seq","start_vid","node","edge","cost","agg_cost"}'::TEXT[]),
84-
('{"","","","directed","seq","path_seq","end_vid","node","edge","cost","agg_cost"}'::TEXT[]),
85-
('{"","","","directed","seq","path_seq","start_vid","end_vid","node","edge","cost","agg_cost"}'::TEXT[])
86-
$$
87-
),
88-
89-
function_types_eq('pgr_edwardmoore',
90-
$$VALUES
91-
('{text,int8,int8,bool,int4,int4,int8,int8,float8,float8}'::TEXT[]),
92-
('{text,int8,anyarray,bool,int4,int4,int8,int8,int8,float8,float8}'::TEXT[]),
93-
('{text,anyarray,int8,bool,int4,int4,int8,int8,int8,float8,float8}'::TEXT[]),
94-
('{text,anyarray,anyarray,bool,int4,int4,int8,int8,int8,int8,float8,float8}'::TEXT[])
95-
$$
96-
)
97-
)
98-
END;
99-
100-
END;
101-
$BODY$
102-
LANGUAGE plpgsql;
103-
104-
SELECT types_check();
21+
SELECT CASE WHEN min_version('4.0.0') THEN plan(13) WHEN min_version('3.2.0') THEN plan(12) ELSE PLAN(10) END;
10522

23+
SELECT single_path_types_check('pgr_edwardmoore', standard_v => '4.0.0');
10624

10725
SELECT finish();
10826
ROLLBACK;

0 commit comments

Comments
 (0)