diff options
author | Jan Huwald <jh@sotun.de> | 2013-02-27 14:18:35 (GMT) |
---|---|---|
committer | Jan Huwald <jh@sotun.de> | 2013-02-27 14:18:35 (GMT) |
commit | 3e22cd74be95951547eeb4b81f6c813620f61475 (patch) | |
tree | e5848800bc1b959b649cdf8816bd3979bb24268a | |
parent | 3caa298fc0f881aeaab514c835ff20a2201bc329 (diff) |
make iterTrans verbose
-rw-r--r-- | cacount.cpp | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/cacount.cpp b/cacount.cpp index 3b385ab..ca6c1ab 100644 --- a/cacount.cpp +++ b/cacount.cpp @@ -7,12 +7,12 @@ #include <functional> #include <iostream> #include <map> - +#include <set> using namespace std; typedef uint32_t State; -const State logState = 16; +const State logState = 31; const State maxState = 1 << logState; bitset<8> rule(110); @@ -33,9 +33,14 @@ void iterState(function<void(int)> f) { for (State s=0; s<maxState; s++) f(s); } -void iterTrans(int times, function<void(int)> f) { - while (times--) + +void iterTrans(int times, function<void(int)> f, bool verbose=false) { + if (verbose) cerr << times << " left\r"; + while (times--) { iterState(f); + if (verbose) cerr << times << " left\r"; + } + if (verbose) cerr << " \r"; } void init(Trans &t) { |