// IP_algorithms.cc #ifndef IP_ALGORITMS_CC #define IP_ALGORITHMS_CC #include "IP_algorithms.h" #include #include /////////////// method for printing compilation settings //////////////////// void print_flags(ofstream& output) { output<<"compiler settings:"<>format_string; if(!input) { cerr<<"ERROR: int Conti_Traverso(INPUT_FILE, const BOOLEAN&):\n" "input failure when reading format specification,\n" "input format not accepted"<>format_string; if(!input) { cerr<<"ERROR: int Conti_Traverso(INPUT_FILE, const BOOLEAN&):\n" "input failure before reading number of variables / matrix columns,\n" "input format not accepted"<>variables; if(!input) { cerr<<"ERROR: int Conti_Traverso(INPUT_FILE, const BOOLEAN&):\n" "input failure when reading number of variables / matrix columns,\n" "input format not accepted"<>format_string; if(!input) { cerr<<"ERROR: int Conti_Traverso(INPUT_FILE, const BOOLEAN&):\n" "input failure before reading cost vector,\n" "input format not accepted"<>format_string; if(!input) { cerr<<"ERROR: int Conti_Traverso(INPUT_FILE, const BOOLEAN&):\n" "input failure before reading cost vector,\n" "input format not accepted"<>format_string; if(!input) { cerr<<"ERROR: int Conti_Traverso(INPUT_FILE, const BOOLEAN&):\n" "input failure before reading number of constraints / matrix rows,\n" "input format not accepted"<>constraints; if(!input) { cerr<<"ERROR: int Conti_Traverso(INPUT_FILE, const BOOLEAN&):\n" "input failure when reading number of constraints / matrix rows,\n" "input format not accepted" <>format_string; if(!input) { cerr<<"ERROR: int Conti_Traverso(INPUT_FILE, const BOOLEAN&):\n" "input failure before reading matrix,\n" "input format not accepted"<0) output<0) output<>format_string; if(!input) { cerr<<"ERROR: int Positive_Conti_Traverso(INPUT_FILE, const BOOLEAN&):\n" "input failure when reading format specification,\n" "input format not accepted"<>format_string; if(!input) { cerr<<"ERROR: int Positive_Conti_Traverso(INPUT_FILE, const BOOLEAN&):\n" "input failure before reading number of variables / matrix columns,\n" "input format not accepted"<>variables; if(!input) { cerr<<"ERROR: int Positive_Conti_Traverso(INPUT_FILE, const BOOLEAN&):\n" "input failure when reading number of variables / matrix columns,\n" "input format not accepted"<>format_string; if(!input) { cerr<<"ERROR: int Positive_Conti_Traverso(INPUT_FILE, const BOOLEAN&):\n" "input failure before reading cost vector,\n" " input format not accepted"<>format_string; if(!input) { cerr<<"ERROR: int Positive_Conti_Traverso(INPUT_FILE, const BOOLEAN&):\n" "input failure before reading cost vector,\n" "input format not accepted"<>format_string; if(!input) { cerr<<"ERROR: int Positive_Conti_Traverso(INPUT_FILE, const BOOLEAN&):\n" "input failure before reading number of constraints / matrix rows,\n" "input format not accepted"<>constraints; if(!input) { cerr<<"ERROR: int Positive_Conti_Traverso(INPUT_FILE, const BOOLEAN&):\n" "input failure when reading number of constraints / matrix rows,\n" "input format not accepted" <>format_string; if(!input) { cerr<<"ERROR: int Positive_Conti_Traverso(INPUT_FILE, const BOOLEAN&):\n" "input failure before reading matrix,\n" "input format not accepted"<0) output<0) output<>format_string; if(!input) { cerr<<"ERROR: int Elim_Conti_Traverso(INPUT_FILE, const BOOLEAN&):\n" "input failure when reading format specification,\n" "input format not accepted"<>format_string; if(!input) { cerr<<"ERROR: int Elim_Conti_Traverso(INPUT_FILE, const BOOLEAN&):\n" "input failure before reading number of variables / matrix columns,\n" "input format not accepted"<>variables; if(!input) { cerr<<"ERROR: int Elim_Conti_Traverso(INPUT_FILE, const BOOLEAN&):\n" "input failure when reading number of variables / matrix columns,\n" "input format not accepted"<>format_string; if(!input) { cerr<<"ERROR: int Elim_Conti_Traverso(INPUT_FILE, const BOOLEAN&):\n" "input failure before reading cost vector,\n" "input format not accepted"<>format_string; if(!input) { cerr<<"ERROR: int Elim_Conti_Traverso(INPUT_FILE, const BOOLEAN&):\n" "input failure before reading cost vector,\n" "input format not accepted"<>format_string; if(!input) { cerr<<"ERROR: int Elim_Conti_Traverso(INPUT_FILE, const BOOLEAN&):\n" "input failure before reading number of constraints / matrix rows,\n" "input format not accepted"<>constraints; if(!input) { cerr<<"ERROR: int Elim_Conti_Traverso(INPUT_FILE, const BOOLEAN&):\n" "input failure when reading number of constraints / matrix rows,\n" "input format not accepted" <>format_string; if(!input) { cerr<<"ERROR: int Elim_Conti_Traverso(INPUT_FILE, const BOOLEAN&):\n" "input failure before reading matrix,\n" "input format not accepted"<0) output<>format_string; if(!input) { cerr<<"ERROR: int Pottier(INPUT_FILE, const BOOLEAN&):\n" "input failure when reading format specification,\n" "input format not accepted"<>format_string; if(!input) { cerr<<"ERROR: int Pottier(INPUT_FILE, const BOOLEAN&):\n" "input failure before reading number of variables / matrix columns,\n" "input format not accepted"<>variables; if(!input) { cerr<<"ERROR: int Pottier(INPUT_FILE, const BOOLEAN&):\n" "input failure when reading number of variables / matrix columns,\n" "input format not accepted"<>format_string; if(!input) { cerr<<"ERROR: int Pottier(INPUT_FILE, const BOOLEAN&):\n" "input failure before reading cost vector,\n" "input format not accepted"<>format_string; if(!input) { cerr<<"ERROR: int Pottier(INPUT_FILE, const BOOLEAN&):\n" "input failure before reading cost vector,\n" "input format not accepted"<>format_string; if(!input) { cerr<<"ERROR: int Pottier(INPUT_FILE, const BOOLEAN&):\n" "input failure before reading number of constraints / matrix rows,\n" " input format not accepted"<>constraints; if(!input) { cerr<<"ERROR: int Pottier(INPUT_FILE, const BOOLEAN&):\n" "input failure when reading number of constraints / matrix rows,\n " "input format not accepted" <>format_string; if(!input) { cerr<<"ERROR: int Pottier(INPUT_FILE, const BOOLEAN&):\n" "input failure before reading matrix,\n" "input format not accepted"<0) output<>format_string; if(!input) { cerr<<"ERROR: int Hosten_Sturmfels(INPUT_FILE, const BOOLEAN&):\n" "input failure when reading format specification,\n" "input format not accepted"<>format_string; if(!input) { cerr<<"ERROR: int Hosten_Sturmfels(INPUT_FILE, const BOOLEAN&):\n" "input failure before reading number of variables / matrix columns,\n" "input format not accepted"<>variables; if(!input) { cerr<<"ERROR: int Hosten_Sturmfels(INPUT_FILE, const BOOLEAN&):\n" "input failure when reading number of variables / matrix columns,\n" "input format not accepted"<>format_string; if(!input) { cerr<<"ERROR: int Hosten_Sturmfels(INPUT_FILE, const BOOLEAN&):\n" "input failure before reading cost vector,\n" "input format not accepted"<>format_string; if(!input) { cerr<<"ERROR: int Hosten_Sturmfels(INPUT_FILE, const BOOLEAN&):\n" "input failure before reading cost vector,\n" "input format not accepted"<>format_string; if(!input) { cerr<<"ERROR: int Hosten_Sturmfels(INPUT_FILE, const BOOLEAN&):\n" "input failure before reading number of constraints / matrix rows,\n" "input format not accepted"<>constraints; if(!input) { cerr<<"ERROR: int Hosten_Sturmfels(INPUT_FILE, const BOOLEAN&):\n" "input failure when reading number of constraints / matrix rows,\n" "input format not accepted" <>format_string; if(!input) { cerr<<"ERROR: int Hosten_Sturmfels(INPUT_FILE, const BOOLEAN&):\n" "input failure before reading matrix,\n" "input format not accepted"<>format_string; if(!input) { cerr<<"ERROR: int Hosten_Sturmfels(INPUT_FILE, const BOOLEAN&):\n" "input failure before reading positive row space vector,\n" "input format not accepted"<>format_string; if(!input) { cerr<<"ERROR: int Hosten_Sturmfels(INPUT_FILE, const BOOLEAN&):\n" "input failure before reading positive row space vector,\n" "input format not accepted"<>format_string; if(!input) { cerr<<"ERROR: int Hosten_Sturmfels(INPUT_FILE, const BOOLEAN&):\n" "input failure before reading positive row space vector,\n" " input format not accepted"<>format_string; if(!input) { cerr<<"ERROR: int Hosten_Sturmfels(INPUT_FILE, const BOOLEAN&):\n" "input failure before reading positive row space vector,\n" "input format not accepted"<>hom_grad[i]; if(!input) { cerr<<"ERROR: int Hosten_Sturmfels(INPUT_FILE, const BOOLEAN&):\n" "input failure when reading positive grading / row space vector,\n" "input format not accepted"<0) output<>format_string; if(!input) { cerr<<"ERROR: int DiBiase_Urbanke(INPUT_FILE, const BOOLEAN&):\n" "input failure when reading format specification,\n" "input format not accepted"<>format_string; if(!input) { cerr<<"ERROR: int DiBiase_Urbanke(INPUT_FILE, const BOOLEAN&):\n" "input failure before reading number of variables / matrix columns,\n" "input format not accepted"<>variables; if(!input) { cerr<<"ERROR: int DiBiase_Urbanke(INPUT_FILE, const BOOLEAN&):\n" "input failure when reading number of variables / matrix columns,\n" "input format not accepted"<>format_string; if(!input) { cerr<<"ERROR: int DiBiase_Urbanke(INPUT_FILE, const BOOLEAN&):\n" "input failure before reading cost vector,\n" "input format not accepted"<>format_string; if(!input) { cerr<<"ERROR: int DiBiase_Urbanke(INPUT_FILE, const BOOLEAN&):\n" "input failure before reading cost vector,\n" " input format not accepted"<>format_string; if(!input) { cerr<<"ERROR: int DiBiase_Urbanke(INPUT_FILE, const BOOLEAN&):\n" "input failure before reading number of constraints / matrix rows,\n" " input format not accepted"<>constraints; if(!input) { cerr<<"ERROR: int DiBiase_Urbanke(INPUT_FILE, const BOOLEAN&):\n" "input failure when reading number of constraints / matrix rows,\n" "input format not accepted" <>format_string; if(!input) { cerr<<"ERROR: int DiBiase_Urbanke(INPUT_FILE, const BOOLEAN&):\n" "input failure before reading matrix,\n" "input format not accepted"<reduced_Groebner_basis(version,S_pair_criteria,interred_percentage); } else { // construct term ordering to start with // Here we have much freedom: The term ordering must only be an // elimination ordering for the actual flip variable. // To avoid supplementary functions to manipulate term orderings, we // simply realize this as follows: The weight of the actual // flip variable is set to 1, all other weights are set to zero. This // still allows the use of different term orderings (by setting the // refining ordering). float* weights=new float[variables]; for(int j=0;jreduced_Groebner_basis(version,S_pair_criteria,interred_percentage); I->flip_variable_unsafe(F[0]); // "unsafe" means that head and tail can be exchanged (cf. the routine // ideal::swap_variables_unsafe(...) ) // But the following change of the term ordering will correct this. for(int l=1;lchange_term_ordering_to(w); I->reduced_Groebner_basis(version,S_pair_criteria,interred_percentage); I->flip_variable_unsafe(F[l]); } // Now we have a generating system of the saturated ideal. // Compute Groebner basis with respect to the objective function. I->change_term_ordering_to(c); I->reduced_Groebner_basis(version,S_pair_criteria,interred_percentage); } end=clock(); // time measurement float elapsed=((float) (end-start))/CLOCKS_PER_SEC; ///////////////////////// output //////////////////////////////////////////// // create output file char GROEBNER[128]; int i=0; while(MATRIX[i]!='\0' && MATRIX[i]!='.') { GROEBNER[i]=MATRIX[i]; i++; } GROEBNER[i]='\0'; strcat(GROEBNER,".GB.du"); ofstream output(GROEBNER); // format output file output.flags(output.flags()|ios::fixed); // output of fixed point numbers output<<"GROEBNER"<0) output<number_of_generators()<format_print(output); output<0) delete[] F; delete I; return 1; } //////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////// int Bigatti_LaScala_Robbiano(INPUT_FILE MATRIX, const int& version, const int& S_pair_criteria, const float& interred_percentage, const BOOLEAN& verbose) { /////////////////////////// input ///////////////////////////////////////// char format_string[128]; // to verifie file format int constraints; // number of equality constraints int variables; // number of variables ifstream input(MATRIX); // verfifie existence of file if(!input) { cerr<<"ERROR: int Bigatti_LaScala_Robbiano(INPUT_FILE, const BOOLEAN&):\n" "cannot read from input file, possibly not found"<>format_string; if(!input) { cerr<<"ERROR: int Bigatti_LaScala_Robbiano(INPUT_FILE, const BOOLEAN&):\n" "input failure when reading format specification,\n" "input format not accepted"<>format_string; if(!input) { cerr<<"ERROR: int Bigatti_LaScala_Robbiano(INPUT_FILE, const BOOLEAN&):\n" "input failure before reading number of variables / matrix columns,\n" "input format not accepted"<>variables; if(!input) { cerr<<"ERROR: int Bigatti_LaScala_Robbiano(INPUT_FILE, const BOOLEAN&):\n" "input failure when reading number of variables / matrix columns,\n" "input format not accepted"<>format_string; if(!input) { cerr<<"ERROR: int Bigatti_LaScala_Robbiano(INPUT_FILE, const BOOLEAN&):\n" "input failure before reading cost vector,\n" "input format not accepted"<>format_string; if(!input) { cerr<<"ERROR: int Bigatti_LaScala_Robbiano(INPUT_FILE, const BOOLEAN&):\n" "input failure before reading cost vector,\n" "input format not accepted"<>format_string; if(!input) { cerr<<"ERROR: int Bigatti_LaScala_Robbiano(INPUT_FILE, const BOOLEAN&):\n" "input failure before reading number of constraints / matrix rows,\n" "input format not accepted"<>constraints; if(!input) { cerr<<"ERROR: int Bigatti_LaScala_Robbiano(INPUT_FILE, const BOOLEAN&):\n" "input failure when reading number of constraints / matrix rows,\n" "input format not accepted" <>format_string; if(!input) { cerr<<"ERROR: int Bigatti_LaScala_Robbiano(INPUT_FILE, const BOOLEAN&):\n" "input failure before reading matrix,\n" "input format not accepted"<>format_string; if(!input) { cerr<<"ERROR: int Bigatti_LaScala_Robbiano(INPUT_FILE, const BOOLEAN&):\n" "input failure before reading positive row space vector,\n" "input format not accepted"<>format_string; if(!input) { cerr<<"ERROR: int Bigatti_LaScala_Robbiano(INPUT_FILE, const BOOLEAN&):\n" "input failure before reading positive row space vector,\n" "input format not accepted"<>format_string; if(!input) { cerr<<"ERROR: int Bigatti_LaScala_Robbiano(INPUT_FILE, const BOOLEAN&):\n" "input failure before reading positive row space vector,\n" " input format not accepted"<>format_string; if(!input) { cerr<<"ERROR: int Bigatti_LaScala_Robbiano(INPUT_FILE, const BOOLEAN&):\n" "input failure before reading positive row space vector,\n" "input format not accepted"<>hom_grad[_i]; if(!input) { cerr<<"ERROR: int Bigatti_LaScala_Robbiano(INPUT_FILE, const BOOLEAN&):" "\n" "input failure when reading positive grading / row space vector,\n" "input format not accepted"<0) output<>format_string; if(!groebner) { cerr<<"ERROR: int solve(INPUT_FILE, INPUT_FILE):\n" "input failure when reading format specification of second input file,\n" "input format not accepted"<>format_string; if(!groebner) { cerr<<"ERROR: int solve(INPUT_FILE, INPUT_FILE):\n" "input failure before reading algorithm from second input file,\n" "input format not accepted"<>format_string; if(!groebner) { cerr<<"ERROR: int solve(INPUT_FILE, INPUT_FILE):\n" "input failure before reading algorithm from second input file,\n" "input format not accepted"<>format_string; if(!groebner) { cerr<<"ERROR: int solve(INPUT_FILE, INPUT_FILE):\n" "input failure before reading algorithm from second input file,\n" "input format not accepted"<>algorithm; if(!groebner) { cerr<<"ERROR: int solve(INPUT_FILE, INPUT_FILE):\n" "input failure when reading algorithm from second input file,\n" "input format not accepted"<>format_string; if(!groebner) { cerr<<"ERROR: int solve(INPUT_FILE, INPUT_FILE):\n" "input failure before reading term ordering from second \n" "input file, input format not accepted"<>format_string; if(!groebner) { cerr<<"ERROR: int solve(INPUT_FILE, INPUT_FILE):\n" "input failure before reading term ordering \n" "from second input file, input format not accepted"<>format_string; if(!groebner) { cerr<<"ERROR: int solve(INPUT_FILE, INPUT_FILE):\n" "input failure when reading term ordering \n" "from second input file, input format not accepted"<>format_string; if(!groebner) { cerr<<"ERROR: int solve(INPUT_FILE, INPUT_FILE):\n" "input failure when reading term ordering \n" "from second input file, input format not accepted"<>elimination_variables; if(!groebner) { cerr<<"ERROR: int solve(INPUT_FILE, INPUT_FILE):\n" "input failure when reading term ordering \n" "from second input file, input format not accepted"<0) { groebner>>elimination_refinement; if(!groebner) { cerr<<"ERROR: int solve(INPUT_FILE, INPUT_FILE):\n" "input failure when reading term ordering \n" "from second input file, input format not accepted"<>format_string; if(!groebner) { cerr<<"ERROR: int solve(INPUT_FILE, INPUT_FILE):\n" "input failure when reading term ordering \n" "from second input file, input format not accepted"<>format_string; if(!groebner) { cerr<<"ERROR: int solve(INPUT_FILE, INPUT_FILE):\n" "input failure when reading term ordering \n" "from second input file, input format not accepted"<>weighted_variables; if(!groebner) { cerr<<"ERROR: int solve(INPUT_FILE, INPUT_FILE):\n" "input failure when reading term ordering \n" "from second input file, input format not accepted"<>weighted_refinement; if(!groebner) { cerr<<"ERROR: int solve(INPUT_FILE, INPUT_FILE):\n" "input failure when reading term ordering \n" "from second input file, input format not accepted"<0) { int elimination_ref; if(!strcmp(elimination_refinement,"LEX")) elimination_ref=LEX; if(!strcmp(elimination_refinement,"DEG_LEX")) elimination_ref=DEG_LEX; if(!strcmp(elimination_refinement,"DEG_REV_LEX")) elimination_ref=DEG_REV_LEX; w.convert_to_elimination_ordering(elimination_variables,elimination_ref); if(w.error_status()<0) { cerr<<"ERROR: int solve(INPUT_FILE, INPUT_FILE):\n" "input failure when reading new cost vector from second input file,\n" "input format not accepted"<>format_string; if(!groebner) { cerr<<"ERROR: int solve(INPUT_FILE, INPUT_FILE):\n" "input failure before reading number of ideal generators \n" "from second input file, input format not accepted"<>size; if(!groebner) { cerr<<"ERROR: int solve(INPUT_FILE, INPUT_FILE):\n" "input failure when reading number of ideal generators \n" "from second input file, input format not accepted"<>format_string; if(!groebner) { cerr<<"ERROR: int solve(INPUT_FILE, INPUT_FILE):\n" "input failure before reading ideal generators \n" "from second input file, input format not accepted"<>format_string; if(!groebner) { cerr<<"ERROR: int solve(INPUT_FILE, INPUT_FILE):\n" "input failure before reading ideal generators \n" "from second input file, input format not accepted"<>format_string; if(!problem) { cerr<<"ERROR: int solve(INPUT_FILE, INPUT_FILE):\n" "input failure when reading format specification of first input file,\n" "input format not accepted"<>format_string; if(!problem) { cerr<<"ERROR: int solve(INPUT_FILE, INPUT_FILE):\n" "input failure before reading vector dimension from first input file,\n" "input format not accepted"<>format_string; if(!problem) { cerr<<"ERROR: int solve(INPUT_FILE, INPUT_FILE):\n" "input failure before reading vector dimension from first input file,\n" "input format not accepted"<>problem_variables; if(!problem) { cerr<<"ERROR: int solve(INPUT_FILE, INPUT_FILE):\n" "input failure when reading vector dimension from first input file,\n" "input format not accepted"<>format_string; if(!problem) { cerr<<"ERROR: int solve(INPUT_FILE, INPUT_FILE):\n" "input failure before reading number of instances from first input file," "\n" "input format not accepted"<>format_string; if(!problem) { cerr<<"ERROR: int solve(INPUT_FILE, INPUT_FILE):\n" "input failure before reading number of instances from first input file," "\n" "input format not accepted"<>format_string; if(!problem) { cerr<<"ERROR: int solve(INPUT_FILE, INPUT_FILE):\n" "input failure before reading number of instances from first input file," "\n" "input format not accepted"<>instances; if(!problem) { cerr<<"ERROR: int solve(INPUT_FILE, INPUT_FILE):\n" "input failure when reading number of instances from first input file,\n" "input format not accepted"<>format_string; if(!problem) { cerr<<"ERROR: int solve(INPUT_FILE, INPUT_FILE):\n" "input failure before reading right hand / initial solution vectors \n" "from first input file, input format not accepted"<>format_string; if(!problem) { cerr<<"ERROR: int solve(INPUT_FILE, INPUT_FILE):\n" "input failure before reading right hand / initial solution vectors \n" "from first input file, input format not accepted"<>format_string; if(!problem) { cerr<<"ERROR: int solve(INPUT_FILE, INPUT_FILE):\n" "input failure before reading right hand / initial solution vectors \n" "from first input file, input format not accepted"<>format_string; if(!problem) { cerr<<"ERROR: int solve(INPUT_FILE, INPUT_FILE):\n" "input failure before reading right hand / initial solution vectors \n" "from first input file, input format not accepted"<>format_string; if(!problem) { cerr<<"ERROR: int solve(INPUT_FILE, INPUT_FILE):\n" "input failure before reading right hand / initial solution vectors \n" "from first input file, input format not accepted"<>format_string; if(!problem) { cerr<<"ERROR: int solve(INPUT_FILE, INPUT_FILE):\n" "input failure before reading right hand / initial solution vectors \n" "from first input file, input format not accepted"<>right_hand[i]; if(!problem) { cerr<<"ERROR: int solve(INPUT_FILE, INPUT_FILE):\n" "input failure when reading right hand vector "<>right_hand[i]; if(!problem) { cerr<<"ERROR: int solve(INPUT_FILE, INPUT_FILE):\n" "input failure when reading right hand vector "<>initial_solution[i]; if(!problem) { cerr<<"ERROR: int solve(INPUT_FILE, INPUT_FILE):\n" "input failure when reading right hand vector "<>format_string; if(!old) { cerr<<"ERROR: int change_cost(INPUT_FILE, INPUT_FILE):\n" "input failure when reading format specification of first input file,\n" "input format not accepted"<>format_string; if(!old) { cerr<<"ERROR: int change_cost(INPUT_FILE, INPUT_FILE):\n" "input failure before reading algorithm from first input file,\n" "input format not accepted"<>format_string; if(!old) { cerr<<"ERROR: int change_cost(INPUT_FILE, INPUT_FILE):\n" "input failure before reading algorithm from first input file,\n" "input format not accepted"<>format_string; if(!old) { cerr<<"ERROR: int change_cost(INPUT_FILE, INPUT_FILE):\n" "input failure before reading algorithm from first input file,\n" "input format not accepted"<>algorithm; if(!old) { cerr<<"ERROR: int change_cost(INPUT_FILE, INPUT_FILE):\n" "input failure when reading algorithm from first input file,\n" "input format not accepted"<>format_string; if(!old) { cerr<<"ERROR: int change_cost(INPUT_FILE, INPUT_FILE):\n" "input failure before reading term ordering from first \n" "input file, input format not accepted"<>format_string; if(!old) { cerr<<"ERROR: int change_cost(INPUT_FILE, INPUT_FILE):\n" "input failure before reading term ordering \n" "from first input file, input format not accepted"<>format_string; if(!old) { cerr<<"ERROR: int change_cost(INPUT_FILE, INPUT_FILE):\n" "input failure when reading term ordering \n" "from first input file, input format not accepted"<>format_string; if(!old) { cerr<<"ERROR: int change_cost(INPUT_FILE, INPUT_FILE):\n" "input failure when reading term ordering \n" "from first input file, input format not accepted"<>elimination_variables; if(!old) { cerr<<"ERROR: int change_cost(INPUT_FILE, INPUT_FILE):\n" "input failure when reading term ordering \n" "from first input file, input format not accepted"<0) { old>>elimination_refinement; if(!old) { cerr<<"ERROR: int change_cost(INPUT_FILE, INPUT_FILE):\n" "input failure when reading term ordering \n" "from first input file, input format not accepted"<>format_string; if(!old) { cerr<<"ERROR: int change_cost(INPUT_FILE, INPUT_FILE):\n" "input failure when reading term ordering \n" "from first input file, input format not accepted"<>format_string; if(!old) { cerr<<"ERROR: int change_cost(INPUT_FILE, INPUT_FILE):\n" "input failure when reading term ordering \n" "from first input file, input format not accepted"<>weighted_variables; if(!old) { cerr<<"ERROR: int change_cost(INPUT_FILE, INPUT_FILE):\n" "input failure when reading term ordering \n" "from first input file, input format not accepted"<>weighted_refinement; if(!old) { cerr<<"ERROR: int change_cost(INPUT_FILE, INPUT_FILE):\n" "input failure when reading term ordering \n" "from first input file, input format not accepted"<>format_string; if(!_new) { cerr<<"ERROR: int change_cost(INPUT_FILE, INPUT_FILE):\n" "input failure when reading format specification\n" "from second input file, input format not accepted"<>format_string; if(!_new) { cerr<<"ERROR: int change_cost(INPUT_FILE, INPUT_FILE):\n" "input failure before reading number of variables \n" "from second input file, input format not accepted"<>new_variables; if(!_new) { cerr<<"ERROR: int change_cost(INPUT_FILE, INPUT_FILE):\n" "input failure when reading number of variables \n" "from second input file, input format not accepted"<>format_string; if(!_new) { cerr<<"ERROR: int change_cost(INPUT_FILE, INPUT_FILE):\n" "input failure before reading new cost vector from second input file,\n" "input format not accepted"<>format_string; if(!_new) { cerr<<"ERROR: int change_cost(INPUT_FILE, INPUT_FILE):\n" "input failure before reading new cost vector from second input file,\n" "input format not accepted"<0) { int elimination_ref; if(!strcmp(elimination_refinement,"LEX")) elimination_ref=LEX; if(!strcmp(elimination_refinement,"DEG_LEX")) elimination_ref=DEG_LEX; if(!strcmp(elimination_refinement,"DEG_REV_LEX")) elimination_ref=DEG_REV_LEX; w.convert_to_elimination_ordering(elimination_variables,elimination_ref); if(w.error_status()<0) { cerr<<"ERROR: int change_cost(INPUT_FILE, INPUT_FILE):\n" "input failure when reading new cost vector from second input file,\n" "input format not accepted"<>format_string; if(!old) { cerr<<"ERROR: int change_cost(INPUT_FILE, INPUT_FILE):\n" "input failure before reading number of ideal generators \n" "from first input file, input format not accepted"<>old_size; if(!old) { cerr<<"ERROR: int change_cost(INPUT_FILE, INPUT_FILE):\n" "input failure when reading number of ideal generators \n" "from first input file, input format not accepted"<>format_string; if(!old) { cerr<<"ERROR: int change_cost(INPUT_FILE, INPUT_FILE):\n" "input failure before reading ideal generators \n" "from first input file, input format not accepted"<>format_string; if(!old) { cerr<<"ERROR: int change_cost(INPUT_FILE, INPUT_FILE):\n" "input failure before reading ideal generators \n" "from first input file, input format not accepted"<0) output<0) output<