]> git.mxchange.org Git - flightgear.git/blob - Lib/Math/mat3defs.h
Merge FG_Lib as subdirectory
[flightgear.git] / Lib / Math / mat3defs.h
1 /* Copyright 1988, Brown Computer Graphics Group.  All Rights Reserved. */
2
3
4 #ifndef _MAT3DEFS_H
5 #define _MAT3DEFS_H
6
7
8 #ifdef __cplusplus                                                          
9 extern "C" {                            
10 #endif                                   
11
12 #include <stdio.h>
13 /* #include <Math/mat3err.h> */
14 #include <Math/mat3.h>
15
16 /* -----------------------------  Constants  ------------------------------ */
17
18 #define FALSE           0
19 #define TRUE            1
20
21 #define CNULL ((char *) NULL)
22
23 /* ------------------------------  Macros  -------------------------------- */
24
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)); \
28    else
29
30 #define FREE(P)    free((char *) (P))
31
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))
35
36 #define SWAP(A,B,T)     (T = A, A = B, B = T)
37
38 /* Is N within EPS of zero ? */
39 #define IS_ZERO(N,EPS)  ((N) < EPS && (N) > -EPS)
40
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; }
43
44 /* -------------------------  Internal Entries ---------------------------- */
45
46 /* -------------------------  Global Variables ---------------------------- */
47
48 /* extern ERRid *MAT3_errid; */
49
50
51 #ifdef __cplusplus
52 }
53 #endif
54
55
56 #endif /* _MAT3DEFS_H */