|
|
@ -135,6 +135,56 @@ std::vector<uint64_t> FastCal::target_multi(uint64_t code, const FastCal::check_ |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
std::vector<uint64_t> FastCal::furthest(uint64_t code) { |
|
|
|
|
|
|
|
auto core = init(); |
|
|
|
|
|
|
|
cache.emplace(&cases.emplace(code, fast_cal_t { |
|
|
|
.code = code, |
|
|
|
.mask = 0, |
|
|
|
.last = nullptr, // without parent node
|
|
|
|
}).first->second); |
|
|
|
|
|
|
|
auto layer_end = cache.back(); |
|
|
|
|
|
|
|
int layer_num = 0; |
|
|
|
|
|
|
|
std::vector<uint64_t> layer_cases; |
|
|
|
|
|
|
|
while (!cache.empty()) { |
|
|
|
|
|
|
|
core.next_cases(cache.front()->code, cache.front()->mask); |
|
|
|
|
|
|
|
layer_cases.emplace_back(cache.front()->code); |
|
|
|
|
|
|
|
if (cache.front() == layer_end) { |
|
|
|
|
|
|
|
std::cout << "layer size -> " << layer_cases.size() << std::endl; |
|
|
|
std::cout << "reach layer " << layer_num << " ending -> " << cache.size() << std::endl; |
|
|
|
|
|
|
|
if (cache.size() == 1) { // almost exit -> last layer
|
|
|
|
break; |
|
|
|
// return layer_cases;
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
layer_cases.clear(); |
|
|
|
|
|
|
|
++layer_num; |
|
|
|
|
|
|
|
layer_end = cache.back(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
cache.pop(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
return layer_cases; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|