Using constexpt for getting initial functions

This commit is contained in:
2019-12-13 19:07:17 +03:00
parent e529a2f2ac
commit 31c08fba76

View File

@@ -127,18 +127,18 @@ vector<MyFunction> get_function_class(MyFunction f, const vector< MyMatrix >& tr
vector<MyFunction> get_linear_components() {
vector<MyFunction> res;
if ( ARGS_COUNT == 3 ) {
if constexpr ( ARGS_COUNT == 3 ) {
res.push_back(MyFunction("11111111")); // f = 1
res.push_back(MyFunction("00001111")); // f = x_1
res.push_back(MyFunction("00110011")); // f = x_2
res.push_back(MyFunction("01010101")); // f = x_3
} else if ( ARGS_COUNT == 4 ) {
} else if constexpr ( ARGS_COUNT == 4 ) {
res.push_back(MyFunction("1111111111111111")); // f = 1
res.push_back(MyFunction("0000000011111111")); // f = x_1
res.push_back(MyFunction("0000111100001111")); // f = x_2
res.push_back(MyFunction("0011001100110011")); // f = x_3
res.push_back(MyFunction("0101010101010101")); // f = x_4
} else if ( ARGS_COUNT == 5 ) {
} else if constexpr ( ARGS_COUNT == 5 ) {
res.push_back(MyFunction("11111111111111111111111111111111")); // f = 1
res.push_back(MyFunction("00000000000000001111111111111111")); // f = x_1
res.push_back(MyFunction("00000000111111110000000011111111")); // f = x_2