954{
956 gc_vector<int> vp;
957 gc_vector<int> thisvp;
958
960
962 {
963 buffer o;
964 o <<
"Computing pairs with first = " <<
p->pair_num <<
newline;
966 }
967 M->divide(
p->syz->monom,
p->syz->comp->syz->monom, PAIRS_mon);
968 M->to_varpower(PAIRS_mon, vp);
969
970
971
972
973 if (
P->is_skew_commutative())
974 {
977
978 int nskew =
P->n_skew_commutative_vars();
979 for (int v = 0; v < nskew; v++)
980 {
981 int w =
P->skew_variable(v);
982 if (exp[w] > 0)
983 {
984 thisvp.resize(0);
986 Bag *b =
new Bag(
static_cast<void *
>(
nullptr), thisvp);
987 elems.push_back(b);
988 }
989 }
991 }
992
993
994
995 if (
P->is_quotient_ring())
996 {
997 const MonomialIdeal *Rideal =
P->get_quotient_monomials();
998 for (
Bag& a : *Rideal)
999 {
1000
1001
1002
1003 thisvp.resize(0);
1006 continue;
1007 Bag *b =
new Bag(
static_cast<void *
>(
nullptr), thisvp);
1008 elems.push_back(b);
1009 }
1010 }
1011
1012
1013
1014
1015 MonomialIdeal *mi_orig =
p->syz->comp->mi;
1016 for (
Bag& a : *mi_orig)
1017 {
1018 Bag *b =
new Bag(a.basis_ptr());
1020 elems.push_back(b);
1021 }
1022
1023
1024
1025
1026
1027 mi_orig->insert_minimal(
new Bag(
p, vp));
1028
1029 MonomialIdeal mi(
P, elems);
1030
1032
1035 {
1036 res2_pair *second = reinterpret_cast<res2_pair *>(a.basis_ptr());
1037 M->from_varpower(a.monom().data(), m);
1038 M->mult(m,
p->syz->monom, m);
1039
1042 }
1043}
exponents::Exponents exponents_t
static void quotient(ConstExponents a, ConstExponents b, Vector &result)
static bool is_equal(ConstExponents a, ConstExponents b)
static void to_expvector(int n, ConstExponents a, exponents::Exponents result)
static void var(Exponent v, Exponent e, Vector &result)
gc_vector< int > & monom()
res2_pair * new_res2_pair(int i)
void insert_pair(res2_pair *p)
#define ALLOCATE_MONOMIAL(byte_len)
const mpreal exp(const mpreal &x, mp_rnd_t r=mpreal::get_default_rnd())
typename std::vector< T, gc_allocator< T > > gc_vector
a version of the STL vector, which allocates its backing memory with gc.
#define newarray_atomic(T, len)