1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/src/amd/amd_internal.h Mon Dec 06 13:09:21 2010 +0100
1.3 @@ -0,0 +1,113 @@
1.4 +/* amd_internal.h */
1.5 +
1.6 +/* Written by Andrew Makhorin <mao@gnu.org>. */
1.7 +
1.8 +#ifndef AMD_INTERNAL_H
1.9 +#define AMD_INTERNAL_H
1.10 +
1.11 +/* AMD will be exceedingly slow when running in debug mode. */
1.12 +#if 1
1.13 +#define NDEBUG
1.14 +#endif
1.15 +
1.16 +#include "amd.h"
1.17 +#define _GLPSTD_STDIO
1.18 +#include "glpenv.h"
1.19 +
1.20 +#define Int int
1.21 +#define ID "%d"
1.22 +#define Int_MAX INT_MAX
1.23 +
1.24 +#define SIZE_T_MAX ((size_t)(-1))
1.25 +
1.26 +#define EMPTY (-1)
1.27 +#define FLIP(i) (-(i)-2)
1.28 +#define UNFLIP(i) ((i < EMPTY) ? FLIP (i) : (i))
1.29 +
1.30 +#define MAX(a,b) (((a) > (b)) ? (a) : (b))
1.31 +#define MIN(a,b) (((a) < (b)) ? (a) : (b))
1.32 +
1.33 +#define IMPLIES(p, q) (!(p) || (q))
1.34 +
1.35 +#define GLOBAL
1.36 +
1.37 +#define AMD_order amd_order
1.38 +#define AMD_defaults amd_defaults
1.39 +#define AMD_control amd_control
1.40 +#define AMD_info amd_info
1.41 +#define AMD_1 amd_1
1.42 +#define AMD_2 amd_2
1.43 +#define AMD_valid amd_valid
1.44 +#define AMD_aat amd_aat
1.45 +#define AMD_postorder amd_postorder
1.46 +#define AMD_post_tree amd_post_tree
1.47 +#define AMD_dump amd_dump
1.48 +#define AMD_debug amd_debug
1.49 +#define AMD_debug_init amd_debug_init
1.50 +#define AMD_preprocess amd_preprocess
1.51 +
1.52 +#define amd_malloc xmalloc
1.53 +#if 0 /* 24/V-2009 */
1.54 +#define amd_free xfree
1.55 +#else
1.56 +#define amd_free(ptr) { if ((ptr) != NULL) xfree(ptr); }
1.57 +#endif
1.58 +#define amd_printf xprintf
1.59 +
1.60 +#define PRINTF(params) { amd_printf params; }
1.61 +
1.62 +#ifndef NDEBUG
1.63 +#define ASSERT(expr) xassert(expr)
1.64 +#define AMD_DEBUG0(params) { PRINTF(params); }
1.65 +#define AMD_DEBUG1(params) { if (AMD_debug >= 1) PRINTF(params); }
1.66 +#define AMD_DEBUG2(params) { if (AMD_debug >= 2) PRINTF(params); }
1.67 +#define AMD_DEBUG3(params) { if (AMD_debug >= 3) PRINTF(params); }
1.68 +#define AMD_DEBUG4(params) { if (AMD_debug >= 4) PRINTF(params); }
1.69 +#else
1.70 +#define ASSERT(expression)
1.71 +#define AMD_DEBUG0(params)
1.72 +#define AMD_DEBUG1(params)
1.73 +#define AMD_DEBUG2(params)
1.74 +#define AMD_DEBUG3(params)
1.75 +#define AMD_DEBUG4(params)
1.76 +#endif
1.77 +
1.78 +#define amd_aat _glp_amd_aat
1.79 +size_t AMD_aat(Int n, const Int Ap[], const Int Ai[], Int Len[],
1.80 + Int Tp[], double Info[]);
1.81 +
1.82 +#define amd_1 _glp_amd_1
1.83 +void AMD_1(Int n, const Int Ap[], const Int Ai[], Int P[], Int Pinv[],
1.84 + Int Len[], Int slen, Int S[], double Control[], double Info[]);
1.85 +
1.86 +#define amd_postorder _glp_amd_postorder
1.87 +void AMD_postorder(Int nn, Int Parent[], Int Npiv[], Int Fsize[],
1.88 + Int Order[], Int Child[], Int Sibling[], Int Stack[]);
1.89 +
1.90 +#define amd_post_tree _glp_amd_post_tree
1.91 +#ifndef NDEBUG
1.92 +Int AMD_post_tree(Int root, Int k, Int Child[], const Int Sibling[],
1.93 + Int Order[], Int Stack[], Int nn);
1.94 +#else
1.95 +Int AMD_post_tree(Int root, Int k, Int Child[], const Int Sibling[],
1.96 + Int Order[], Int Stack[]);
1.97 +#endif
1.98 +
1.99 +#define amd_preprocess _glp_amd_preprocess
1.100 +void AMD_preprocess(Int n, const Int Ap[], const Int Ai[], Int Rp[],
1.101 + Int Ri[], Int W[], Int Flag[]);
1.102 +
1.103 +#define amd_debug _glp_amd_debug
1.104 +extern Int AMD_debug;
1.105 +
1.106 +#define amd_debug_init _glp_amd_debug_init
1.107 +void AMD_debug_init(char *s);
1.108 +
1.109 +#define amd_dump _glp_amd_dump
1.110 +void AMD_dump(Int n, Int Pe[], Int Iw[], Int Len[], Int iwlen,
1.111 + Int pfree, Int Nv[], Int Next[], Int Last[], Int Head[],
1.112 + Int Elen[], Int Degree[], Int W[], Int nel);
1.113 +
1.114 +#endif
1.115 +
1.116 +/* eof */