1499{
1501 gc_vector<int> vp;
1502 gc_vector<int> thisvp;
1503
1505
1507 {
1508 buffer o;
1509 o <<
"Computing pairs with first = " <<
p->me <<
newline;
1511 }
1512 M->divide(
p->base_monom,
p->first->base_monom, PAIRS_mon);
1513 M->to_varpower(PAIRS_mon, vp);
1514
1515
1516
1517
1518 if (
P->is_skew_commutative())
1519 {
1520
1523
1524 int nskew =
P->n_skew_commutative_vars();
1525 for (int v = 0; v < nskew; v++)
1526 {
1527 int w =
P->skew_variable(v);
1528 if (exp[w] > 0)
1529 {
1530 thisvp.resize(0);
1532 Bag *b =
new Bag(
static_cast<void *
>(
nullptr), thisvp);
1533 elems.push_back(b);
1534 }
1535 }
1537 }
1538
1539
1540
1541 if (
P->is_quotient_ring())
1542 {
1543 const MonomialIdeal *Rideal =
P->get_quotient_monomials();
1544 for (
Bag& a : *Rideal)
1545 {
1546
1547
1548
1549 thisvp.resize(0);
1552 continue;
1553 Bag *b =
new Bag(
static_cast<void *
>(
nullptr), thisvp);
1554 elems.push_back(b);
1555 }
1556 }
1557
1558
1559
1560
1561 MonomialIdeal *mi_orig =
p->first->mi;
1562 for (
Bag& a : *mi_orig)
1563 {
1564 Bag *b =
new Bag(a.basis_ptr());
1566 elems.push_back(b);
1567 }
1568
1569
1570
1571
1572
1573 mi_orig->insert_minimal(
new Bag(
p, vp));
1574
1575 MonomialIdeal *mi =
new MonomialIdeal(
P, elems);
1576
1578
1580 {
1581 res_pair *second = reinterpret_cast<res_pair *>(a.basis_ptr());
1583
1584 M->from_varpower(a.monom().data(), q->
base_monom);
1588 }
1589
1590 delete mi;
1591}
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)
void debug_out(int disp=1) const
gc_vector< int > & monom()
res_pair * new_res_pair()
VALGRIND_MAKE_MEM_DEFINED & result(result)
#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)