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