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

◆ append_to_stream()

std::ostream & DPoly::append_to_stream ( std::ostream & o,
int level,
const TowerPolynomial f )
static

Definition at line 389 of file dpoly.cpp.

390{
391 if (f == nullptr)
392 o << "0";
393 else if (level == 0)
394 {
395 long *p = f->arr.ints;
396 o << "[";
397 for (int i = 0; i <= f->deg; i++)
398 {
399 if (i > 0) o << ",";
400 if (p[i] != 0) o << p[i];
401 }
402 o << "]";
403 }
404 else
405 {
406 TowerPolynomial *p = f->arr.polys;
407 o << "[";
408 for (int i = 0; i <= f->deg; i++)
409 {
410 if (i > 0) o << ",";
411 if (p[i] != nullptr) append_to_stream(o, level - 1, p[i]);
412 }
413 o << "]";
414 }
415 return o;
416}
static std::ostream & append_to_stream(std::ostream &o, int level, const TowerPolynomial f)
Definition dpoly.cpp:389
int p

References append_to_stream(), and p.

Referenced by append_to_stream(), and to_string().