MPSolve  3.2.1
mt.h
Go to the documentation of this file.
1 /***********************************************************
2 ** More Types library for extended C arithmetic **
3 ** Version 1.1 **
4 ** **
5 ** Written by Giuseppe Fiorentino **
6 ** (fiorent@dm.unipi.it) **
7 ** **
8 ** (C) 1997, Dipartimento di Matematica, FRISCO LTR 21024 **
9 ***********************************************************/
10 
20 #ifndef __MT_H__
21 #define __MT_H__
22 
23 /*
24  * This equality is set at compile time in a way that if the system doesn't have
25  * complex.h support we can supply with our implementation.
26  */
27 #if 1 == 1
28  #ifndef MPS_USE_BUILTIN_COMPLEX
29  #define MPS_USE_BUILTIN_COMPLEX
30  #endif
31 #endif
32 
33 #include <stdio.h>
34 
35 #ifdef __cplusplus
36 extern "C"
37 {
38 #endif
39 
40 /***********************************************************
41 ** cplx_t type **
42 ***********************************************************/
43 
44 #ifdef MPS_USE_BUILTIN_COMPLEX
45 
46 /* ---- definition ---- */
47  typedef struct
48  {
49  double r, i; /* re, im */
50  } __cplx_struct;
51 
52  typedef __cplx_struct cplx_t[1];
53  typedef const __cplx_struct *cplx_cp;
54 
55 /* macros for fields access */
56 
57 #define cplx_Val(X) (*(X))
58 #define cplx_Re(X) ((X)->r)
59 #define cplx_Im(X) ((X)->i)
60 #define cplx_Addr(X) ((__cplx_struct *) (X))
61 #define cplx_Move(X1, X2) (*(X1) = *(X2))
62 
63 /* base constants */
64  extern const cplx_t cplx_zero; /* complex zero (0, 0) */
65  extern const cplx_t cplx_one; /* complex one (1, 0) */
66  extern const cplx_t cplx_i; /* imag. unit (0, 1) */
67 
68 /* built constants */
69  void cplx_d (cplx_t temp_cplx, double r, double i);
70 
71 /* initializers */
72 #define cplx_init(X) cplx_clear(X)
73  void cplx_clear (cplx_t x);
74  void cplx_set (cplx_t rx, const cplx_t x);
75  void cplx_set_d (cplx_t x, double dr, double di);
76  int cplx_set_str (cplx_t x, const char *s);
77 
78  /* check floating point exceptions */
79  int cplx_check_fpe (cplx_t x);
80 
81 /* conversion */
82  void cplx_get_d (double *dr, double *di, const cplx_t x);
83  char *cplx_get_str (char *s, const cplx_t x);
84 
85 /* unary functions */
86  void cplx_neg (cplx_t rx, const cplx_t x);
87  void cplx_con (cplx_t rx, const cplx_t x);
88  double cplx_smod (const cplx_t x);
89  double cplx_mod (const cplx_t x);
90  void cplx_inv (cplx_t rx, const cplx_t x);
91  void cplx_sqr (cplx_t rx, const cplx_t x);
92  void cplx_rot (cplx_t rx, const cplx_t x);
93  void cplx_flip (cplx_t rx, const cplx_t x);
94 
95 /* binary functions */
96  void cplx_add (cplx_t rx, const cplx_t x1, const cplx_t x2);
97  void cplx_sub (cplx_t rx, const cplx_t x1, const cplx_t x2);
98  void cplx_mul (cplx_t rx, const cplx_t x1, const cplx_t x2);
99  void cplx_div (cplx_t rx, const cplx_t x1, const cplx_t x2);
100  void cplx_mul_d (cplx_t rx, const cplx_t x, double d);
101  void cplx_div_d (cplx_t rx, const cplx_t x, double d);
102  void cplx_pow_si (cplx_t rx, const cplx_t x, signed long int i);
103 
104 /* misc */
105  void cplx_swap (cplx_t x1, cplx_t x2);
106 
107 /* op= style operators */
108  void cplx_neg_eq (cplx_t x);
109  void cplx_con_eq (cplx_t x);
110  void cplx_inv_eq (cplx_t x);
111  void cplx_sqr_eq (cplx_t x);
112  void cplx_rot_eq (cplx_t x);
113  void cplx_flip_eq (cplx_t x);
114  void cplx_add_eq (cplx_t rx, const cplx_t x);
115  void cplx_sub_eq (cplx_t rx, const cplx_t x);
116  void cplx_mul_eq (cplx_t rx, const cplx_t x);
117  void cplx_div_eq (cplx_t rx, const cplx_t x);
118  void cplx_mul_eq_d (cplx_t x, double d);
119  void cplx_div_eq_d (cplx_t x, double d);
120  void cplx_pow_eq_si (cplx_t x, signed long int i);
121 
122 /* relational operators */
123  int cplx_eq_zero (const cplx_t x);
124  int cplx_eq (const cplx_t x1, const cplx_t x2);
125  int cplx_ne (const cplx_t x1, const cplx_t x2);
126 
127 /* I/O functions */
128  int cplx_out_str_u (FILE * f, const cplx_t x);
129  int cplx_out_str (FILE * f, const cplx_t x);
130  int cplx_inp_str_u (cplx_t x, FILE * f);
131  int cplx_inp_str (cplx_t x, FILE * f);
132 #define cplx_outln_str_u(F, C) cplx_out_str_u(F, C), fputc('\n', F)
133 #define cplx_outln_str(F, C) cplx_out_str(F, C), fputc('\n', F)
134 #define cplx_out_u(C) cplx_out_str_u(stdout, C)
135 #define cplx_out(C) cplx_out_str(stdout, C)
136 #define cplx_outln_u(C) cplx_out_str_u(stdout, C), putchar('\n')
137 #define cplx_outln(C) cplx_out_str(stdout, C), putchar('\n')
138 #define cplx_inp_u(C) cplx_inp_str_u(C, stdin)
139 #define cplx_inp(C) cplx_inp_str(C, stdin)
140 
141 /* vector functions */
142 #define cplx_valloc(N) (cplx_t *) malloc((N) * sizeof(cplx_t))
143  void cplx_vinit (cplx_t v[], long size);
144 /* #define cplx_vclear(V) free(V) */
145 /* #define cplx_vclear(V, N) cplx_vinit(V, N) */
146 #define cplx_vfree(V) free(V)
147 
148 #else
149 
150  #include <complex.h>
151  typedef _Complex double cplx_t[1];
152 
153 /* macros for fields access */
154 
155 #define cplx_Re(X) (creal(*X))
156 #define cplx_Im(X) (cimag(*X))
157 #define cplx_Addr(X) ((complex double *) X)
158 
159 /* base constants */
160  extern const cplx_t cplx_zero; /* complex zero (0, 0) */
161  extern const cplx_t cplx_one; /* complex one (1, 0) */
162  extern const cplx_t cplx_i; /* imag. unit (0, 1) */
163 
164 /* initializers */
165 #define cplx_set(x,y) (*x = *y)
166 #define cplx_set_d(x,y,z) (*x = y + 1.0I * z)
167 
168  /* check floating point exceptions */
169  int cplx_check_fpe (cplx_t x);
170 
171 /* unary functions */
172 #define cplx_mod(x) (cabs(*x))
173 #define cplx_inv(x,y) (*x = 1 / *y)
174 #define cplx_sqr(x,y) (*x = csqrt(*y))
175 
176 /* binary functions */
177 #define cplx_add(x,y,z) (*x = *y + *z)
178 #define cplx_sub(x,y,z) (*x = *y - *z)
179 #define cplx_mul(x,y,z) (*x = *y * *z)
180 #define cplx_div(x,y,z) (*x = *y / *z)
181 #define cplx_mul_d(x,y,z) (*x = *y * z)
182 #define cplx_div_d(x,y,z) (*x = *y / z)
183 
184 #define cplx_add_eq(x,y) (*x += *y)
185 #define cplx_sub_eq(x,y) (*x -= *y)
186 #define cplx_mul_eq(x,y) (*x *= *y)
187 #define cplx_div_eq(x,y) (*x /= *y)
188 #define cplx_mul_eq_d(x,y) (*x *= y)
189 #define cplx_div_eq_d(x,y) (*x /= y)
190 #define cplx_inv_eq(x) (*x = 1.0 / *x)
191 
192 /* relational operators */
193 #define cplx_eq_zero(x) (*x == 0.0)
194 #define cplx_eq(x,y) (*x == *y)
195 #define cplx_ne(x,y) (*x != *y)
196 
197 /* I/O functions */
198  int cplx_out_str_u (FILE * f, const cplx_t x);
199  int cplx_out_str (FILE * f, const cplx_t x);
200  int cplx_inp_str_u (cplx_t x, FILE * f);
201  int cplx_inp_str (cplx_t x, FILE * f);
202 #define cplx_outln_str_u(F, C) cplx_out_str_u(F, C), fputc('\n', F)
203 #define cplx_outln_str(F, C) cplx_out_str(F, C), fputc('\n', F)
204 #define cplx_out_u(C) cplx_out_str_u(stdout, C)
205 #define cplx_out(C) cplx_out_str(stdout, C)
206 #define cplx_outln_u(C) cplx_out_str_u(stdout, C), putchar('\n')
207 #define cplx_outln(C) cplx_out_str(stdout, C), putchar('\n')
208 #define cplx_inp_u(C) cplx_inp_str_u(C, stdin)
209 #define cplx_inp(C) cplx_inp_str(C, stdin)
210 
211 /* vector functions */
212 #define cplx_valloc(N) (cplx_t *) malloc((N) * sizeof(cplx_t))
213 /* #define cplx_vclear(V) free(V) */
214 /* #define cplx_vclear(V, N) cplx_vinit(V, N) */
215 #define cplx_vfree(V) free(V)
216 
217 #endif
218 
219 
220 /***********************************************************
221 ** rdpe_t type **
222 ***********************************************************/
223 
224 /* ---- definition ---- */
225  typedef struct
226  {
227  double m; /* mantissa */
228  long e; /* exponent */
229  } __rdpe_struct;
230 
231  typedef __rdpe_struct rdpe_t[1];
232  typedef const __rdpe_struct *rdpe_cp;
233 
234  /* macros for fields access */
235 #define rdpe_Val(E) (*E)
236 #define rdpe_Mnt(E) (E -> m)
237 #define rdpe_Esp(E) (E -> e)
238 #define rdpe_Addr(E) ((__rdpe_struct *) E)
239 #define rdpe_Move(E1, E2) (*E1 = *E2)
240 
241  /* base constants */
242  extern const rdpe_t rdpe_zero; /* zero as rdpe num. */
243  extern const rdpe_t rdpe_one; /* one as rdpe num. */
244  extern const rdpe_t rdpe_maxd; /* max double as rdpe */
245  extern const rdpe_t rdpe_mind; /* min pos. double as rdpe */
246  extern const rdpe_t RDPE_MAX; /* max rdpe number */
247  extern const rdpe_t RDPE_MIN; /* min pos. rdpe number */
248  extern const rdpe_t RDPE_BIG;
249 
250  /* built constants */
251  void rdpe_d (rdpe_t temp_rdpe, double d);
252  void rdpe_2dl (rdpe_t temp_rdpe, double d, long l);
253 
254  /* assignment functions */
255 #define rdpe_init(E) rdpe_clear(E)
256  void rdpe_clear (rdpe_t e);
257  void rdpe_set (rdpe_t re, const rdpe_t e);
258  void rdpe_set_d (rdpe_t e, double d);
259  void rdpe_set_dl (rdpe_t e, double d, long int l);
260  void rdpe_set_2dl (rdpe_t e, double d, long int l);
261  int rdpe_set_str (rdpe_t e, const char *s);
262 
263  /* conversion */
264  double rdpe_get_d (const rdpe_t e);
265  void rdpe_get_dl (double *d, long int *l, const rdpe_t e);
266  void rdpe_get_2dl (double *d, long int *l, const rdpe_t e);
267  char *rdpe_get_str (char *s, const rdpe_t e);
268 
269 /* unary functions */
270  void rdpe_neg (rdpe_t re, const rdpe_t e);
271  void rdpe_abs (rdpe_t re, const rdpe_t e);
272  void rdpe_inv (rdpe_t re, const rdpe_t e);
273  void rdpe_sqr (rdpe_t re, const rdpe_t e);
274  void rdpe_sqrt (rdpe_t re, const rdpe_t e);
275  double rdpe_log (const rdpe_t e);
276  double rdpe_log10 (const rdpe_t e);
277  void rdpe_exp (rdpe_t re, const rdpe_t e);
278 
279 /* binary functions */
280  void rdpe_add (rdpe_t re, const rdpe_t e1, const rdpe_t e2);
281  void rdpe_sub (rdpe_t re, const rdpe_t e1, const rdpe_t e2);
282  void rdpe_mul (rdpe_t re, const rdpe_t e1, const rdpe_t e2);
283  void rdpe_div (rdpe_t re, const rdpe_t e1, const rdpe_t e2);
284  void rdpe_add_d (rdpe_t re, const rdpe_t e, double d);
285  void rdpe_sub_d (rdpe_t re, const rdpe_t e, double d);
286  void rdpe_mul_d (rdpe_t re, const rdpe_t e, double d);
287  void rdpe_mul_2exp (rdpe_t re, const rdpe_t e, unsigned long int i);
288  void rdpe_div_d (rdpe_t re, const rdpe_t e, double d);
289  void rdpe_div_2exp (rdpe_t re, const rdpe_t e, unsigned long int i);
290  void rdpe_pow_d (rdpe_t re, const rdpe_t e, double d);
291  void rdpe_pow_si (rdpe_t re, const rdpe_t e, signed long int i);
292 
293 /* misc */
294  void rdpe_fac_ui (rdpe_t e, unsigned long int n);
295  void rdpe_swap (rdpe_t e1, rdpe_t e2);
296 
297 /* op= style operators */
298  void rdpe_neg_eq (rdpe_t e);
299  void rdpe_abs_eq (rdpe_t e);
300  void rdpe_inv_eq (rdpe_t e);
301  void rdpe_sqr_eq (rdpe_t e);
302  void rdpe_sqrt_eq (rdpe_t e);
303  void rdpe_exp_eq (rdpe_t e);
304  void rdpe_add_eq (rdpe_t re, const rdpe_t e);
305  void rdpe_sub_eq (rdpe_t re, const rdpe_t e);
306  void rdpe_mul_eq (rdpe_t re, const rdpe_t e);
307  void rdpe_div_eq (rdpe_t re, const rdpe_t e);
308  void rdpe_add_eq_d (rdpe_t e, double d);
309  void rdpe_sub_eq_d (rdpe_t e, double d);
310  void rdpe_mul_eq_d (rdpe_t e, double d);
311  void rdpe_mul_eq_2exp (rdpe_t e, unsigned long int i);
312  void rdpe_div_eq_d (rdpe_t e, double d);
313  void rdpe_div_eq_2exp (rdpe_t e, unsigned long int i);
314  void rdpe_pow_eq_d (rdpe_t e, double d);
315  void rdpe_pow_eq_si (rdpe_t e, signed long int i);
316 
317 /* relational ops */
318  int rdpe_cmp (const rdpe_t e1, const rdpe_t e2);
319  int rdpe_sgn (const rdpe_t e);
320  int rdpe_eq_zero (const rdpe_t e);
321  int rdpe_eq (const rdpe_t e1, const rdpe_t e2);
322  int rdpe_ne (const rdpe_t e1, const rdpe_t e2);
323  int rdpe_lt (const rdpe_t e1, const rdpe_t e2);
324  int rdpe_le (const rdpe_t e1, const rdpe_t e2);
325  int rdpe_gt (const rdpe_t e1, const rdpe_t e2);
326  int rdpe_ge (const rdpe_t e1, const rdpe_t e2);
327 
328 /* I/O functions */
329  int rdpe_out_str_u (FILE * f, const rdpe_t e);
330  int rdpe_out_str (FILE * f, const rdpe_t e);
331  int rdpe_inp_str_u (rdpe_t e, FILE * f);
332  int rdpe_inp_str (rdpe_t e, FILE * f);
333  int rdpe_inp_str_flex (rdpe_t e, FILE * f);
334 #define rdpe_outln_str_u(F, E) rdpe_out_str_u(F, E); fputc('\n', F)
335 #define rdpe_outln_str(F, E) rdpe_out_str(F, E); fputc('\n', F)
336 #define rdpe_out_u(E) rdpe_out_str_u(stdout, E)
337 #define rdpe_out(E) rdpe_out_str(stdout, E)
338 #define rdpe_outln_u(E) rdpe_out_str_u(stdout, E); putchar('\n')
339 #define rdpe_outln(E) rdpe_out_str(stdout, E); putchar('\n')
340 #define rdpe_inp_u(E) rdpe_inp_str_u(e, stdin)
341 #define rdpe_inp(E) rdpe_inp_str(e, stdin)
342 
343 /* vector functions */
344 #define rdpe_valloc(N) (rdpe_t *) malloc((N) * sizeof(rdpe_t))
345  void rdpe_vinit (rdpe_t v[], long size);
346 /* #define rdpe_vclear(V) free(V) */
347 /* #define rdpe_vclear(V, N) rdpe_vinit(V, N) */
348 #define rdpe_vfree(V) free(V)
349 
350 /***********************************************************
351 ** gdpe_t functions **
352 ***********************************************************/
353 typedef struct
354 {
355  rdpe_t r;
356  rdpe_t eps;
357  rdpe_t rel_eps;
358 } __gdpe_struct;
359 
360  typedef __gdpe_struct gdpe_t[1];
361 
362 #define gdpe_Eps(g) ((g)->eps)
363 #define gdpe_Rel(g) ((g)->rel_eps)
364 #define gdpe_Val(g) ((g)->r)
365 #define gdpe_update_rel_from_abs(g) (rdpe_div (gdpe_Rel (g), gdpe_Eps (g), gdpe_Val (g)))
366 #define gdpe_update_abs_from_rel(g) (rdpe_mul (gdpe_Eps (g), gdpe_Rel (g), gdpe_Val (g)))
367 
368  /* Tests */
369 #define gdpe_eq_zero(g) (rdpe_eq_zero (gdpe_Val (g)))
370 
371 #define gdpe_add_eq (g, g2) (gdpe_add ((g), (g), (g2)))
372 #define gdpe_sub_eq (g, g2) (gdpe_sub ((g), (g), (g2)))
373 #define gdpe_mul_eq (g, g2) (gdpe_mul ((g), (g), (g2)))
374 #define gdpe_div_eq (g, g2) (gdpe_div ((g), (g), (g2)))
375 
376  /* Binary functions */
377  void gdpe_add (gdpe_t res, gdpe_t g1, gdpe_t g2);
378  void gdpe_sub (gdpe_t res, gdpe_t g1, gdpe_t g2);
379  void gdpe_mul (gdpe_t res, gdpe_t g1, gdpe_t g2);
380  void gdpe_div (gdpe_t res, gdpe_t g1, gdpe_t g2);
381 
382 
383 
384 /***********************************************************
385 ** cdpe_t functions **
386 ***********************************************************/
387 
388 /* ---- definition ---- */
389  typedef struct
390  {
391  rdpe_t r, i; /* re, im */
392  } __cdpe_struct;
393 
394  typedef __cdpe_struct cdpe_t[1];
395  typedef const __cdpe_struct *cdpe_cp;
396 
397 /* macros for fields access */
398 
399 #define cdpe_Val(C) (*C)
400 #define cdpe_Re(C) (C -> r)
401 #define cdpe_Im(C) (C -> i)
402 #define cdpe_Addr(C) ((__cdpe_struct *) C)
403 #define cdpe_Move(C1, C2) (*C1 = *C2)
404 
405 /* base constants */
406  extern const cdpe_t cdpe_zero; /* cdpe zero (0, 0) */
407  extern const cdpe_t cdpe_one; /* cdpe one (1, 0) */
408  extern const cdpe_t cdpe_i; /* cdpe I (0, 1) */
409 
410 /* built constants */
411  void cdpe_d (cdpe_t temp_cdpe, double r, double i);
412  void cdpe_x (cdpe_t temp_cdpe, const cplx_t x);
413  void cdpe_e (cdpe_t temp_cdpe, const rdpe_t er, const rdpe_t ei);
414  void cdpe_2dl (cdpe_t temp_cdpe, double dr, long lr, double di, long li);
415 
416 /* initializers */
417 #define cdpe_init(C) cdpe_clear(C)
418  void cdpe_clear (cdpe_t c);
419  void cdpe_set (cdpe_t rc, const cdpe_t c);
420  void cdpe_set_e (cdpe_t c, const rdpe_t er, const rdpe_t ei);
421  void cdpe_set_x (cdpe_t c, const cplx_t x);
422  void cdpe_set_d (cdpe_t c, double dr, double di);
423  void cdpe_set_dl (cdpe_t c, double dr, long int lr, double di, long int li);
424  void cdpe_set_2dl (cdpe_t c, double dr, long int lr,
425  double di, long int li);
426  int cdpe_set_str (cdpe_t c, const char *s);
427 
428 /* conversion */
429  void cdpe_get_e (rdpe_t er, rdpe_t ei, const cdpe_t c);
430  void cdpe_get_x (cplx_t x, const cdpe_t c);
431  void cdpe_get_d (double *dr, double *di, const cdpe_t c);
432  char *cdpe_get_str (char *s, const cdpe_t c);
433 
434 /* unary functions */
435  void cdpe_neg (cdpe_t rc, const cdpe_t c);
436  void cdpe_con (cdpe_t rc, const cdpe_t c);
437  void cdpe_smod (rdpe_t e, const cdpe_t c);
438  void cdpe_mod (rdpe_t e, const cdpe_t c);
439  void cdpe_inv (cdpe_t rc, const cdpe_t c);
440  void cdpe_sqr (cdpe_t rc, const cdpe_t c);
441  void cdpe_rot (cdpe_t rc, const cdpe_t c);
442  void cdpe_flip (cdpe_t rc, const cdpe_t c);
443 
444 /* binary functions */
445  void cdpe_add (cdpe_t rc, const cdpe_t c1, const cdpe_t c2);
446  void cdpe_sub (cdpe_t rc, const cdpe_t c1, const cdpe_t c2);
447  void cdpe_mul (cdpe_t rc, const cdpe_t c1, const cdpe_t c2);
448  void cdpe_div (cdpe_t rc, const cdpe_t c1, const cdpe_t c2);
449  void cdpe_mul_e (cdpe_t rc, const cdpe_t c, const rdpe_t e);
450  void cdpe_mul_x (cdpe_t rc, const cdpe_t c, const cplx_t x);
451  void cdpe_mul_d (cdpe_t rc, const cdpe_t c, double d);
452  void cdpe_mul_2exp (cdpe_t rc, const cdpe_t c, unsigned long int i);
453  void cdpe_div_e (cdpe_t rc, const cdpe_t c, const rdpe_t e);
454  void cdpe_div_d (cdpe_t rc, const cdpe_t c, double d);
455  void cdpe_div_2exp (cdpe_t rc, const cdpe_t c, unsigned long int i);
456 
457 /* misc */
458  void cdpe_pow_si (cdpe_t rc, const cdpe_t c, signed long int i);
459 
460 /* op= style operators */
461  void cdpe_neg_eq (cdpe_t c);
462  void cdpe_con_eq (cdpe_t c);
463  void cdpe_inv_eq (cdpe_t c);
464  void cdpe_sqr_eq (cdpe_t c);
465  void cdpe_rot_eq (cdpe_t c);
466  void cdpe_flip_eq (cdpe_t c);
467  void cdpe_add_eq (cdpe_t rc, const cdpe_t c);
468  void cdpe_sub_eq (cdpe_t rc, const cdpe_t c);
469  void cdpe_mul_eq (cdpe_t rc, const cdpe_t c);
470  void cdpe_div_eq (cdpe_t rc, const cdpe_t c);
471  void cdpe_mul_eq_e (cdpe_t c, const rdpe_t e);
472  void cdpe_mul_eq_x (cdpe_t c, const cplx_t x);
473  void cdpe_mul_eq_d (cdpe_t c, double d);
474  void cdpe_mul_eq_2exp (cdpe_t c, unsigned long int i);
475  void cdpe_div_eq_e (cdpe_t c, const rdpe_t e);
476  void cdpe_div_eq_d (cdpe_t c, double d);
477  void cdpe_div_eq_2exp (cdpe_t c, unsigned long int i);
478  void cdpe_pow_eq_si (cdpe_t c, signed long int i);
479  void cdpe_swap (cdpe_t c1, cdpe_t c2);
480 
481 /* relational ops */
482  int cdpe_eq_zero (const cdpe_t c);
483  int cdpe_eq (const cdpe_t c1, const cdpe_t c2);
484  int cdpe_ne (const cdpe_t c1, const cdpe_t c2);
485 
486 /* I/O functions */
487  int cdpe_out_str_u (FILE * f, const cdpe_t c);
488  int cdpe_out_str (FILE * f, const cdpe_t c);
489  int cdpe_inp_str_u (cdpe_t c, FILE * f);
490  int cdpe_inp_str (cdpe_t c, FILE * f);
491 #define cdpe_outln_str_u(F, C) cdpe_out_str_u(F, C); fputc('\n', F)
492 #define cdpe_outln_str(F, C) cdpe_out_str(F, C); fputc('\n', F)
493 #define cdpe_out_u(C) cdpe_out_str_u(stdout, C)
494 #define cdpe_out(C) cdpe_out_str(stdout, C)
495 #define cdpe_outln_u(C) cdpe_out_str_u(stdout, C); putchar('\n')
496 #define cdpe_outln(C) cdpe_out_str(stdout, C); putchar('\n')
497 #define cdpe_inp_u(C) cdpe_inp_str_u(C, stdin)
498 #define cdpe_inp(C) cdpe_inp_str(C, stdin)
499 
500 /* vector functions */
501 #define cdpe_valloc(N) (cdpe_t *) malloc((N) * sizeof(cdpe_t))
502  void cdpe_vinit (cdpe_t v[], long size);
503 /* #define cdpe_vclear(V) free(C) */
504 /* #define cdpe_vclear(V, N) cdpe_vinit(V, N) */
505 #define cdpe_vfree(V) free(V)
506 
507 /*
508  * End of extern "C" {
509  * ...
510  * }
511  */
512 #ifdef __cplusplus
513 }
514 #endif
515 
516 #endif
517 
518 /***********************************************************
519 ** **
520 ***********************************************************/
__rdpe_struct
Definition: mt.h:226
__cdpe_struct
Definition: mt.h:390
__gdpe_struct
Definition: mt.h:354
__cplx_struct
Definition: mt.h:48