Go to the documentation of this file.
   16 #define gk_max(a, b) ((a) >= (b) ? (a) : (b)) 
   17 #define gk_min(a, b) ((a) >= (b) ? (b) : (a)) 
   18 #define gk_max3(a, b, c) ((a) >= (b) && (a) >= (c) ? (a) : ((b) >= (a) && (b) >= (c) ? (b) : (c))) 
   19 #define gk_SWAP(a, b, tmp) do {(tmp) = (a); (a) = (b); (b) = (tmp);} while(0)  
   20 #define INC_DEC(a, b, val) do {(a) += (val); (b) -= (val);} while(0) 
   21 #define sign(a, b) ((a >= 0 ? b : -b)) 
   23 #define ONEOVERRANDMAX (1.0/(RAND_MAX+1.0)) 
   24 #define RandomInRange(u) ((int) (ONEOVERRANDMAX*(u)*rand())) 
   26 #define gk_abs(x) ((x) >= 0 ? (x) : -(x)) 
   32 #define gk_clearcputimer(tmr) (tmr = 0.0) 
   33 #define gk_startcputimer(tmr) (tmr -= gk_CPUSeconds()) 
   34 #define gk_stopcputimer(tmr)  (tmr += gk_CPUSeconds()) 
   35 #define gk_getcputimer(tmr)   (tmr) 
   37 #define gk_clearwctimer(tmr) (tmr = 0.0) 
   38 #define gk_startwctimer(tmr) (tmr -= gk_WClockSeconds()) 
   39 #define gk_stopwctimer(tmr)  (tmr += gk_WClockSeconds()) 
   40 #define gk_getwctimer(tmr)   (tmr) 
   45 #define IFSET(a, flag, cmd) if ((a)&(flag)) (cmd); 
   51 #define GKSETJMP() (setjmp(gk_return_to_entry)) 
   52 #define gk_sigcatch() (setjmp(gk_jbufs[gk_cur_jbufs])) 
   59 #   define MALLOC_CHECK(ptr)                                          \ 
   60     if (malloc_verify((ptr)) == DMALLOC_VERIFY_ERROR) {  \ 
   61         printf("***MALLOC_CHECK failed on line %d of file %s: " #ptr "\n", \ 
   62               __LINE__, __FILE__);                               \ 
   66 #   define MALLOC_CHECK(ptr) ; 
   73 #define MAKECSR(i, n, a) \ 
   75      for (i=1; i<n; i++) a[i] += a[i-1]; \ 
   76      for (i=n; i>0; i--) a[i] = a[i-1]; \ 
   80 #define SHIFTCSR(i, n, a) \ 
   82      for (i=n; i>0; i--) a[i] = a[i-1]; \ 
   90 #define GKASSERT(expr)                                          \ 
   92         printf("***ASSERTION failed on line %d of file %s: " #expr "\n", \ 
   93               __LINE__, __FILE__);                               \ 
   97 #define GKASSERTP(expr,msg)                                          \ 
   99         printf("***ASSERTION failed on line %d of file %s: " #expr "\n", \ 
  100               __LINE__, __FILE__);                               \ 
  106 #define GKCUASSERT(expr)                                          \ 
  108         printf("***ASSERTION failed on line %d of file %s: " #expr "\n", \ 
  109               __LINE__, __FILE__);                               \ 
  112 #define GKCUASSERTP(expr,msg)                                          \ 
  114         printf("***ASSERTION failed on line %d of file %s: " #expr "\n", \ 
  115               __LINE__, __FILE__);                               \ 
  124 #   define ASSERT(expr)                                          \ 
  126         printf("***ASSERTION failed on line %d of file %s: " #expr "\n", \ 
  127               __LINE__, __FILE__);                               \ 
  131 #   define ASSERTP(expr,msg)                                          \ 
  133         printf("***ASSERTION failed on line %d of file %s: " #expr "\n", \ 
  134               __LINE__, __FILE__);                               \ 
  140 #   define ASSERT(expr) ; 
  141 #   define ASSERTP(expr,msg) ; 
  145 #   define ASSERT2 ASSERT 
  146 #   define ASSERTP2 ASSERTP 
  148 #   define ASSERT2(expr) ; 
  149 #   define ASSERTP2(expr,msg) ; 
  
gtsam
Author(s): 
autogenerated on Wed May 28 2025 03:01:22