Macaulay2 Engine
Loading...
Searching...
No Matches

◆ handle_pair()

void res2_comp::handle_pair ( res2_pair * p)
private

Definition at line 1647 of file res-a0.cpp.

1648{
1649 nleft--;
1650 resn[p->level]->nleft--;
1651
1652 // For level 1: any non-marked GB elements in this degree are
1653 // minimal generators, so we need to mark them as such
1654 if (p->level == 1)
1655 {
1656 p->syz_type = SYZ2_MINIMAL;
1657 if (M2_gbTrace >= 2) emit_wrapped("z");
1658 if (projdim == 0) projdim = 1;
1659 nminimal++;
1660 return;
1661 }
1662
1663 res2term *f = s_pair(p->syz);
1664 res2_pair *q;
1665
1666 // This is used only for full auto reduction type 2.
1667 auto_reduce_node *au = reinterpret_cast<auto_reduce_node *>(p->pivot_term);
1668
1669 if (use_respolyHeaps)
1670 q = reduce3(f, p->syz, p->pivot_term, p);
1671 else if (auto_reduce >= 1)
1672 q = reduce2(f, p->syz, p->pivot_term, p);
1673 else
1674 q = reduce(f, p->syz, p->pivot_term, p);
1675
1676 // Auto reduction: here is where we 'modify' the
1677 // other elements by 'p'.
1678 if (auto_reduce == 2)
1679 {
1680 do_auto_reductions(p, au);
1681 }
1682 else if (auto_reduce == 3)
1683 {
1684 }
1685
1686 if (f == nullptr)
1687 {
1688 // minimal syzygy
1689 if (p->level == length_limit + 1)
1690 {
1691 p->syz_type = SYZ2_MAYBE_MINIMAL;
1692 }
1693 else
1694 {
1695 p->syz_type = SYZ2_MINIMAL;
1696 nminimal++;
1697 if (p->level > projdim) projdim = p->level;
1698 }
1699 if (M2_gbTrace >= 2) emit_wrapped("z");
1700 }
1701 else
1702 {
1703 R->make_monic(f);
1704 p->syz_type = SYZ2_NOT_MINIMAL;
1705
1706 // non-minimal syzygy
1707 R->remove(q->syz);
1708 q->syz = f;
1710
1711 // Auto reduction: here is where we modify the
1712 // other elements by 'q'.
1713 if (auto_reduce == 2)
1714 {
1716 q, reinterpret_cast<auto_reduce_node *>(q->pivot_term));
1717 q->pivot_term = nullptr;
1718 }
1719 else if (auto_reduce == 3)
1720 {
1721 }
1722
1723 if (M2_gbTrace >= 2) emit_wrapped("m");
1724 }
1725}
res2_pair * reduce(res2term *&f, res2term *&fsyz, res2term *&pivot, res2_pair *p)
Definition res-a0.cpp:1126
int projdim
Definition res-a0.hpp:155
res2_poly * R
Definition res-a0.hpp:123
int auto_reduce
Definition res-a0.hpp:178
res2term * s_pair(res2term *fsyz) const
Definition res-a0.cpp:1110
int length_limit
Definition res-a0.hpp:147
int nminimal
Definition res-a0.hpp:183
res2_pair * reduce3(res2term *&f, res2term *&fsyz, res2term *&pivot, res2_pair *p)
Definition res-a0.cpp:1308
void do_auto_reductions(res2_pair *p, auto_reduce_node *au)
Definition res-a0.cpp:1621
unsigned char use_respolyHeaps
Definition res-a0.hpp:177
int nleft
Definition res-a0.hpp:181
res2_pair * reduce2(res2term *&f, res2term *&fsyz, res2term *&pivot, res2_pair *p)
Definition res-a0.cpp:1200
int p
int M2_gbTrace
Definition m2-types.cpp:52
@ SYZ2_MAYBE_MINIMAL
@ SYZ2_NOT_NEEDED
@ SYZ2_NOT_MINIMAL
@ SYZ2_MINIMAL
res2term * syz
res2term * pivot_term
unsigned char syz_type
void emit_wrapped(const char *s)
Definition text-io.cpp:27

References auto_reduce, do_auto_reductions(), emit_wrapped(), length_limit, M2_gbTrace, nleft, nminimal, p, res2_pair::pivot_term, projdim, R, reduce(), reduce2(), reduce3(), s_pair(), res2_pair::syz, SYZ2_MAYBE_MINIMAL, SYZ2_MINIMAL, SYZ2_NOT_MINIMAL, SYZ2_NOT_NEEDED, res2_pair::syz_type, and use_respolyHeaps.

Referenced by do_pairs().