diff --git a/main.cpp b/main.cpp index 024b488..26ba9f0 100644 --- a/main.cpp +++ b/main.cpp @@ -26,6 +26,23 @@ const CellType CUR_BASE = 3; const int ARGS_COUNT = 2; const string CLASSES_FILENAME = "classes.txt"; +FiniteFunction identical_x; +FiniteFunction identical_y; + +template +pair, FiniteFunction> get_identicals() { + if ( BASE == 3 ) + return make_pair( + FiniteFunction(string("000 111 222")), + FiniteFunction(string("012 012 012")) + ); + else if ( BASE == 4 ) + return make_pair( + FiniteFunction(string("0000 1111 2222 3333")), + FiniteFunction(string("0123 0123 0123 0123")) + ); +} + struct FunctionTask { bool is_finished; vector> current; @@ -288,9 +305,6 @@ pair>, bool> extend_function_class( false ); } - - FiniteFunction identical_x(string("000 111 222")); - FiniteFunction identical_y(string("012 012 012")); auto FiniteFunctionHasher = [](const FiniteFunction &f) -> uint32_t { return f.get_hash(); }; @@ -541,6 +555,8 @@ void process_task_lists() { int main() { + tie(identical_x, identical_y) = get_identicals(); + cout << "sizeof FiniteFunction<" << (int)CUR_BASE << "> = " << sizeof(FiniteFunction) << endl; cout << "sizeof FunctionTask = "<< sizeof(FunctionTask) << endl; @@ -570,8 +586,7 @@ int main() { decltype(FiniteFunctionHasher) > allowed_functions(funcs.begin(), funcs.end(), 128, FiniteFunctionHasher); - FiniteFunction identical_x(string("000 111 222")); - FiniteFunction identical_y(string("012 012 012")); + cout << identical_x.get_hash() << endl; cout << identical_y.get_hash() << endl; allowed_functions.erase(identical_x);