pgRouting  2.2
pgRouting extends the PostGIS / PostgreSQL geospatial database to provide geospatial routing functionality.
 All Classes Functions Variables Pages
shooting_star.h
1 /*PGR-GNU*****************************************************************
2 
3 Copyright (c) 2015 pgRouting developers
4 Mail: project@pgrouting.org
5 
6 ------
7 
8 This program is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 2 of the License, or
11 (at your option) any later version.
12 
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
17 
18 You should have received a copy of the GNU General Public License
19 along with this program; if not, write to the Free Software
20 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
21 
22 ********************************************************************PGR-GNU*/
23 /*
24  * Shooting* shortest path algorithm for PostgreSQL
25  *
26  * Copyright (c) 2007 Anton A. Patrushev, Orkney, Inc.
27  *
28  * This program is free software; you can redistribute it and/or modify
29  * it under the terms of the GNU General Public License as published by
30  * the Free Software Foundation; either version 2 of the License, or
31  * (at your option) any later version.
32  *
33  * This program is distributed in the hope that it will be useful,
34  * but WITHOUT ANY WARRANTY; without even the implied warranty of
35  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
36  * GNU General Public License for more details.
37  *
38  * You should have received a copy of the GNU General Public License
39  * along with this program; if not, write to the Free Software
40  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
41  *
42  */
43 
44 #define _SHOOTING_STAR_H
45 #define MAX_RULE_LENGTH 5
46 
47 #define MAX_NODES 1000000
48 #define MAX_COST 10000000
49 
50 #include "postgres.h"
51 
52 typedef struct edge_shooting_star
53 {
54  int id;
55  int source;
56  int target;
57  float8 cost;
58  float8 reverse_cost;
59  float8 s_x;
60  float8 s_y;
61  float8 t_x;
62  float8 t_y;
63  float8 to_cost;
64  int through_id[MAX_RULE_LENGTH];
65  int rule[MAX_RULE_LENGTH];
67 
68 //I had to redeclare this. I couldn't include dijkstra.h 'cause
69 //struct edge conflicts with function adjacency_list::edge()
70 typedef struct path_element
71 {
72  int vertex_id;
73  int edge_id;
74  float8 cost;
76 
77 #ifdef __cplusplus
78 extern "C"
79 {
80 #endif
81  int boost_shooting_star(edge_shooting_star_t *edges, unsigned int count,
82  int source_edge_id, int target_edge_id,
83  bool directed, bool has_reverse_cost,
84  path_element_t **path, int *path_count, char **err_msg,
85  int e_max_id);
86 #ifdef __cplusplus
87 }
88 #endif