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;
105 virtual void AddVertex(GNMGFID nFID);
111 virtual void DeleteVertex(GNMGFID nFID);
122 virtual void AddEdge(GNMGFID nConFID, GNMGFID nSrcFID, GNMGFID nTgtFID,
129 virtual void DeleteEdge(GNMGFID nConFID);
137 virtual void ChangeEdge(GNMGFID nFID,
double dfCost,
double dfInvCost);
144 virtual void ChangeBlockState (GNMGFID nFID,
bool bBlock);
151 virtual bool CheckVertexBlocked(GNMGFID nFID)
const;
160 virtual void ChangeAllBlockState (
bool bBlock =
false);
174 virtual GNMPATH DijkstraShortestPath(GNMGFID nStartFID, GNMGFID nEndFID);
195 virtual std::vector<GNMPATH> KShortestPaths(GNMGFID nStartFID,
196 GNMGFID nEndFID,
size_t nK);
211 virtual GNMPATH ConnectedComponents(
const GNMVECTOR &anEmittersIDs);
214 virtual void Clear();
232 virtual void DijkstraShortestPathTree(GNMGFID nFID,
233 const std::map<GNMGFID, GNMStdEdge> &mstEdges,
234 std::map<GNMGFID, GNMGFID> &mnPathTree);
236 virtual GNMPATH DijkstraShortestPath(GNMGFID nStartFID, GNMGFID nEndFID,
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 GNMGFID nTgtVertexFID
Target vertex FID.
Definition: gnmgraph.h:62
Core portability definitions for CPL.
GNMGFID nSrcVertexFID
Source vertex FID.
Definition: gnmgraph.h:61
bool bIsBidir
Whether the edge is bidirectonal.
Definition: gnmgraph.h:63
The simple graph class, which holds the appropriate for calculations graph in memory (based on STL co...
Definition: gnmgraph.h:89
bool bIsBloked
Whether the edge is blocked.
Definition: gnmgraph.h:66
bool bIsBloked
Whether the vertex is blocked.
Definition: gnmgraph.h:73
double dfInvCost
Inverse cost.
Definition: gnmgraph.h:65
Edge.
Definition: gnmgraph.h:59
GNMVECTOR anOutEdgeFIDs
TODO.
Definition: gnmgraph.h:72
double dfDirCost
Direct cost.
Definition: gnmgraph.h:64
Vertex.
Definition: gnmgraph.h:70