37 G_debug(3,
" Edge = %d NodeFrom = %d NodeTo = %d edge cost = %d",
42 if (from != From_node) {
52 G_debug(3,
" EdgeCost += %d (node)", (
int)cost);
58 G_debug(3,
" don't clip first node");
74 dglInt32_t opaqueset[16] = {360000, 0, 0, 0, 0, 0, 0, 0,
75 0, 0, 0, 0, 0, 0, 0, 0};
77 G_debug(3,
"Vect_graph_init()");
102 G_debug(3,
"Vect_graph_build()");
130 G_debug(3,
"Vect_add_edge() from = %d to = %d, costs = %f, id = %d", from,
159 G_debug(3,
"Vect_graph_set_node_costs()");
184 struct ilist *List,
double *cost)
186 int i, line, *pclip, cArc, nRet;
190 G_debug(3,
"Vect_graph_shortest_path(): from = %d, to = %d", from, to);
229 for (i = 0; i < pSPReport->
cArc; i++) {
231 G_debug(2,
"From %ld to %ld - cost %ld user %d distance %ld",
242 *cost = (double)pSPReport->
nDistance / 1000;
244 *cost = (
double)nDistance / 1000;
248 cArc = pSPReport->
cArc;
void void void void G_fatal_error(const char *,...) __attribute__((format(printf
void G_warning(const char *,...) __attribute__((format(printf
int G_debug(int, const char *,...) __attribute__((format(printf
int Vect_list_append(struct ilist *, int)
Append new item to the end of list if not yet present.
int Vect_reset_list(struct ilist *)
Reset ilist structure.
#define PORT_DOUBLE_MAX
Limits for portable types.
#define UNUSED
A macro for an attribute, if attached to a variable, indicating that the variable is not used.
void Vect_graph_init(dglGraph_s *graph, int nodes_costs)
Initialize graph structure.
void Vect_graph_add_edge(dglGraph_s *graph, int from, int to, double costs, int id)
Add edge to graph.
void Vect_graph_set_node_costs(dglGraph_s *graph, int node, double costs)
Set node costs.
void Vect_graph_build(dglGraph_s *graph)
Build network graph.
int Vect_graph_shortest_path(dglGraph_s *graph, int from, int to, struct ilist *List, double *cost)
Find shortest path.
int dglGet_NodeAttrSize(dglGraph_s *pgraph)
int dglAddEdge(dglGraph_s *pGraph, dglInt32_t nHead, dglInt32_t nTail, dglInt32_t nCost, dglInt32_t nEdge)
int dglShortestPath(dglGraph_s *pGraph, dglSPReport_s **ppReport, dglInt32_t nStart, dglInt32_t nDestination, dglSPClip_fn fnClip, void *pvClipArg, dglSPCache_s *pCache)
char * dglStrerror(dglGraph_s *pgraph)
dglInt32_t dglEdgeGet_Id(dglGraph_s *pGraph, dglInt32_t *pnEdge)
void dglNodeSet_Attr(dglGraph_s *pGraph, dglInt32_t *pnNode, dglInt32_t *pnAttr)
int dglInitialize(dglGraph_s *pGraph, dglByte_t Version, dglInt32_t NodeAttrSize, dglInt32_t EdgeAttrSize, dglInt32_t *pOpaqueSet)
dglInt32_t * dglNodeGet_Attr(dglGraph_s *pGraph, dglInt32_t *pnNode)
void dglFreeSPReport(dglGraph_s *pgraph UNUSED, dglSPReport_s *pSPReport)
int dglShortestDistance(dglGraph_s *pGraph, dglInt32_t *pnDistance, dglInt32_t nStart, dglInt32_t nDestination, dglSPClip_fn fnClip, void *pvClipArg, dglSPCache_s *pCache)
int dglFlatten(dglGraph_s *pGraph)
dglInt32_t dglEdgeGet_Cost(dglGraph_s *pGraph, dglInt32_t *pnEdge)
dglInt32_t dglNodeGet_Id(dglGraph_s *pGraph, dglInt32_t *pnNode)
dglInt32_t * dglGetNode(dglGraph_s *pGraph, dglInt32_t nNodeId)