Working version, identical values removed
This commit is contained in:
9
main.cpp
9
main.cpp
@@ -271,6 +271,8 @@ pair<set<FiniteFunction<BASE>>, bool> extend_function_class(
|
|||||||
const set<FiniteFunction<BASE>>& base_class,
|
const set<FiniteFunction<BASE>>& base_class,
|
||||||
size_t max_size
|
size_t max_size
|
||||||
) {
|
) {
|
||||||
|
FiniteFunction<CUR_BASE> identical_x(string("000 111 222"));
|
||||||
|
FiniteFunction<CUR_BASE> identical_y(string("012 012 012"));
|
||||||
auto FiniteFunctionHasher = [](const FiniteFunction<BASE> &f) -> uint32_t {
|
auto FiniteFunctionHasher = [](const FiniteFunction<BASE> &f) -> uint32_t {
|
||||||
return f.get_hash();
|
return f.get_hash();
|
||||||
};
|
};
|
||||||
@@ -303,6 +305,8 @@ pair<set<FiniteFunction<BASE>>, bool> extend_function_class(
|
|||||||
}
|
}
|
||||||
|
|
||||||
func_class.insert(new_funcs.begin(), new_funcs.end());
|
func_class.insert(new_funcs.begin(), new_funcs.end());
|
||||||
|
func_class.erase(identical_x);
|
||||||
|
func_class.erase(identical_y);
|
||||||
last_size = new_funcs.size();
|
last_size = new_funcs.size();
|
||||||
|
|
||||||
// слишком много насчитали -- выходим
|
// слишком много насчитали -- выходим
|
||||||
@@ -374,7 +378,7 @@ void do_work() {
|
|||||||
task.current,
|
task.current,
|
||||||
get_math_coeff(task.current_max_coeff)
|
get_math_coeff(task.current_max_coeff)
|
||||||
);
|
);
|
||||||
cout << "k=" << task.current_max_coeff << endl;
|
//cout << "k=" << task.current_max_coeff << endl;
|
||||||
processed_task_mutex.lock();
|
processed_task_mutex.lock();
|
||||||
processed_task_list.push_back(task);
|
processed_task_list.push_back(task);
|
||||||
processed_task_mutex.unlock();
|
processed_task_mutex.unlock();
|
||||||
@@ -407,7 +411,7 @@ void process_task_lists() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
cout << "task finished, appending" << endl;
|
//cout << "task finished, appending" << endl;
|
||||||
++completed_tasks;
|
++completed_tasks;
|
||||||
auto func_class = task.current;
|
auto func_class = task.current;
|
||||||
bool is_need_append = true;
|
bool is_need_append = true;
|
||||||
@@ -421,6 +425,7 @@ void process_task_lists() {
|
|||||||
func_class.end()
|
func_class.end()
|
||||||
)
|
)
|
||||||
) {
|
) {
|
||||||
|
cout << "includes!!" << endl;
|
||||||
// новый класс функций часть уже существующего
|
// новый класс функций часть уже существующего
|
||||||
functions_to_remove.push_back(it);
|
functions_to_remove.push_back(it);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user