simplifying toplevel code

parent 3ea5dbb5
......@@ -60,6 +60,8 @@ std::vector<Polynomial> F4() {
for (const auto& g : gb)
GB_LeadingMonomials.insert(g.LeadingMonomial());
bool stop_crit = HasAllPowersOfVars(GB_LeadingMonomials);
std::string list_id_reductors = input_sys + " ";
while (!global_critical_pairs.empty() &&
(!MAXSTEP_FLAG || step_number < MAXSTEP) &&
......@@ -70,27 +72,11 @@ std::vector<Polynomial> F4() {
std::system(("build/selcrit/selcrit " + WORKDIR + " critpairs_glob.txt critpairs_step.txt").c_str());
global_critical_pairs.clear();
step_critical_pairs.clear();
TINYGB_TRY(LoadCritPairs("critpairs_glob.txt", global_critical_pairs, UniqueMatIds), "f4");
TINYGB_TRY(LoadCritPairs("critpairs_step.txt", step_critical_pairs, UniqueMatIds), "f4");
if (step_critical_pairs.empty())
continue;
std::string list_id_reductors = input_sys + " ";
for (const auto& it : list_F4_matrices)
list_id_reductors += it->id() + " ";
std::system(("build/selred/selred " + WORKDIR + " critpairs_step.txt reductors_step.txt "
+ list_id_reductors).c_str());
std::vector<std::pair<Monomial, PolynomialInMatrix>> step_reductors;
LoadReductors("reductors_step.txt", step_reductors, UniqueMatIds);
TINYGB_TRY(LoadCritPairs("critpairs_glob.txt", global_critical_pairs, UniqueMatIds), "f4");
TINYGB_TRY(LoadCritPairs("critpairs_step.txt", step_critical_pairs, UniqueMatIds), "f4");
// std::vector<std::pair<Monomial, PolynomialInMatrix>> step_reductors;
// LoadReductors("reductors_step.txt", step_reductors, UniqueMatIds);
std::system(("build/buildmats/buildmats " + WORKDIR + " critpairs_step.txt reductors_step.txt " +
"matA matB matC matD").c_str());
......@@ -104,8 +90,8 @@ std::vector<Polynomial> F4() {
std::shared_ptr<RowMajMat> B, D;
ReadRowMajMat(&D, "matD2");
ReadRowMajMat(&B, "matB3");
TINYGB_TRY(ReadRowMajMat(&D, "matD2"), "f4");
TINYGB_TRY(ReadRowMajMat(&B, "matB3"), "f4");
new_polynomials_in_gb.clear();
......@@ -127,8 +113,8 @@ std::vector<Polynomial> F4() {
new_reduced_polynomials2 =
PolynomialInMatrix::MakeSystemOfPolynomialsInMatrix(p_current_storage_matrix2);
list_F4_matrices.push_back(p_current_storage_matrix1);
list_F4_matrices.push_back(p_current_storage_matrix2);
list_id_reductors += p_current_storage_matrix1->id() + " ";
list_id_reductors += p_current_storage_matrix2->id() + " ";
new_reduced_polynomials1.clear();
new_reduced_polynomials1.shrink_to_fit();
......@@ -136,7 +122,6 @@ std::vector<Polynomial> F4() {
new_reduced_polynomials2.shrink_to_fit();
TINYGB_TRY(SaveGB("gb.txt", gb), "f4");
TINYGB_TRY(SaveCritPairs("critpairs_glob.txt", global_critical_pairs), "f4");
std::system(("build/addcrit/addcrit " + WORKDIR + " " + p_current_storage_matrix2->id()
+ " critpairs_glob.txt gb.txt").c_str());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment