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