Skip to content

Commit a66e416

Browse files
committed
[components] apply rfc-3
1 parent 8a007db commit a66e416

6 files changed

Lines changed: 140 additions & 30 deletions

File tree

sql/components/articulationPoints.sql

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,32 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
2727
2828
********************************************************************PGR-GNU*/
2929

30-
CREATE OR REPLACE FUNCTION pgr_articulationPoints(
31-
TEXT, -- edges_sql
32-
OUT seq INTEGER, -- seq
33-
OUT node BIGINT) -- the number of the node
30+
-------------------------
31+
-- pgr_articulationPoints
32+
-------------------------
33+
34+
CREATE OR REPLACE FUNCTION _pgr_articulationPoints(
35+
edges_sql TEXT,
3436

37+
OUT seq INTEGER,
38+
OUT node BIGINT)
3539
RETURNS SETOF RECORD AS
3640
'MODULE_PATHNAME', 'articulationPoints'
3741
LANGUAGE c IMMUTABLE STRICT;
3842

43+
44+
CREATE OR REPLACE FUNCTION pgr_articulationPoints(
45+
TEXT, -- edges_sql (required)
46+
47+
OUT seq INTEGER,
48+
OUT node BIGINT)
49+
RETURNS SETOF RECORD AS
50+
$BODY$
51+
SELECT *
52+
FROM _pgr_articulationPoints(_pgr_get_statement($1));
53+
$BODY$
54+
LANGUAGE SQL VOLATILE STRICT;
55+
56+
-- COMMENTS
57+
COMMENT ON FUNCTION pgr_articulationPoints(TEXT) IS
58+
'pgr_articulationPoints(edges_sql(id,source,target,cost[,reverse_cost]) For undirected graph';

sql/components/biconnectedComponents.sql

Lines changed: 27 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,34 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
2727
2828
********************************************************************PGR-GNU*/
2929

30-
CREATE OR REPLACE FUNCTION pgr_biconnectedComponents(
31-
TEXT, -- edges_sql
32-
OUT seq INTEGER, -- seq
33-
OUT component BIGINT, -- the lowest number of the edge in the component
34-
OUT n_seq INTEGER, -- nth_seq of the edge in the component
35-
OUT edge BIGINT) -- the number of the edge
36-
30+
----------------------------
31+
-- pgr_biconnectedComponents
32+
----------------------------
33+
CREATE OR REPLACE FUNCTION _pgr_biconnectedComponents(
34+
edges_sql TEXT,
35+
OUT seq INTEGER,
36+
OUT component BIGINT,
37+
OUT n_seq INTEGER,
38+
OUT edge BIGINT)
3739
RETURNS SETOF RECORD AS
3840
'MODULE_PATHNAME', 'biconnectedComponents'
3941
LANGUAGE c IMMUTABLE STRICT;
4042

43+
44+
CREATE OR REPLACE FUNCTION pgr_biconnectedComponents(
45+
TEXT, -- edges_sql (required)
46+
47+
OUT seq INTEGER,
48+
OUT component BIGINT,
49+
OUT n_seq INTEGER,
50+
OUT edge BIGINT)
51+
RETURNS SETOF RECORD AS
52+
$BODY$
53+
SELECT *
54+
FROM _pgr_biconnectedComponents(_pgr_get_statement($1));
55+
$BODY$
56+
LANGUAGE SQL VOLATILE STRICT;
57+
58+
-- COMMENTS
59+
COMMENT ON FUNCTION pgr_biconnectedComponents(TEXT) IS
60+
'pgr_biconnectedComponents(edges_sql(id,source,target,cost[,reverse_cost]) For undirected graph';

sql/components/bridges.sql

Lines changed: 24 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,31 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
2727
2828
********************************************************************PGR-GNU*/
2929

