home *** CD-ROM | disk | FTP | other *** search
/ Graphics Plus / Graphics Plus.iso / libs / sphigs / sph_dos.lha / dos / sphsrc.v08 / mat3defs.h < prev    next >
Encoding:
C/C++ Source or Header  |  1991-11-26  |  1.1 KB  |  40 lines

  1. /* Copyright 1988, Brown Computer Graphics Group.  All Rights Reserved. */
  2.  
  3. #include <stdio.h>
  4. #include "mat3err.h"
  5. #include "mat3.h"
  6.  
  7. /* -----------------------------  Constants  ------------------------------ */
  8.  
  9. #define FALSE        0
  10. #define TRUE        1
  11.  
  12. #define CNULL ((char *) NULL)
  13.  
  14. /* ------------------------------  Macros  -------------------------------- */
  15.  
  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)); \
  19.    else
  20.  
  21. #define FREE(P)    free((char *) (P))
  22.  
  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))
  26.  
  27. #define SWAP(A,B,T)    (T = A, A = B, B = T)
  28.  
  29. /* Is N within EPS of zero ? */
  30. #define IS_ZERO(N,EPS)    ((N) < EPS && (N) > -EPS)
  31.  
  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; }
  34.  
  35. /* -------------------------  Internal Entries ---------------------------- */
  36.  
  37. /* -------------------------  Global Variables ---------------------------- */
  38.  
  39. extern ERRid    *MAT3_errid;
  40.