1 /* Copyright 1988, Brown Computer Graphics Group. All Rights Reserved. */
13 /* #include <Math/mat3err.h> */
14 #include <Math/mat3.h>
16 /* ----------------------------- Constants ------------------------------ */
21 #define CNULL ((char *) NULL)
23 /* ------------------------------ Macros -------------------------------- */
25 #define ALLOCN(P,T,N,M) \
26 if ((P = (T *) malloc((unsigned) (N) * sizeof(T))) == NULL) \
27 ERR_ERROR(MAT3_errid, ERR_FATAL, (ERR_ALLOC1, M)); \
30 #define FREE(P) free((char *) (P))
32 #define ABS(A) ((A) > 0 ? (A) : -(A))
33 #define MIN(A,B) ((A) < (B) ? (A) : (B))
34 #define MAX(A,B) ((A) > (B) ? (A) : (B))
36 #define SWAP(A,B,T) (T = A, A = B, B = T)
38 /* Is N within EPS of zero ? */
39 #define IS_ZERO(N,EPS) ((N) < EPS && (N) > -EPS)
41 /* Macros for lu routines */
42 #define LU_PERMUTE(p,i,j) { int LU_T; LU_T = p[i]; p[i] = p[j]; p[j] = LU_T; }
44 /* ------------------------- Internal Entries ---------------------------- */
46 /* ------------------------- Global Variables ---------------------------- */
48 /* extern ERRid *MAT3_errid; */
56 #endif /* _MAT3DEFS_H */