void CheckGraphCorrect(PGraph Saved, PGraph Loaded) { EXPECT_EQ(Saved->GetNodes(), Loaded->GetNodes()); EXPECT_EQ(Saved->GetEdges(), Loaded->GetEdges()); for (typename PGraph::TObj::TEdgeI EI = Saved->BegEI(); EI < Saved->EndEI(); EI++) { TInt Src = EI.GetSrcNId(); TInt Dst = EI.GetDstNId(); EXPECT_TRUE(Loaded->IsEdge(Src, Dst)); } }
void BenchmarkGraphEdgeI(PGraph Graph, std::ofstream& file, bool isDefrag) { int ECount = 0; int i = 0; clock_t start = clock(); for (i = 0; i < 50; i++) { ECount = 0; for (typename PGraph::TObj::TEdgeI EI = Graph->BegEI(); EI < Graph->EndEI(); EI++) { ECount++; } } double msec = (clock() - start) * 1000.0 / CLOCKS_PER_SEC; printf("Nodes: %d Edges: %d Time: %f ms\n", Graph->GetNodes(), ECount, msec/50); file << msec/50 << " "; }