neta.h 3.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  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_find_path(dglGraph_s * graph, int from, int to, int *edges,
  38. struct ilist *list);
  39. /*timetables.c */
  40. /*Structure containing all information about a timetable.
  41. * Everything in indexed from 0.
  42. */
  43. typedef struct
  44. {
  45. int routes; /*Number of different routes. Two routes are different even if they differ only in time. */
  46. int *route_length; /*Length of each route, i.e., number of stops */
  47. int **route_stops; /*list of stops on each route in order (time increases) */
  48. int **route_times; /*stop arrival times on overy route. Stops are given in the same order as above */
  49. int stops; /*number of stops */
  50. int *stop_length; /*Number of routes stopping at each stop */
  51. int **stop_routes; /*List of routes for each stop. Routes are in increasing order */
  52. int **stop_times; /*arrival times of routes for each stop. Routes are given in the same order as above */
  53. int *walk_length; /*number of stops with "walking connection" for each stop */
  54. int **walk_stops; /*list of stops within walking distance for each stop */
  55. int **walk_times; /*walking times between stops as given above */
  56. } neta_timetable;
  57. typedef struct
  58. {
  59. int **dst;
  60. int **prev_stop;
  61. int **prev_route;
  62. int **prev_conn;
  63. int rows, routes;
  64. } neta_timetable_result;
  65. int NetA_init_timetable_from_db(struct Map_info *In, int route_layer,
  66. int walk_layer, char *route_id, char *times,
  67. char *to_stop, char *walk_length,
  68. neta_timetable * timetable, int **route_ids,
  69. int **stop_ids);
  70. int NetA_timetable_shortest_path(neta_timetable * timetable, int from_stop,
  71. int to_stop, int start_time, int min_change,
  72. int max_changes, int walking_change,
  73. neta_timetable_result * result);
  74. int NetA_timetable_get_route_time(neta_timetable * timetable, int stop,
  75. int route);
  76. void NetA_timetable_result_release(neta_timetable_result * result);
  77. #endif