Boost-Graph
view release on metacpan or search on metacpan
Directed/Directed.xs view on Meta::CPAN
BoostGraph::DESTROY()
bool
BoostGraph::_addNode(int nodeId)
bool
BoostGraph::_addEdge(int nodeIdSource, int nodeIdSink, double weightVal)
void
BoostGraph::breadthFirstSearch(int startNodeId)
PPCODE:
std::vector<int> bfs = THIS->BGi->breadthFirstSearch(startNodeId);
for(unsigned int i=0; i<bfs.size(); i++) {
XPUSHs(sv_2mortal(newSVnv(bfs[i])));
}
void
BoostGraph::depthFirstSearch(int startNodeId)
PPCODE:
std::vector<int> dfs = THIS->BGi->depthFirstSearch(startNodeId);
for(unsigned int i=0; i<dfs.size(); i++) {
XPUSHs(sv_2mortal(newSVnv(dfs[i])));
}
void
BoostGraph::dijkstraShortestPath(int nodeIdStart, int nodeIdEnd)
PPCODE:
Path pInfo = THIS->BGi->dijkstraShortestPath(nodeIdStart, nodeIdEnd);
XPUSHs(sv_2mortal(newSVnv(pInfo.second))); // the path weight
for(unsigned int i=0; i<pInfo.first.size(); i++) {
XPUSHs(sv_2mortal(newSVnv(pInfo.first[i]))); // nodes in the path
}
double
BoostGraph::allPairsShortestPathsJohnson(int nodeIdStart, int nodeIdEnd)
Undirected/Undirected.xs view on Meta::CPAN
BoostGraph::DESTROY()
bool
BoostGraph::_addNode(int nodeId)
bool
BoostGraph::_addEdge(int nodeIdSource, int nodeIdSink, double weightVal)
void
BoostGraph::breadthFirstSearch(int startNodeId)
PPCODE:
std::vector<int> bfs = THIS->BGi->breadthFirstSearch(startNodeId);
for(unsigned int i=0; i<bfs.size(); i++) {
XPUSHs(sv_2mortal(newSVnv(bfs[i])));
}
void
BoostGraph::depthFirstSearch(int startNodeId)
PPCODE:
std::vector<int> dfs = THIS->BGi->depthFirstSearch(startNodeId);
for(unsigned int i=0; i<dfs.size(); i++) {
XPUSHs(sv_2mortal(newSVnv(dfs[i])));
}
void
BoostGraph::dijkstraShortestPath(int nodeIdStart, int nodeIdEnd)
PPCODE:
Path pInfo = THIS->BGi->dijkstraShortestPath(nodeIdStart, nodeIdEnd);
XPUSHs(sv_2mortal(newSVnv(pInfo.second))); // the path weight
for(unsigned int i=0; i<pInfo.first.size(); i++) {
XPUSHs(sv_2mortal(newSVnv(pInfo.first[i]))); // nodes in the path
}
double
BoostGraph::allPairsShortestPathsJohnson(int nodeIdStart, int nodeIdEnd)
double
BoostGraph::allPairsShortestPathsFloydWarshall(int nodeIdStart, int nodeIdEnd)
void
BoostGraph::connectedComponents()
PPCODE:
std::vector<int> components = THIS->BGi->connectedComponents();
for(unsigned int i=0; i<components.size(); i++) {
XPUSHs(sv_2mortal(newSVnv(components[i]))); // index=>node_id, value=>cluster
}
( run in 1.198 second using v1.01-cache-2.11-cpan-71847e10f99 )