/[escript]/trunk/esysUtils/src/maths.h
ViewVC logotype

Diff of /trunk/esysUtils/src/maths.h

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1361 by gross, Fri Dec 14 09:26:51 2007 UTC revision 1565 by gross, Thu May 22 10:19:47 2008 UTC
# Line 34  Line 34 
34  #include <math.h>  #include <math.h>
35  #endif  #endif
36    
37    #if (defined __OPENMP)
38    #include <omp.h>
39    #endif
40    
41  #include <float.h>  #include <float.h>
42  #include <stdio.h>  #include <stdio.h>
43  #include <limits.h>  #include <limits.h>
# Line 54  typedef int err_t; Line 58  typedef int err_t;
58    
59  #define INDEX_T_MAX INT_MAX  #define INDEX_T_MAX INT_MAX
60  #define EPSILON DBL_EPSILON  #define EPSILON DBL_EPSILON
61    #define LARGE_POSITIVE_FLOAT DBL_MAX
62    
63  /**************************************************************/  /**************************************************************/
64    
# Line 76  typedef int err_t; Line 81  typedef int err_t;
81  #define MIN3(_arg1_,_arg2_,_arg3_) MIN(_arg1_,MIN(_arg2_,_arg3_))  #define MIN3(_arg1_,_arg2_,_arg3_) MIN(_arg1_,MIN(_arg2_,_arg3_))
82  #define ABS(_arg_) MAX((_arg_),-(_arg_))  #define ABS(_arg_) MAX((_arg_),-(_arg_))
83  #define SIGN(_arg_) ((_arg_)>0 ?  1  : ((_arg_)<0 ? -1 : 0 ))  #define SIGN(_arg_) ((_arg_)>0 ?  1  : ((_arg_)<0 ? -1 : 0 ))
84    #define SWAP(_a0_,_a1_,_type_) { \
85                                    _type_ s; \
86                                    s=(_a0_); \
87                                    _a0_= (_a1_); \
88                                    _a1_=s; \
89                                   }
90  /**************************************************************/  /**************************************************************/
91    
92  /*    memory allocation:                                      */  /*    memory allocation:                                      */
# Line 111  typedef int err_t; Line 122  typedef int err_t;
122    #define MEMREALLOC(_POINTER_,_LENGTH_,_TYPE_) if( (_POINTER_)!=NULL ){ _POINTER_ = (_TYPE_*)realloc((void*)(_POINTER_),((size_t)(_LENGTH_))*sizeof(_TYPE_) );  }else{ _POINTER_ = (_TYPE_*)malloc( ((size_t)(_LENGTH_))*sizeof(_TYPE_) ); }    #define MEMREALLOC(_POINTER_,_LENGTH_,_TYPE_) if( (_POINTER_)!=NULL ){ _POINTER_ = (_TYPE_*)realloc((void*)(_POINTER_),((size_t)(_LENGTH_))*sizeof(_TYPE_) );  }else{ _POINTER_ = (_TYPE_*)malloc( ((size_t)(_LENGTH_))*sizeof(_TYPE_) ); }
123  #endif  #endif
124    
125    #define TMPMEMALLOC_AND_PASOCHECK(_LENGTH_,_TYPE_) ( MEMALLOC(_LENGTH_,_TYPE_);
126    
127  #endif /* #ifndef INC_PASO_COMMON */  #endif /* #ifndef INC_PASO_COMMON */

Legend:
Removed from v.1361  
changed lines
  Added in v.1565

  ViewVC Help
Powered by ViewVC 1.1.26