本文整理汇总了C++中TGraph::edge_point方法的典型用法代码示例。如果您正苦于以下问题:C++ TGraph::edge_point方法的具体用法?C++ TGraph::edge_point怎么用?C++ TGraph::edge_point使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TGraph
的用法示例。
在下文中一共展示了TGraph::edge_point方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
int main(int argc, char ** argv) {
char * fileName;
TGraph *index;
int totalres = 0;
char * gotqueryFile = NULL;
FILE * gotFile = NULL;
ifstream f;
unsigned int * gotreslist;
uint gotres = 0;
if (argc < 3) {
printf("Usage: %s <graphfile> <queryfile> [<gotqueryfile>]\n", argv[0]);
exit(1);
}
if (argc == 4) {
savegotFile = 1;
gotqueryFile = argv[3];
}
fileName = argv[1];
f.open(fileName, ios::binary);
index = TGraph::load(f);
f.close();
gotreslist = (uint*)malloc(sizeof(unsigned int)*BUFFER);
int nqueries = 0;
TimeQuery * queries = readQueries(argv[2], &nqueries);
int i;
#ifndef EXPERIMENTS
printf("We are checking the results... Experiments mode off.\n");
#endif
startClockTime();
for (i = 0; i < nqueries; i++) {
fprintf(stderr, "Processing %d/%d\r", i, nqueries);
TimeQuery query = queries[i];
//cleaning vector of results
switch(query.type) {
case EDGE: {
gotres = index->edge_point(query.row, query.column, query.time);
//gotres = findEdge(tree, query.row, query.column, query.time);
*gotreslist = gotres;
break;
}
case EDGE_NEXT: {
//gotres = findEdgeInterval(tree, query.row, query.column, query.initime, query.endtime, 1);
gotres = index->edge_next(query.row, query.column, query.time);
*gotreslist = gotres;
break;
}
case EDGE_WEAK: {
//gotres = findEdgeInterval(tree, query.row, query.column, query.initime, query.endtime, 0);
gotres = index->edge_weak(query.row, query.column, query.initime, query.endtime);
*gotreslist = gotres;
break;
}
case EDGE_STRONG: {
//gotres = findEdgeInterval(tree, query.row, query.column, query.initime, query.endtime, 1);
gotres = index->edge_strong(query.row, query.column, query.initime, query.endtime);
*gotreslist = gotres;
break;
}
case DIRECT_NEIGHBORS: {
//get_neighbors_point(gotreslist, &index, query.row, query.time);
index->direct_point(query.row, query.time, gotreslist);
break;
}
case REVERSE_NEIGHBORS: {
// get_reverse_point(gotreslist, &index, query.row, query.time);
index->reverse_point(query.row, query.time, gotreslist);
break;
}
case DIRECT_NEIGHBORS_WEAK: {
//get_neighbors_weak(gotreslist, &index, query.row, query.initime, query.endtime);
index->direct_weak(query.row, query.initime, query.endtime, gotreslist);
break;
}
case REVERSE_NEIGHBORS_WEAK: {
//get_reverse_weak(gotreslist, &index, query.row, query.initime, query.endtime);
index->reverse_weak(query.row, query.initime, query.endtime, gotreslist);
break;
}
case DIRECT_NEIGHBORS_STRONG: {
//get_neighbors_strong(gotreslist, &index, query.row, query.initime, query.endtime);
index->direct_strong(query.row, query.initime, query.endtime, gotreslist);
break;
}
case REVERSE_NEIGHBORS_STRONG: {
// get_reverse_strong(gotreslist, &index, query.row, query.initime, query.endtime);
index->reverse_strong(query.row, query.initime, query.endtime, gotreslist);
break;
}
//.........这里部分代码省略.........