36 #if defined(__cplusplus) && !defined(CPL_SUPRESS_CPLUSPLUS)
44 #define GNMGFID GIntBig
46 #define GNM_EDGE_DIR_BOTH 0 // bidirectional
47 #define GNM_EDGE_DIR_SRCTOTGT 1 // from source to target
48 #define GNM_EDGE_DIR_TGTTOSRC 2 // from target to source
50 #if defined(__cplusplus) && !defined(CPL_SUPRESS_CPLUSPLUS)
52 typedef std::vector<GNMGFID> GNMVECTOR, *LPGNMVECTOR;
53 typedef const std::vector<GNMGFID> GNMCONSTVECTOR;
54 typedef const std::vector<GNMGFID>* LPGNMCONSTVECTOR;
55 typedef std::pair<GNMGFID,GNMGFID> EDGEVERTEXPAIR;
56 typedef std::vector< EDGEVERTEXPAIR > GNMPATH;
122 virtual void AddEdge(GNMGFID nConFID, GNMGFID nSrcFID, GNMGFID nTgtFID,
123 bool bIsBidir,
double dfCost,
double dfInvCost);
137 virtual void ChangeEdge(GNMGFID nFID,
double dfCost,
double dfInvCost);
196 GNMGFID nEndFID,
size_t nK);
233 const std::map<GNMGFID, GNMStdEdge> &mstEdges,
234 std::map<GNMGFID, GNMGFID> &mnPathTree);
237 const std::map<GNMGFID, GNMStdEdge> &mstEdges);
239 virtual LPGNMCONSTVECTOR GetOutEdges(GNMGFID nFID)
const;
240 virtual GNMGFID GetOppositVertex(GNMGFID nEdgeFID, GNMGFID nVertexFID)
const;
241 virtual void TraceTargets(std::queue<GNMGFID> &vertexQueue,
242 std::set<GNMGFID> &markedVertIds,
243 GNMPATH &connectedIds);
245 std::map<GNMGFID, GNMStdVertex> m_mstVertices;
246 std::map<GNMGFID, GNMStdEdge> m_mstEdges;
250 #endif // __cplusplus
virtual void DijkstraShortestPathTree(GNMGFID nFID, const std::map< GNMGFID, GNMStdEdge > &mstEdges, std::map< GNMGFID, GNMGFID > &mnPathTree)
Method to create best path tree.
virtual GNMPATH DijkstraShortestPath(GNMGFID nStartFID, GNMGFID nEndFID)
An implementation of Dijkstra shortest path algorithm.
The simple graph class, which holds the appropriate for calculations graph in memory (based on STL co...
Definition: gnmgraph.h:90
virtual void DeleteEdge(GNMGFID nConFID)
Delete edge from graph.
virtual void ChangeBlockState(GNMGFID nFID, bool bBlock)
Change the block state of edge or vertex.
GNMGFID nSrcVertexFID
Source vertex FID.
Definition: gnmgraph.h:61
Edge.
Definition: gnmgraph.h:60
virtual bool CheckVertexBlocked(GNMGFID nFID) const
Check if vertex is blocked.
Vertex.
Definition: gnmgraph.h:71
virtual std::vector< GNMPATH > KShortestPaths(GNMGFID nStartFID, GNMGFID nEndFID, size_t nK)
An implementation of KShortest paths algorithm.
bool bIsBloked
Whether the edge is blocked.
Definition: gnmgraph.h:66
bool bIsBidir
Whether the edge is bidirectonal.
Definition: gnmgraph.h:63
virtual void AddVertex(GNMGFID nFID)
Add a vertex to the graph.
bool bIsBloked
Whether the vertex is blocked.
Definition: gnmgraph.h:73
virtual void ChangeEdge(GNMGFID nFID, double dfCost, double dfInvCost)
Change edge properties.
virtual void AddEdge(GNMGFID nConFID, GNMGFID nSrcFID, GNMGFID nTgtFID, bool bIsBidir, double dfCost, double dfInvCost)
Add an edge to the graph.
virtual GNMPATH ConnectedComponents(const GNMVECTOR &anEmittersIDs)
Search connected components of the network.
virtual void ChangeAllBlockState(bool bBlock=false)
Change all vertices and edges block state.
double dfInvCost
Inverse cost.
Definition: gnmgraph.h:65
Core portability definitions for CPL.
virtual void DeleteVertex(GNMGFID nFID)
Delete vertex from the graph.
virtual void Clear()
Clear.
GNMGFID nTgtVertexFID
Target vertex FID.
Definition: gnmgraph.h:62
GNMVECTOR anOutEdgeFIDs
TODO.
Definition: gnmgraph.h:72
virtual GNMPATH DijkstraShortestPath(GNMGFID nStartFID, GNMGFID nEndFID, const std::map< GNMGFID, GNMStdEdge > &mstEdges)
DijkstraShortestPath.
double dfDirCost
Direct cost.
Definition: gnmgraph.h:64
Generated for GDAL by
1.8.20.