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

◆ do_node()

void MonomialIdeal::do_node ( Nmi_node * p,
int indent,
int disp ) const
private

Definition at line 465 of file monideal.cpp.

466{
467 buffer o;
468 int i;
469 assert(p->left != nullptr);
470 assert(p->right != nullptr);
471 assert(p->left->right == p);
472 assert(p->right->left == p);
473 if (disp)
474 {
475 for (i = 1; i <= indent; i++) o << ' ';
476 o << p->var << ' ' << p->exp;
477 }
478 if (p->tag == Nmi_node::leaf)
479 {
480 nleaves++;
481 if (disp) o << ' ';
482 varpower::elem_text_out(o, p->baggage()->monom().data());
483 o << '(';
484 o << p->baggage()->basis_elem();
485 o << ')';
486 }
487 else if (p == p->header)
488 nlists++;
489 else
490 nnodes++;
491 emit_line(o.str());
492}
static void elem_text_out(buffer &o, ConstExponents m, bool p_one=true)
char * str()
Definition buffer.hpp:72
static int nnodes
static int nleaves
static int nlists
int p
void emit_line(const char *s)
Definition text-io.cpp:47

References ExponentList< int, true >::elem_text_out(), emit_line(), Nmi_node::leaf, nleaves, nlists, nnodes, p, and buffer::str().

Referenced by do_tree().