#include <stdlib.h>
#include <string.h>
#include <grass/gis.h>
#include <grass/dbmi.h>
#include <grass/Vect.h>
Go to the source code of this file.
Functions | |
void | Vect_graph_init (GRAPH *graph, int nodes_costs) |
Build network graph. Internal format for edge costs is integer, costs are multiplied before conversion to int by 1000. Costs -1 for infinity i.e. arc or node is closed and cannot be traversed. | |
void | Vect_graph_build (GRAPH *graph) |
void | Vect_graph_add_edge (GRAPH *graph, int from, int to, double costs, int id) |
Add edge to graph. Internal format for edge costs is integer, costs are multiplied before conversion to int by 1000. Costs -1 for infinity i.e. arc or node is closed and cannot be traversed. | |
void | Vect_graph_set_node_costs (GRAPH *graph, int node, double costs) |
Set node costs Internal format for edge costs is integer, costs are multiplied before conversion to int by 1000. Costs -1 for infinity i.e. arc or node is closed and cannot be traversed. | |
int | Vect_graph_shortest_path (GRAPH *graph, int from, int to, struct ilist *List, double *cost) |
Find shortest path. Costs for 'from' and 'to' nodes are not considered (SP found even if 'from' or 'to' are 'closed' (costs = -1) and costs of these nodes are not added to SP costs result. |
Vect_graph_add_edge | ( | GRAPH * | graph, | |
int | from, | |||
int | to, | |||
double | costs, | |||
int | id | |||
) |
Add edge to graph. Internal format for edge costs is integer, costs are multiplied before conversion to int by 1000. Costs -1 for infinity i.e. arc or node is closed and cannot be traversed.
GRAPH | *graph | |
from | from node | |
to | to node | |
costs | ||
id | edge id |
Definition at line 111 of file Vlib/graph.c.
References dglAddEdge().
void Vect_graph_build | ( | GRAPH * | graph | ) |
Vect_graph_init | ( | GRAPH * | graph, | |
int | nodes_costs | |||
) |
Build network graph. Internal format for edge costs is integer, costs are multiplied before conversion to int by 1000. Costs -1 for infinity i.e. arc or node is closed and cannot be traversed.
GRAPH | *graph | |
nodes_costs | use node costs |
Definition at line 68 of file Vlib/graph.c.
References dglInitialize().
Vect_graph_set_node_costs | ( | GRAPH * | graph, | |
int | node, | |||
double | costs | |||
) |
Set node costs Internal format for edge costs is integer, costs are multiplied before conversion to int by 1000. Costs -1 for infinity i.e. arc or node is closed and cannot be traversed.
GRAPH | *graph | |
node | ||
costs |
Definition at line 134 of file Vlib/graph.c.
References dglGetNode(), and dglNodeSet_Attr().
int Vect_graph_shortest_path | ( | GRAPH * | graph, | |
int | from, | |||
int | to, | |||
struct ilist * | List, | |||
double * | cost | |||
) |
Find shortest path. Costs for 'from' and 'to' nodes are not considered (SP found even if 'from' or 'to' are 'closed' (costs = -1) and costs of these nodes are not added to SP costs result.
graph | ||
from | ||
to | ||
List | ||
cost |
Definition at line 160 of file Vlib/graph.c.
References _dglSPReport::cArc, dglEdgeGet_Cost(), dglEdgeGet_Id(), dglFreeSPReport(), dglShortestDistance(), dglShortestPath(), dglStrerror(), _dglSPReport::nDistance, _dglSPArc::nDistance, _dglSPArc::nFrom, _dglSPArc::nTo, _dglSPReport::pArc, _dglSPArc::pnEdge, Vect_list_append(), and Vect_reset_list().