benchmark/graph-bench.cc
changeset 1898 f030c01e6173
parent 1847 7cbc12e42482
child 1956 a055123339d5
equal deleted inserted replaced
2:52f07a95eae2 3:aea4fed8d221
    26   std::vector<Edge> equ(rat);
    26   std::vector<Edge> equ(rat);
    27   
    27   
    28   long long int count;
    28   long long int count;
    29   
    29   
    30   for(count=0;count<rat;count++) {
    30   for(count=0;count<rat;count++) {
    31     equ[count%rat]=G.addEdge(nodes[(count*p)%n],nodes[(count*p/n)%n]);
    31     equ[int(count%rat)]=G.addEdge(nodes[int((count*p)%n)],
       
    32 				  nodes[int((count*p/n)%n)]);
    32   }
    33   }
    33   for(;(count%rat)||((count*p)%n)||((count*p/n)%n);count++) {
    34   for(;(count%rat)||((count*p)%n)||((count*p/n)%n);count++) {
    34     //    if(!(count%1000000)) fprintf(stderr,"%d\r",count);
    35     //    if(!(count%1000000)) fprintf(stderr,"%d\r",count);
    35     if(count%rat) G.erase(equ[count%rat]);
    36     if(count%rat) G.erase(equ[count%rat]);
    36     equ[count%rat]=G.addEdge(nodes[(count*p)%n],nodes[(count*p/n)%n]);
    37     equ[int(count%rat)]=G.addEdge(nodes[int((count*p)%n)],
       
    38 				  nodes[int((count*p/n)%n)]);
    37   }
    39   }
    38 //   std::cout << "Added " << count
    40 //   std::cout << "Added " << count
    39 // 	    << " ( " << n << "^2 * " << rat << " ) edges\n";
    41 // 	    << " ( " << n << "^2 * " << rat << " ) edges\n";
    40 
    42 
    41 
    43