]> git.mxchange.org Git - flightgear.git/blob - Math/mat3defs.h
Initial revision.
[flightgear.git] / Math / mat3defs.h
1 /* Copyright 1988, Brown Computer Graphics Group.  All Rights Reserved. */
2
3 #include <stdio.h>
4 /* #include <Math/mat3err.h> */
5 #include <Math/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; */