33clock_t * mps_start_timer (
void);
34unsigned long int mps_stop_timer (clock_t * my_timer);
46#define MPS_DEBUG_WITH_INFO(s, templ ...) { \
47 if (s->debug_level & MPS_DEBUG_INFO) { \
48 MPS_DEBUG (s, templ); \
55#define MPS_DEBUG_WITH_IO(s, templ ...) { \
56 if (s->debug_level & MPS_DEBUG_IO) { \
57 MPS_DEBUG (s, templ); \
61#define MPS_DEBUG(s, templ ...) { \
62 __MPS_DEBUG (s, templ); \
64 fprintf (s->logstr, "\n"); \
72#define MPS_DEBUG_MPC(s, digits, c, name ...) { \
73 __MPS_DEBUG_EQ (s, name); \
75 mpc_outln_str (s->logstr, 10, digits, c); \
83#define MPS_DEBUG_MPF(s, digits, c, name ...) { \
84 __MPS_DEBUG_EQ (s, name); \
86 mpf_out_str (s->logstr, 10, digits, c); \
87 fprintf (s->logstr, "\n"); \
91#define MPS_DEBUG_MPC2(s, radius, c, name ...) { \
92 __MPS_DEBUG_EQ (s, name); \
94 int t = -rdpe_log10 (radius) - 1; \
97 mpc_get_cdpe (ctmp, c); \
98 cdpe_mod (mm, ctmp); \
100 mpc_outln_str (s->logstr, 10, t, c); \
108#define MPS_DEBUG_RDPE(s, r, name ...) { \
109 __MPS_DEBUG_EQ (s, name); \
111 rdpe_outln_str (s->logstr, r); \
118#define MPS_DEBUG_CDPE(s, c, name ...) { \
119 __MPS_DEBUG_EQ (s, name); \
121 cdpe_outln_str (s->logstr, c); \
128#define MPS_DEBUG_CPLX(s, c, name ...) { \
129 __MPS_DEBUG_EQ (s, name); \
131 cplx_outln_str (s->logstr, c); \
139#define MPS_DEBUG_BREAK(s) if (s->DOLOG) { \
140 fprintf (s->logstr, "\n"); \
147#define __MPS_DEBUG_EQ(s, templ ...) \
148 __MPS_DEBUG (s, templ); \
150 fprintf (s->logstr, " = "); \
157#define MPS_DEBUG_CALL(s, function) if (s->DOLOG && (s->debug_level & MPS_DEBUG_FUNCTION_CALLS)) { \
158 if (isatty (fileno (s->logstr))) { \
159 __MPS_DEBUG (s, "Called \033[31;1m"); \
162 __MPS_DEBUG (s, "Called "); \
164 if (isatty (fileno (s->logstr))) { \
165 fprintf (s->logstr, function); fprintf (s->logstr, "()\033[0m\n"); \
169 fprintf (s->logstr, function); fprintf (s->logstr, "()\n"); \
173#define MPS_DEBUG_CALL(s, function) if (s->DOLOG && (s->debug_level & MPS_DEBUG_FUNCTION_CALLS)) { \
174 if (_isatty (_fileno (s->logstr))) { \
175 __MPS_DEBUG (s, "Called \033[31;1m"); \
178 __MPS_DEBUG (s, "Called "); \
180 if (_isatty (_fileno (s->logstr))) { \
181 fprintf (s->logstr, function); fprintf (s->logstr, "()\033[0m\n"); \
185 fprintf (s->logstr, function); fprintf (s->logstr, "()\n"); \
190#define MPS_DEBUG_THIS_CALL(ctx) MPS_DEBUG_CALL (ctx, __FUNCTION__)
196#if __STDC_VERSION__ >= 199901L
198#define __MPS_DEBUG(s, templ ...) if (s->DOLOG) { \
199 if (isatty (fileno (s->logstr))) { \
200 fprintf (s->logstr, "%s:%d \033[32;1m%s()\033[;0m ", \
201 __FILE__, __LINE__, __FUNCTION__); \
204 fprintf (s->logstr, "%s:%d %s() ", \
205 __FILE__, __LINE__, __FUNCTION__); \
207 fprintf (s->logstr, templ); \
210#define __MPS_DEBUG(s, templ ...) if (s->DOLOG) { \
211 if (_isatty (_fileno (s->logstr))) { \
212 fprintf (s->logstr, "%s:%d \033[32;1m%s()\033[;0m ", \
213 __FILE__, __LINE__, __FUNCTION__); \
216 fprintf (s->logstr, "%s:%d %s() ", \
217 __FILE__, __LINE__, __FUNCTION__); \
219 fprintf (s->logstr, templ); \
225#define MPS_DEBUG(args ...)
226#define MPS_DEBUG_MPC(args ...)
227#define MPS_DEBUG_CPLX(args ...)
228#define MPS_DEBUG_RDPE(args ...)
229#define MPS_DEBUG_CDPE(args ...)
230#define MPS_DEBUG_CALL(args ...)
231#define MPS_DEBUG_MCLUSTER_ROOTS(args ...)
232#define MPS_DEBUG_THIS_CALL(ctx)
233#define MPS_DEBUG_WITH_INFO(args ...)
234#define MPS_DEBUG_WITH_IO(args ...)
235#define __MPS_DEBUG(args ...)
243#if __STDC_VERSION__ < 199901L
251#define MPS_DEBUG __c_impl__MPS_DEBUG
252#define __MPS_DEBUG __c_impl____MPS_DEBUG
253void __c_impl__MPS_DEBUG (
mps_context * s,
const char *templ, ...);
254void __c_impl____MPS_DEBUG (
mps_context * s,
const char *templ, ...);
262#define MPS_DEBUG_INFO (0x0001 << 0)
268#define MPS_DEBUG_CLUSTER (0x0001 << 1)
274#define MPS_DEBUG_APPROXIMATIONS (0x0001 << 2)
280#define MPS_DEBUG_IMPROVEMENT (0x0001 << 3)
286#define MPS_DEBUG_TIMINGS (0x0001 << 4)
291#define MPS_DEBUG_FUNCTION_CALLS (0x0001 << 5)
296#define MPS_DEBUG_IO (0x0001 << 6)
301#define MPS_DEBUG_MEMORY (0x0001 << 7)
307#define MPS_DEBUG_PACKETS (0x0001 << 8)
312#define MPS_DEBUG_REGENERATION (0x0001 << 9)
319#define MPS_DEBUG_TRACE (0xFFFF)
321#define MPS_DEBUG_IF(s, debug_level, debug_instruction) if (debug_level & s->debug_level) { \
this struct holds the state of the mps computation
Definition: context.h:55