Skip to content
Snippets Groups Projects
Commit 5cc9577f authored by Radek Hušek's avatar Radek Hušek Committed by Radek Hušek
Browse files

Refactor Tester::run()

parent e7be7573
Branches
No related tags found
No related merge requests found
...@@ -140,32 +140,30 @@ struct Tester : public AbstractTester { ...@@ -140,32 +140,30 @@ struct Tester : public AbstractTester {
#endif #endif
virtual bool run() { virtual bool run() {
# if SAVE_MEMORY
# define INC(a) a = true
# else
# define INC(a) a++
# endif
Mapping forb(edges); Mapping forb(edges);
# if USE_NEXT_FORB # if USE_NEXT_FORB
for (size_t i = 0; i < edges; i++) for (size_t i = 0; i < edges; i++) forb.assign(i, 1);
forb.assign(i, 1);
do { do {
Mapping copy(forb); Mapping copy(forb);
#if SAVE_MEMORY INC(classes[pack(cannonize(copy))]);
classes[pack(cannonize(copy))] = true;
#else
classes[pack(cannonize(copy))]++;
#endif
} while (nextForb(forb)); } while (nextForb(forb));
#else // ! USE_NEXT_FORB
for (size_t i = 0; i < numForb; i++)
#if SAVE_MEMORY
classes[pack(cannonize(unpack(i, forb)))] = true;
# else # else
classes[pack(cannonize(unpack(i, forb)))]++; for (size_t i = 0; i < numForb; i++)
#endif INC(classes[pack(cannonize(unpack(i, forb)))]);
# endif # endif
for (const auto &c : classes) if (!c) return (isConnected = false); for (const auto &c : classes) if (!c) return (isConnected = false);
return (isConnected = true); return (isConnected = true);
# undef INC
} }
virtual ~Tester() {} virtual ~Tester() {}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment