neta.h 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. #ifndef GRASS_NETADEFS_H
  2. #define GRASS_NETADEFS_H
  3. /*bridge.c */
  4. int NetA_compute_bridges(dglGraph_s * graph, struct ilist *bridge_list);
  5. int NetA_articulation_points(dglGraph_s * graph,
  6. struct ilist *articulation_list);
  7. /*components.c */
  8. int NetA_weakly_connected_components(dglGraph_s * graph, int *component);
  9. int NetA_strongly_connected_components(dglGraph_s * graph, int *component);
  10. /*spanningtree.c */
  11. int NetA_spanning_tree(dglGraph_s * graph, struct ilist *tree_list);
  12. /*neta_flow.c */
  13. int NetA_flow(dglGraph_s * graph, struct ilist *source_list,
  14. struct ilist *sink_list, int *flow);
  15. int NetA_min_cut(dglGraph_s * graph, struct ilist *source_list,
  16. struct ilist *sink_list, int *flow, struct ilist *cut);
  17. int NetA_split_vertices(dglGraph_s * in, dglGraph_s * out, int *node_costs);
  18. /*utils.c */
  19. void NetA_add_point_on_node(struct Map_info *In, struct Map_info *Out, int node,
  20. struct line_cats *Cats);
  21. void NetA_points_to_nodes(struct Map_info *In, struct ilist *point_list);
  22. int NetA_get_node_costs(struct Map_info *In, int layer, char *column,
  23. int *node_costs);
  24. void NetA_varray_to_nodes(struct Map_info *map, struct varray * varray,
  25. struct ilist *nodes, int *nodes_to_features);
  26. int NetA_initialise_varray(struct Map_info *In, int layer, int mask_type,
  27. char *where, char *cat, struct varray ** varray);
  28. /*centrality.c */
  29. void NetA_degree_centrality(dglGraph_s * graph, double *degree);
  30. int NetA_eigenvector_centrality(dglGraph_s * graph, int iterations,
  31. double error, double *eigenvector);
  32. int NetA_betweenness_closeness(dglGraph_s * graph, double *betweenness,
  33. double *closeness);
  34. /*path.c */
  35. int NetA_distance_from_points(dglGraph_s * graph, struct ilist *from, int *dst,
  36. dglInt32_t ** prev);
  37. int NetA_distance_to_points(dglGraph_s * graph, struct ilist *to, int *dst,
  38. dglInt32_t ** nxt);
  39. int NetA_find_path(dglGraph_s * graph, int from, int to, int *edges,
  40. struct ilist *list);
  41. /*timetables.c */
  42. /*Structure containing all information about a timetable.
  43. * Everything in indexed from 0.
  44. */
  45. typedef struct
  46. {
  47. int routes; /*Number of different routes. Two routes are different even if they differ only in time. */
  48. int *route_length; /*Length of each route, i.e., number of stops */
  49. int **route_stops; /*list of stops on each route in order (time increases) */
  50. int **route_times; /*stop arrival times on overy route. Stops are given in the same order as above */
  51. int stops; /*number of stops */
  52. int *stop_length; /*Number of routes stopping at each stop */
  53. int **stop_routes; /*List of routes for each stop. Routes are in increasing order */
  54. int **stop_times; /*arrival times of routes for each stop. Routes are given in the same order as above */
  55. int *walk_length; /*number of stops with "walking connection" for each stop */
  56. int **walk_stops; /*list of stops within walking distance for each stop */
  57. int **walk_times; /*walking times between stops as given above */
  58. } neta_timetable;
  59. typedef struct
  60. {
  61. int **dst;
  62. int **prev_stop;
  63. int **prev_route;
  64. int **prev_conn;
  65. int rows, routes;
  66. } neta_timetable_result;
  67. int NetA_init_timetable_from_db(struct Map_info *In, int route_layer,
  68. int walk_layer, char *route_id, char *times,
  69. char *to_stop, char *walk_length,
  70. neta_timetable * timetable, int **route_ids,
  71. int **stop_ids);
  72. int NetA_timetable_shortest_path(neta_timetable * timetable, int from_stop,
  73. int to_stop, int start_time, int min_change,
  74. int max_changes, int walking_change,
  75. neta_timetable_result * result);
  76. int NetA_timetable_get_route_time(neta_timetable * timetable, int stop,
  77. int route);
  78. void NetA_timetable_result_release(neta_timetable_result * result);
  79. #endif