30-
CREATE OR REPLACE FUNCTION pgr_bridges(
31-
TEXT, -- edges_sql
32-
OUT seq INTEGER, -- seq
33-
OUT edge BIGINT) -- the number of the edge
30+
--------------
31+
-- pgr_bridges
32+
--------------
33+
34+
CREATE OR REPLACE FUNCTION _pgr_bridges(
35+
edges_sql TEXT,
3436

37+
OUT seq INTEGER,
38+
OUT edge BIGINT)
3539
RETURNS SETOF RECORD AS
3640
'MODULE_PATHNAME', 'bridges'
37-
LANGUAGE c IMMUTABLE STRICT;
41+
LANGUAGE C IMMUTABLE STRICT;
3842

43+
CREATE OR REPLACE FUNCTION pgr_bridges(
44+
TEXT, -- edges_sql (required)
45+
46+
OUT seq INTEGER,
47+
OUT edge BIGINT)
48+
RETURNS SETOF RECORD AS
49+
$BODY$
50+
SELECT *
51+
FROM _pgr_bridges(_pgr_get_statement($1));
52+
$BODY$
53+
LANGUAGE SQL VOLATILE STRICT;
54+
55+
-- COMMENTS
56+
COMMENT ON FUNCTION pgr_bridges(TEXT) IS
57+
'pgr_bridges(edges_sql(id,source,target,cost[,reverse_cost]) For undirected graph';

sql/components/connectedComponents.sql

Lines changed: 32 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,40 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
2727
2828
********************************************************************PGR-GNU*/
2929

30-
CREATE OR REPLACE FUNCTION pgr_connectedComponents(
31-
TEXT, -- edges_sql
32-
OUT seq INTEGER, -- seq
33-
OUT component BIGINT, -- the lowest number of the node in the component
34-
OUT n_seq INTEGER, -- nth_seq of the node in the component
35-
OUT node BIGINT) -- the number of the node
30+
-------------------------------------------------------------------------------
31+
-- COMPONENTS
32+
-------------------------------------------------------------------------------
33+
34+
--------------------------
35+
-- pgr_connectedComponents
36+
--------------------------
37+
CREATE OR REPLACE FUNCTION _pgr_connectedComponents(
38+
edges_sql TEXT,
39+
40+
OUT seq INTEGER,
41+
OUT component BIGINT,
42+
OUT n_seq INTEGER,
43+
OUT node BIGINT)
3644

3745
RETURNS SETOF RECORD AS
3846
'MODULE_PATHNAME', 'connectedComponents'
3947
LANGUAGE c IMMUTABLE STRICT;
4048

49+
CREATE OR REPLACE FUNCTION pgr_connectedComponents(
50+
TEXT, -- edges_sql (required)
51+
52+
OUT seq INTEGER,
53+
OUT component BIGINT,
54+
OUT n_seq INTEGER,
55+
OUT node BIGINT)
56+
RETURNS SETOF RECORD AS
57+
$BODY$
58+
SELECT *
59+
FROM _pgr_connectedComponents(_pgr_get_statement($1));
60+
$BODY$
61+
LANGUAGE SQL VOLATILE STRICT;
62+
63+
-- COMMENTS
64+
COMMENT ON FUNCTION pgr_connectedComponents(TEXT) IS
65+
'pgr_connectedComponents(edges_sql(id,source,target,cost[,reverse_cost]) For undirected graph';
66+

sql/components/strongComponents.sql

Lines changed: 28 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,36 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
2727
2828
********************************************************************PGR-GNU*/
2929

30-
CREATE OR REPLACE FUNCTION pgr_strongComponents(
31-
TEXT, -- edges_sql
32-
OUT seq INTEGER, -- seq
33-
OUT component BIGINT, -- the lowest number of the node in the component
34-
OUT n_seq INTEGER, -- nth_seq of the node in the component
35-
OUT node BIGINT) -- the number of the node
30+
-----------------------
31+
-- pgr_strongComponents
32+
-----------------------
33+
CREATE OR REPLACE FUNCTION _pgr_strongComponents(
34+
edges_sql TEXT,
35+
36+
OUT seq INTEGER,
37+
OUT component BIGINT,
38+
OUT n_seq INTEGER,
39+
OUT node BIGINT)
3640

