1 /****************************************************************************/ 2 /* elcmp.h */ 3 /****************************************************************************/ 4 /* */ 5 /* type of matrix ELements and vector CoMPonents */ 6 /* */ 7 /* Copyright (C) 1992-1995 Tomas Skalicky. All rights reserved. */ 8 /* */ 9 /****************************************************************************/ 10 /* */ 11 /* ANY USE OF THIS CODE CONSTITUTES ACCEPTANCE OF THE TERMS */ 12 /* OF THE COPYRIGHT NOTICE (SEE FILE COPYRGHT.H) */ 13 /* */ 14 /****************************************************************************/ 15 16 #ifndef ELCMP_H 17 #define ELCMP_H 18 19 #include <float.h> 20 #include <math.h> 21 22 #include "laspack/copyrght.h" 23 24 typedef double Real; 25 26 #ifdef __BORLANDC__ 27 /* BC 2.0 does not handle IEEE arithmetic correctly */ 28 #define IsZero(a) (fabs(a) < 1.0e20 * DBL_MIN) 29 #define IsOne(a) (fabs(a - 1.0) < 10.0 * DBL_EPSILON) 30 #else 31 #define IsZero(a) (fabs(a) < 10.0 * DBL_MIN) 32 #define IsOne(a) (fabs(a - 1.0) < 10.0 * DBL_EPSILON) 33 #endif /* __BORLANDC__ */ 34 35 typedef struct { 36 size_t Pos; 37 Real Val; 38 } ElType; 39 40 #endif /* ELCMP_H */