1 | /* |
---|
2 | * A* Shortest path algorithm for PostgreSQL |
---|
3 | * |
---|
4 | * Copyright (c) 2006 Anton A. Patrushev, Orkney, Inc. |
---|
5 | * |
---|
6 | * This program is free software; you can redistribute it and/or modify |
---|
7 | * it under the terms of the GNU General Public License as published by |
---|
8 | * the Free Software Foundation; either version 2 of the License, or |
---|
9 | * (at your option) any later version. |
---|
10 | * |
---|
11 | * This program is distributed in the hope that it will be useful, |
---|
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
14 | * GNU General Public License for more details. |
---|
15 | * |
---|
16 | * You should have received a copy of the GNU General Public License |
---|
17 | * along with this program; if not, write to the Free Software |
---|
18 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
---|
19 | * |
---|
20 | */ |
---|
21 | |
---|
22 | #define _ASTAR_H |
---|
23 | |
---|
24 | #include "postgres.h" |
---|
25 | #include "dijkstra.h" |
---|
26 | |
---|
27 | typedef struct edge_astar |
---|
28 | { |
---|
29 | int id; |
---|
30 | int source; |
---|
31 | int target; |
---|
32 | float8 cost; |
---|
33 | float8 reverse_cost; |
---|
34 | float8 s_x; |
---|
35 | float8 s_y; |
---|
36 | float8 t_x; |
---|
37 | float8 t_y; |
---|
38 | } edge_astar_t; |
---|
39 | |
---|
40 | #ifdef __cplusplus |
---|
41 | extern "C" |
---|
42 | { |
---|
43 | #endif |
---|
44 | int boost_astar(edge_astar_t *edges, unsigned int count, |
---|
45 | int source_vertex_id, int target_vertex_id, |
---|
46 | bool directed, bool has_reverse_cost, |
---|
47 | path_element_t **path, int *path_count, char **err_msg); |
---|
48 | #ifdef __cplusplus |
---|
49 | } |
---|
50 | #endif |
---|