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

◆ betti_display()

void BettiDisplay::betti_display ( buffer & o,
M2_arrayint ar )
staticprivate

Definition at line 147 of file betti.cpp.

148{
149 int* a = ar->array;
150 int total_sum = 0;
151 int lo = a[0];
152 int hi = a[1];
153 int len = a[2] + 1;
154 o << "total ";
155 for (int lev = 0; lev < len; lev++)
156 {
157 int sum = 0;
158 for (int d = lo; d <= hi; d++) sum += a[len * (d - lo) + lev + 3];
159 total_sum += sum;
160 o.put(sum, 6);
161 o << ' ';
162 }
163 o << " [" << total_sum << "]" << newline;
164 for (int d = lo; d <= hi; d++)
165 {
166 o.put(d, 5);
167 o << ": ";
168 for (int lev = 0; lev < len; lev++)
169 {
170 int c = a[len * (d - lo) + lev + 3];
171 if (c != 0)
172 o.put(c, 6);
173 else
174 o << " -";
175 o << " ";
176 }
177 o << newline;
178 }
179}
void put(const char *s)
Definition buffer.cpp:35
char newline[]
Definition m2-types.cpp:49
const mpreal sum(const mpreal tab[], const unsigned long int n, int &status, mp_rnd_t mode=mpreal::get_default_rnd())
Definition mpreal.h:2600

References newline, and buffer::put().

Referenced by displayBetti().