Beispiel #1
0
 void cycles_with_link(u32 len, word_t u, word_t dest) {
   // printf("cycles_with_link(%d, %x, %x)\n", len, u, dest);
   if (visited.test(u))
     return;
   if (u == dest) {
     print_log("  %d-cycle found\n", len);
     if (len == PROOFSIZE && nsols < MAXSOLS) {
       qsort(sols[nsols++], PROOFSIZE, sizeof(word_t), nonce_cmp);
       memcpy(sols[nsols], sols[nsols-1], sizeof(sols[0]));
     }
     return;
   }
   if (len == PROOFSIZE)
     return;
   word_t au1 = adjlist[u];
   if (au1 != NIL) {
     visited.set(u);
     for (; au1 != NIL; au1 = links[au1].next) {
       sols[nsols][len] = au1/2;
       cycles_with_link(len+1, links[au1 ^ 1].to, dest);
     }
     visited.reset(u);
   }
 }