File: debug.cpp

package info (click to toggle)
macaulay2 1.21%2Bds-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 133,096 kB
  • sloc: cpp: 110,377; ansic: 16,306; javascript: 4,193; makefile: 3,821; sh: 3,580; lisp: 764; yacc: 590; xml: 177; python: 140; perl: 114; lex: 65; awk: 3
file content (141 lines) | stat: -rw-r--r-- 2,116 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
#include "debug.hpp"
#include "text-io.hpp"
#include "matrix.hpp"
#include "relem.hpp"
#include "gbring.hpp"
#include "res-a1-poly.hpp"
#include "res-a0-poly.hpp"
#include "hermite.hpp"
#include "mat.hpp"
#include "monideal.hpp"

void showint(mpz_srcptr a)
{
  char s[1000];
  mpz_get_str(s, 10, a);
  fprintf(stderr, " %s ", s);
}

void dintarray(M2_arrayint a)
{
  buffer o;
  o << "[";
  for (int i = 0; i < a->len; i++)
    {
      if (i > 0) o << ", ";
      o << a->array[i];
    }
  o << "]";
  emit(o.str());
}

void dmatrix(const Matrix *M)
{
  buffer o;
  M->text_out(o);
  emit(o.str());
}

void drelem(const RingElement *f)
{
  buffer o;
  f->text_out(o);
  emit(o.str());
}

void dfree(const FreeModule *F)
{
  buffer o;
  F->text_out(o);
  emit(o.str());
}

void dringelem(const Ring *R, const ring_elem f)
{
  buffer o;
  R->elem_text_out(o, f);
  emit(o.str());
}

void dNterm(const Ring *R, const Nterm *f)
{
  buffer o;
  ring_elem g = const_cast<Nterm *>(f);
  R->elem_text_out(o, g);
  emit(o.str());
}

void dvec(const Ring *R, const vec v)
{
  buffer o;
  R->vec_text_out(o, v);
  emit_line(o.str());
}

void dgbvec(const GBRing *R, gbvector *v)
{
  buffer o;
  const FreeModule *F = 0;
  R->gbvector_text_out(o, F, v);
  emit(o.str());
}

void drespoly(const res_poly *R, const resterm *f)
{
  buffer o;
  R->elem_text_out(o, f);
  emit(o.str());
}

void drespoly2(const res2_poly *R, const res2term *f)
{
  buffer o;
  R->elem_text_out(o, f);
  emit(o.str());
}

void dhermite(HermiteComputation *G)
{
  buffer o;
  G->text_out(o);
  emit(o.str());
}

void dmutablemat(MutableMatrix *m)
{
  buffer o;
  m->text_out(o);
  emit(o.str());
}

void dmonideal(MonomialIdeal *m)
{
  buffer o;
  m->text_out(o);
  emit(o.str());
}

void dstash()
{
  buffer o;
  stash::stats(o);
  emit(o.str());
}

void dRRR(gmp_RR a)
{
  buffer o;
  o << M2_tocharstar((*gmp_tostringRRpointer)(a)) << newline;
  emit(o.str());
}

void pring(const Ring *R)
{
  buffer o;
  R->text_out(o);
  emit(o.str());
}
// Local Variables:
// compile-command: "make -C $M2BUILDDIR/Macaulay2/e "
// indent-tabs-mode: nil
// End: