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

◆ do_auto_reductions()

void res2_comp::do_auto_reductions ( res2_pair * p,
auto_reduce_node * au )
private

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

1623{
1624 buffer o;
1625 while (au != nullptr)
1626 {
1627 auto_reduce_node *a = au;
1628 au = au->next;
1629 o << "auto reduction: " << newline << " ";
1630 R->elem_text_out(p->syz);
1631 o << newline << " ";
1632 R->elem_text_out(a->p->syz);
1633 o << newline << " by coeff = ";
1634 K->elem_text_out(o, a->pivot->coeff);
1635 ring_elem c = K->negate(a->pivot->coeff);
1636 res2term *h = R->mult_by_coefficient(p->syz, c);
1637 K->remove(c);
1638 R->add_to(a->p->syz, h);
1639 o << newline << " result = ";
1640 R->elem_text_out(a->p->syz);
1641 o << newline;
1642 freemem(a);
1643 }
1644 emit(o.str());
1645}
char * str()
Definition buffer.hpp:72
res2_poly * R
Definition res-a0.hpp:123
const Ring * K
Definition res-a0.hpp:125
int p
void freemem(void *s)
Definition m2-mem.cpp:103
char newline[]
Definition m2-types.cpp:49
res2term * pivot
Definition res-a0.hpp:92
auto_reduce_node * next
Definition res-a0.hpp:91
res2_pair * p
Definition res-a0.hpp:93
res2term * syz
ring_elem coeff
void emit(const char *s)
Definition text-io.cpp:41

References res2term::coeff, emit(), freemem(), K, newline, auto_reduce_node::next, auto_reduce_node::p, p, auto_reduce_node::pivot, R, buffer::str(), and res2_pair::syz.

Referenced by handle_pair().