1 /* Copyright 1988, Brown Computer Graphics Group. All Rights Reserved. */
4 /* #include "mat3err.h" */
7 /* ----------------------------- Constants ------------------------------ */
12 #define CNULL ((char *) NULL)
14 /* ------------------------------ Macros -------------------------------- */
16 #define ALLOCN(P,T,N,M) \
17 if ((P = (T *) malloc((unsigned) (N) * sizeof(T))) == NULL) \
18 ERR_ERROR(MAT3_errid, ERR_FATAL, (ERR_ALLOC1, M)); \
21 #define FREE(P) free((char *) (P))
23 #define ABS(A) ((A) > 0 ? (A) : -(A))
24 #define MIN(A,B) ((A) < (B) ? (A) : (B))
25 #define MAX(A,B) ((A) > (B) ? (A) : (B))
27 #define SWAP(A,B,T) (T = A, A = B, B = T)
29 /* Is N within EPS of zero ? */
30 #define IS_ZERO(N,EPS) ((N) < EPS && (N) > -EPS)
32 /* Macros for lu routines */
33 #define LU_PERMUTE(p,i,j) { int LU_T; LU_T = p[i]; p[i] = p[j]; p[j] = LU_T; }
35 /* ------------------------- Internal Entries ---------------------------- */
37 /* ------------------------- Global Variables ---------------------------- */
39 /* extern ERRid *MAT3_errid; */