// ideal_stuff.cc // implementation of the special ideal features needed by the IP-algorithms #ifndef IDEAL_STUFF_CC #define IDEAL_STUFF_CC #include "ideal.h" ////////////////////// elimination stuff /////////////////////////////////// ideal& ideal::eliminate() { // eliminates the generators of the ideal involving elimination variables // with respect to w if(w.number_of_elimination_variables()<=0) // elimination unnecessary return *this; list_iterator iter; #ifdef NO_SUPPORT_DRIVEN_METHODS_EXTENDED // Simply iterate over the generator list and delete the elements involving // elimination variables. // There is no need to change the done/undone or the reduced/unreduced mark of // an element. iter.set_to_list(generators); while((iter.is_at_end())==FALSE) { binomial& bin=iter.get_element(); if(bin.involves_elimination_variables(w)==TRUE) { iter.delete_element(); size--; } else { bin.drop_elimination_variables(w); iter.next(); } } #endif // NO_SUPPORT_DRIVEN_METHODS_EXTENDED #ifdef SUPPORT_DRIVEN_METHODS_EXTENDED // Iterate over the generator lists and check whether the elements involve // elimination variables. // As the set of support variables can be changed by the elimination, the // elements that are not deleted are first moved to the aux_list and then // reinserted according to their new support. // The elimination variables are droppd while reinserting. // In general, elimination is done only once. The time needed for this is // linear in the number of generators (in the Groebner basis). The elimination // itself is therefore very fast in comparison to the Groebner basis // computation needed for it... So we renounce to a complicated optimization // of this procedure (the support information is not used). In fact, tests // show that elimination time is really negligible. // elimination for(short i=0;i=w.number_of_weighted_variables()) || (j<0) || (j>=w.number_of_weighted_variables())) { cout<<"WARNING: ideal::swap_variables(const short&, const short&)\n " "or ideal::swap_variables_unsafe(const short&, const short&):\n" "index out of range"<=w.number_of_weighted_variables())) { cout<<"WARNING: ideal::flip_variables(const short&):\n" "argument out of range, nothing done"<