benchmark/edge_lookup.cc
changeset 2541 e67ec65747fa
parent 2510 bb523a4758f7
child 2553 bfced05fa852
equal deleted inserted replaced
9:e5800ddf59a7 10:cb114bcaae21
   410       for(NodeIt u(_g);u!=INVALID;++u)
   410       for(NodeIt u(_g);u!=INVALID;++u)
   411 	e=_el(u,v);
   411 	e=_el(u,v);
   412   }
   412   }
   413   
   413   
   414 };
   414 };
       
   415 
       
   416 class DEL 
       
   417 {
       
   418 public:
       
   419   Graph &_g;
       
   420   DynEdgeLookUp<Graph> _el;
       
   421   DEL(Graph &g) :_g(g), _el(g) {}
       
   422   void operator()() 
       
   423   {
       
   424     Edge e;
       
   425     
       
   426     for(NodeIt v(_g);v!=INVALID;++v)
       
   427       for(NodeIt u(_g);u!=INVALID;++u)
       
   428 	e=_el(u,v);
       
   429   }
       
   430   
       
   431 };
       
   432 
   415 class EL2
   433 class EL2
   416 {
   434 {
   417 public:
   435 public:
   418   Graph &_g;
   436   Graph &_g;
   419   EdgeLookUp2<Graph> _el;
   437   EdgeLookUp2<Graph> _el;
   510 //   }
   528 //   }
   511 
   529 
   512 
   530 
   513   TimeStamp t1 = runningTimeTest(FE(g),1);
   531   TimeStamp t1 = runningTimeTest(FE(g),1);
   514   TimeStamp t2 = runningTimeTest(EL(g),1);
   532   TimeStamp t2 = runningTimeTest(EL(g),1);
   515   TimeStamp t3 = runningTimeTest(EL2(g),1);
   533   TimeStamp t3 = runningTimeTest(DEL(g),1);
   516   TimeStamp t4 = runningTimeTest(EL3(g),1);
   534   TimeStamp t4 = runningTimeTest(EL2(g),1);
       
   535   TimeStamp t5 = runningTimeTest(EL3(g),1);
   517 //   TimeStamp t5 = runningTimeTest(EL4(g),1);
   536 //   TimeStamp t5 = runningTimeTest(EL4(g),1);
   518 //   TimeStamp t6 = runningTimeTest(EL5(g),1);
   537 //   TimeStamp t6 = runningTimeTest(EL5(g),1);
   519 
   538 
       
   539   std::cout << t1.userTime() << ' ' 
       
   540 	    << t2.userTime() << ' '
       
   541 	    << t3.userTime() << ' '
       
   542 	    << t4.userTime() << ' '
       
   543 	    << t5.userTime() << ' '
       
   544 // 	    << t5.userTime() << ' '
       
   545 //  	    << t6.userTime()
       
   546 	    << std::endl;
   520   std::cout << t1.userTime()/N/N << ' ' 
   547   std::cout << t1.userTime()/N/N << ' ' 
   521 	    << t2.userTime()/N/N << ' '
   548 	    << t2.userTime()/N/N << ' '
   522 	    << t3.userTime()/N/N << ' '
   549 	    << t3.userTime()/N/N << ' '
   523 	    << t4.userTime()/N/N << ' '
   550 	    << t4.userTime()/N/N << ' '
       
   551 	    << t5.userTime()/N/N << ' '
   524 // 	    << t5.userTime()/N/N << ' '
   552 // 	    << t5.userTime()/N/N << ' '
   525 //  	    << t6.userTime()/N/N
   553 //  	    << t6.userTime()/N/N
   526 	    << std::endl;
   554 	    << std::endl;
   527 }
   555 }
   528 
   556