Removed commented unused code
This commit is contained in:
87
main.cpp
87
main.cpp
@@ -348,11 +348,6 @@ vector<FiniteFunction<BASE>> get_funcs() {
|
||||
do {
|
||||
++count;
|
||||
auto cur_func = FiniteFunction<BASE>(initer);
|
||||
//if ( permutated_funcs.find(cur_func) != permutated_funcs.end() )
|
||||
// continue;
|
||||
// если закомментить, то 17 классов, вместо 20
|
||||
//for (auto&& permutation: permutations)
|
||||
// permutated_funcs.insert(cur_func.apply_permutation(permutation));
|
||||
funcs.push_back(cur_func);
|
||||
} while (initer.set_next());
|
||||
cout << "Total " << count << " functions" << endl;
|
||||
@@ -709,16 +704,6 @@ int main() {
|
||||
|
||||
auto funcs = get_funcs<CUR_BASE>();
|
||||
cout << "Removing permutations " << funcs.size() << " functions" << endl;
|
||||
/*vector<array<int, 3>> permutations;
|
||||
get_permutations<3>(permutations);
|
||||
string function_to_str("000 112 212");
|
||||
cout << FiniteFunction<3>(function_to_str).apply_permutation(permutations[1]) << endl;
|
||||
cout << FiniteFunction<3>(function_to_str).apply_permutation(permutations[2]) << endl;
|
||||
cout << FiniteFunction<3>(function_to_str).apply_permutation(permutations[3]) << endl;
|
||||
cout << FiniteFunction<3>(function_to_str).apply_permutation(permutations[4]) << endl;
|
||||
cout << FiniteFunction<3>(function_to_str).apply_permutation(permutations[5]) << endl;
|
||||
*/
|
||||
//cout << "022_210_002 -> " << FiniteFunction<3>(string("022 210 002")) << endl;
|
||||
|
||||
list< set<FiniteFunction<CUR_BASE>> > function_classes;
|
||||
unordered_set<
|
||||
@@ -764,79 +749,7 @@ int main() {
|
||||
shared_function_classes.begin(),
|
||||
shared_function_classes.end()
|
||||
);
|
||||
/*// фильтруем перестановки
|
||||
vector<array<int, CUR_BASE>> permutations;
|
||||
get_permutations<CUR_BASE>(permutations);
|
||||
map<size_t, vector<vector<set<FiniteFunction<CUR_BASE>>>::iterator> > classes_per_size;
|
||||
for (auto it = vector_classes.begin(); it != vector_classes.end(); ++it) {
|
||||
classes_per_size[it->size()].push_back(it);
|
||||
}
|
||||
|
||||
set<vector<set<FiniteFunction<CUR_BASE>>>::iterator> classes_to_remove;
|
||||
|
||||
|
||||
for (auto&& class_fixed_size: classes_per_size) {
|
||||
typedef pair<FiniteFunction<CUR_BASE>,vector<set<FiniteFunction<CUR_BASE>>>::iterator> sorting_arr_type;
|
||||
cout << class_fixed_size.first << " -> " <<
|
||||
class_fixed_size.second.size() << endl;
|
||||
|
||||
vector< sorting_arr_type > all_class_elements;
|
||||
for (auto &&cur_class_it: class_fixed_size.second) {
|
||||
for (auto&& cur_fn: (*cur_class_it)) {
|
||||
if ( (cur_fn == identical_x) || (cur_fn == identical_y) )
|
||||
continue;
|
||||
for (auto&& permutation: permutations)
|
||||
all_class_elements.push_back(make_pair(
|
||||
cur_fn.apply_permutation(permutation),
|
||||
cur_class_it
|
||||
));
|
||||
}
|
||||
}
|
||||
cout << all_class_elements.size() << endl;
|
||||
// сортируем массив
|
||||
sort(all_class_elements.begin(),all_class_elements.end());
|
||||
for (auto&& el: all_class_elements)
|
||||
cout << el.first << "|";
|
||||
// выбираем, кого удалить
|
||||
for (size_t i = 0; i < all_class_elements.size(); ++i) {
|
||||
decltype(classes_to_remove) cur_vals_to_remove;
|
||||
size_t j;
|
||||
for (
|
||||
j = i;
|
||||
(j < all_class_elements.size()) &&
|
||||
(all_class_elements.at(i).first == all_class_elements.at(j).first);
|
||||
++j
|
||||
) {
|
||||
cout << all_class_elements.at(i).first << "<->" <<
|
||||
all_class_elements.at(j).first << " " <<
|
||||
(all_class_elements.at(i).second == all_class_elements.at(j).second )
|
||||
<<endl;
|
||||
cur_vals_to_remove.insert(all_class_elements.at(j).second);
|
||||
}
|
||||
|
||||
for (
|
||||
auto it = next(cur_vals_to_remove.begin());
|
||||
it != cur_vals_to_remove.end();
|
||||
++it
|
||||
) {
|
||||
classes_to_remove.insert(*it);
|
||||
}
|
||||
|
||||
cout << "size " << cur_vals_to_remove.size() << endl;
|
||||
i = j;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
cout << "classes_to_remove.size() = " <<classes_to_remove.size() << endl;
|
||||
// удаляем
|
||||
{
|
||||
decltype(vector_classes) new_vector_classes;
|
||||
for (auto it = vector_classes.begin(); it != vector_classes.end(); ++it)
|
||||
if ( classes_to_remove.find(it) == classes_to_remove.end() )
|
||||
new_vector_classes.push_back(*it);
|
||||
swap(new_vector_classes, vector_classes);
|
||||
}*/
|
||||
append_classes(vector_classes);
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user