3741
RETURNS SETOF RECORD AS
3842
'MODULE_PATHNAME', 'strongComponents'
3943
LANGUAGE c IMMUTABLE STRICT;
4044

45+
CREATE OR REPLACE FUNCTION pgr_strongComponents(
46+
TEXT, -- edges_sql (required)
47+
48+
OUT seq INTEGER,
49+
OUT component BIGINT,
50+
OUT n_seq INTEGER,
51+
OUT node BIGINT)
52+
RETURNS SETOF RECORD AS
53+
$BODY$
54+
SELECT *
55+
FROM _pgr_strongComponents(_pgr_get_statement($1));
56+
$BODY$
57+
LANGUAGE SQL VOLATILE STRICT;
58+
59+
-- COMMENTS
60+
COMMENT ON FUNCTION pgr_strongComponents(TEXT) IS
61+
'pgr_strongComponents(edges_sql(id,source,target,cost[,reverse_cost]) For directed graph';
62+

sql/sigs/pgrouting--3.0.0.sig

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ pgr_alphashape(text,double precision)
55
pgr_analyzegraph(text,double precision,text,text,text,text,text)
66
pgr_analyzeoneway(text,text[],text[],text[],text[],boolean,text,text,text)
77
_pgr_array_reverse(anyarray)
8+
_pgr_articulationpoints(text)
89
pgr_articulationpoints(text)
910
pgr_astarcostmatrix(text,anyarray,boolean,integer,double precision,double precision)
1011
pgr_astarcost(text,anyarray,anyarray,boolean,integer,double precision,double precision)
@@ -46,13 +47,16 @@ pgr_bellmanford(text,text,anyarray,anyarray,boolean)
4647
pgr_bellmanford(text,text,anyarray,bigint,boolean)
4748
pgr_bellmanford(text,text,bigint,anyarray,boolean)
4849
pgr_bellmanford(text,text,bigint,bigint,boolean)
50+
_pgr_biconnectedcomponents(text)
4951
pgr_biconnectedcomponents(text)
5052
pgr_boykovkolmogorov(text,anyarray,anyarray)
5153
pgr_boykovkolmogorov(text,anyarray,bigint)
5254
pgr_boykovkolmogorov(text,bigint,anyarray)
5355
pgr_boykovkolmogorov(text,bigint,bigint)
56+
_pgr_bridges(text)
5457
pgr_bridges(text)
5558
_pgr_checkverttab(text,text[],integer,text)
59+
_pgr_connectedcomponents(text)
5660
pgr_connectedcomponents(text)
5761
pgr_contractgraph(text,bigint[],integer,bigint[],boolean)
5862
_pgr_createindex(text,text,text,integer,text)
@@ -110,9 +114,7 @@ _pgr_johnson(text,boolean)
110114
pgr_johnson(text,boolean)
111115
pgr_kruskalbfs(text,anyarray,bigint)
112116
pgr_kruskalbfs(text,bigint,bigint)
113-
pgr_kruskaldd(text,anyarray,double precision)
114117
pgr_kruskaldd(text,anyarray,numeric)
115-
pgr_kruskaldd(text,bigint,double precision)
116118
pgr_kruskaldd(text,bigint,numeric)
117119
pgr_kruskaldfs(text,anyarray,bigint)
118120
pgr_kruskaldfs(text,bigint,bigint)
@@ -154,6 +156,7 @@ pgr_pushrelabel(text,bigint,bigint)
154156
_pgr_quote_ident(text)
155157
_pgr_startpoint(geometry)
156158
pgr_stoerwagner(text)
159+
_pgr_strongcomponents(text)
157160
pgr_strongcomponents(text)
158161
_pgr_trsp(text,integer,double precision,integer,double precision,boolean,boolean,text)
159162
pgr_trsp(text,integer,double precision,integer,double precision,boolean,boolean,text)

0 commit comments

Comments
 (0)