/Users/huttone/Devel/sedflux-new/sedflux/trunk/ew/utils/eh_macros.h File Reference

Go to the source code of this file.

Defines

#define E_BADVAL   (G_MAXFLOAT)
#define E_NOVAL   (G_MAXFLOAT)
#define S_LINEMAX   (2048)
#define S_NAMEMAX   (255)
#define S_MAXPATHNAME   (1024)
#define E_MAJOR_VERSION   (1)
#define E_MINOR_VERSION   (1)
#define E_MICRO_VERSION   (0)
#define E_CHECK_VERSION(major, minor, micro)
#define eh_p_msg(msg_level, str)   eh_print_msg( msg_level , __PRETTY_FUNCTION__ , str )
#define eh_lower_bound(val, low)   ( val = ((val)<(low) )?(low ):(val) )
#define eh_upper_bound(val, high)   ( val = ((val)>(high))?(high):(val) )
#define eh_clamp(val, low, high)   ( val = ((val)<(low))?(low):(((val)>(high))?(high):(val)) )
#define EH_SWAP_PTR(a, b)   { void* t=(b); (b)=(a); (a)=t; }
#define swap_int(a, b)   { int temp=b; b=a; a=temp; }
#define swap_dbl(a, b)   { double temp=b; b=a; a=temp; }
#define swap_dbl_vec(x, i, j)   { double temp=x[i]; x[i]=x[j]; x[j]=temp; }
#define eh_memswap(a, b, n)   { void* temp=g_memdup(a,n); g_memmove(a,b,n); g_memmove(b,temp,n); eh_free(temp); }
#define EH_STRUCT_MEMBER(type, st, mem)   ( ((type*)st)->mem )
#define eh_new_2(type, m, n)   ( (type**)eh_alloc_2( m , n , sizeof(type) ) )
#define eh_free_2(p)   ( eh_free_void_2( ((void**)(p)) ) )
#define EH_RADS_PER_DEGREE   ( 0.01745329251994 )
#define EH_DEGREES_PER_RAD   ( 57.29577951308232 )
#define EH_SQRT_PI   ( 1.77245385090552 )
#define POLYGON_IN_CROSSINGS   ( 1<<0 )
#define POLYGON_OUT_CROSSINGS   ( 1<<1 )
#define BIT_ON   00000001
#define BIT_OFF   00000000
#define NO   0
#define YES   1
#define PTR_SIZE   8
#define ALL   -1
#define eh_sign(a)   ( (a>=0)?1:-1 )
#define eh_max(a, b)   ( ( (a) > (b) ) ? (a) : (b) )
#define eh_set_max(a, b)   if ( (b)>(a) ) { (a) = (b); }
#define eh_set_min(a, b)   if ( (b)<(a) ) { (a) = (b); }
#define eh_dbl_set_max(a, b)   { double __t=(b); if ( __t>(a) ) { (a)=__t; } }
#define eh_dbl_set_min(a, b)   { double __t=(b); if ( __t<(a) ) { (a)=__t; } }
#define eh_min(a, b)   ( ( (a) < (b) ) ? (a) : (b) )
#define get_bit(pt, n)   ( (pt)[(n)/8]&(0x80>>((n)%8)) )
#define turn_bit_on(pt, n)   (pt)[(n)/8] = (pt)[(n)/8] | (0x80>>((n)%8))
#define turn_bit_off(pt, n)   (pt)[(n)/8] = (pt)[(n)/8] &~ (0x80>>((n)%8));
#define nbb(n)   ( ( (n) + 7 ) / 8 )
#define eh_sqr(x)   ( (x)*(x) )
#define eh_nrsign(a, b)   ( (b>0)?fabs(a):(-fabs(a)) )
#define initarray(pt, len, c)   { unsigned long i; for (i=0;i<len;(pt)[i++]=c); }
#define count_pix(pt, len, val, c)   { unsigned long i; for (i=0;i<len;i++) if ((pt)[i]==val) c++; }
#define rotate_array(ar_type, pt, len)
#define mmove(dst, src, len)


Define Documentation

#define ALL   -1

Definition at line 74 of file eh_macros.h.

#define BIT_OFF   00000000

Definition at line 70 of file eh_macros.h.

#define BIT_ON   00000001

Definition at line 69 of file eh_macros.h.

#define count_pix ( pt,
len,
val,
 )     { unsigned long i; for (i=0;i<len;i++) if ((pt)[i]==val) c++; }

Definition at line 143 of file eh_macros.h.

#define E_BADVAL   (G_MAXFLOAT)

Definition at line 24 of file eh_macros.h.

#define E_CHECK_VERSION ( major,
minor,
micro   ) 

Value:

(E_MAJOR_VERSION > (major) || \
     (E_MAJOR_VERSION == (major) && E_MINOR_VERSION > (minor)) || \
     (E_MAJOR_VERSION == (major) && E_MINOR_VERSION == (minor) && \
      E_MICRO_VERSION >= (micro)))

Definition at line 35 of file eh_macros.h.

#define E_MAJOR_VERSION   (1)

Definition at line 31 of file eh_macros.h.

#define E_MICRO_VERSION   (0)

Definition at line 33 of file eh_macros.h.

#define E_MINOR_VERSION   (1)

Definition at line 32 of file eh_macros.h.

#define E_NOVAL   (G_MAXFLOAT)

Definition at line 25 of file eh_macros.h.

Referenced by eh_opt_print_opt_padded(), and print_opt_pad().

#define eh_clamp ( val,
low,
high   )     ( val = ((val)<(low))?(low):(((val)>(high))?(high):(val)) )

Definition at line 47 of file eh_macros.h.

Referenced by diffuse_sediment_2(), eh_rebin_dbl_array_bad_val(), get_shelf_zones(), is_shore_cell(), rain_sediment_3(), run_xshore(), sed_cell_separate_amount(), sed_cell_separate_thickness(), sed_column_extract_top_cell(), sed_column_extract_top_n_cells(), sed_column_remove_top_cell(), sed_column_thickness_index(), sed_cube_find_columns_custom(), sed_cube_river_mouth_1d(), and sed_river_set_angle().

#define eh_dbl_set_max ( a,
 )     { double __t=(b); if ( __t>(a) ) { (a)=__t; } }

Definition at line 103 of file eh_macros.h.

Referenced by run_storm().

#define eh_dbl_set_min ( a,
 )     { double __t=(b); if ( __t<(a) ) { (a)=__t; } }

Definition at line 104 of file eh_macros.h.

#define EH_DEGREES_PER_RAD   ( 57.29577951308232 )

Definition at line 61 of file eh_macros.h.

#define eh_free_2 (  )     ( eh_free_void_2( ((void**)(p)) ) )

Definition at line 58 of file eh_macros.h.

Referenced by _print_sediment_column(), _scan_sediment_column(), avulsion_full(), destroy_sea_level(), diffuse_cols(), eh_dlm_read_full_swap(), eh_dlm_read_swap(), eh_input_val_set(), eh_poly_fit(), inflow(), inflow_run_flood(), inflow_scan_bathy_file(), main(), sakura_destroy_bathy_data(), sakura_run_flood(), sakura_scan_bathy_file(), sed_bathy_grid_scan_1d_ascii(), sed_get_floor_sequence_2(), sed_inflow(), sed_sakura(), sed_scan_sea_level_curve(), and squall().

#define eh_lower_bound ( val,
low   )     ( val = ((val)<(low) )?(low ):(val) )

Definition at line 44 of file eh_macros.h.

Referenced by get_bruun_zones(), run_darcy_flow(), run_exponential_flow(), run_terzaghi_flow(), sed_cell_cohesion(), sed_cell_compact(), sed_column_index_depth(), sed_column_index_thickness(), sed_column_load_at(), sed_column_resize_cell(), sed_column_total_load(), sed_cube_n_rows_between(), sed_cube_x_cols_between(), sed_cube_y_cols_between(), sed_get_phe(), sed_hydro_adjust_mass(), and sed_hydro_subtract_cell().

#define eh_max ( a,
 )     ( ( (a) > (b) ) ? (a) : (b) )

Definition at line 100 of file eh_macros.h.

Referenced by calculate_head_index(), compute_c_grain(), diffuse_sediment_2(), eh_svdcmp(), sed_cube_max_height(), and sed_cube_property_subgrid().

#define eh_memswap ( a,
b,
 )     { void* temp=g_memdup(a,n); g_memmove(a,b,n); g_memmove(b,temp,n); eh_free(temp); }

Definition at line 54 of file eh_macros.h.

Referenced by eh_grid_transpose().

#define eh_min ( a,
 )     ( ( (a) < (b) ) ? (a) : (b) )

Definition at line 105 of file eh_macros.h.

Referenced by add_sediment_from_external_source(), calculate_head_index(), calculate_mid_vel(), calculate_next_vel(), compute_next_c(), compute_next_h(), eh_svdcmp(), savgol(), sed_cube_min_height(), and sed_cube_property_subgrid().

#define eh_new_2 ( type,
m,
 )     ( (type**)eh_alloc_2( m , n , sizeof(type) ) )

Definition at line 57 of file eh_macros.h.

Referenced by _print_sediment_column(), avulsion_full(), eh_dlm_read_data(), eh_dlm_read_full_swap(), eh_dlm_read_swap(), eh_poly_fit(), get_sediment_flux(), inflow(), inflow_run_flood(), inflow_set_bathy_data_from_cube(), load_sea_level_data(), plume_i_bar(), plume_wrapper(), sakura(), sakura_new_bathy_data(), sakura_set_bathy_data(), sakura_set_bathy_data_from_cube(), savgol(), sed_inflow(), and squall().

#define eh_nrsign ( a,
 )     ( (b>0)?fabs(a):(-fabs(a)) )

Definition at line 113 of file eh_macros.h.

Referenced by eh_svdcmp().

#define eh_p_msg ( msg_level,
str   )     eh_print_msg( msg_level , __PRETTY_FUNCTION__ , str )

Definition at line 41 of file eh_macros.h.

#define EH_RADS_PER_DEGREE   ( 0.01745329251994 )

Definition at line 60 of file eh_macros.h.

#define eh_set_max ( a,
 )     if ( (b)>(a) ) { (a) = (b); }

Definition at line 101 of file eh_macros.h.

Referenced by sed_cube_n_rows_between().

#define eh_set_min ( a,
 )     if ( (b)<(a) ) { (a) = (b); }

Definition at line 102 of file eh_macros.h.

Referenced by sed_cube_n_rows_between().

#define eh_sign (  )     ( (a>=0)?1:-1 )

Definition at line 99 of file eh_macros.h.

Referenced by sed_cube_find_cross_shore_columns().

#define eh_sqr (  )     ( (x)*(x) )

Definition at line 112 of file eh_macros.h.

Referenced by calculate_next_c_and_h(), compute_next_h(), dudt(), eh_fit(), and eh_pythag().

#define EH_SQRT_PI   ( 1.77245385090552 )

Definition at line 63 of file eh_macros.h.

Referenced by plume_k_bar_dy_established(), plume_k_bar_established(), and plume_v_bar_established().

#define EH_STRUCT_MEMBER ( type,
st,
mem   )     ( ((type*)st)->mem )

Definition at line 55 of file eh_macros.h.

#define EH_SWAP_PTR ( a,
 )     { void* t=(b); (b)=(a); (a)=t; }

Definition at line 50 of file eh_macros.h.

Referenced by eh_dlm_read_full_swap().

#define eh_upper_bound ( val,
high   )     ( val = ((val)>(high))?(high):(val) )

Definition at line 45 of file eh_macros.h.

Referenced by run_bedload(), sakura_sed_get_phe(), sed_cube_n_rows_between(), sed_cube_x_cols_between(), sed_cube_y_cols_between(), and sed_get_phe().

#define get_bit ( pt,
 )     ( (pt)[(n)/8]&(0x80>>((n)%8)) )

Definition at line 107 of file eh_macros.h.

#define initarray ( pt,
len,
 )     { unsigned long i; for (i=0;i<len;(pt)[i++]=c); }

Definition at line 141 of file eh_macros.h.

#define mmove ( dst,
src,
len   ) 

Value:

{ unsigned long j;                      \
                             for (j=0;j<(len);j++)              \
                                      (dst)[j]=(src)[j];        \
                           }

Definition at line 149 of file eh_macros.h.

#define nbb (  )     ( ( (n) + 7 ) / 8 )

Definition at line 110 of file eh_macros.h.

#define NO   0

Definition at line 71 of file eh_macros.h.

#define POLYGON_IN_CROSSINGS   ( 1<<0 )

Definition at line 65 of file eh_macros.h.

Referenced by eh_find_polygon_crossings(), is_inside_area(), and sed_cube_river_mouth_position().

#define POLYGON_OUT_CROSSINGS   ( 1<<1 )

Definition at line 66 of file eh_macros.h.

Referenced by eh_find_polygon_crossings(), and is_inside_area().

#define PTR_SIZE   8

Definition at line 73 of file eh_macros.h.

#define rotate_array ( ar_type,
pt,
len   ) 

Value:

{ unsigned long i;                                    \
                                       ar_type temp;                                          \
                                       for (i=0,temp=(pt)[0];i<len-1;(pt)[i]=(pt)[i+1],i++); \
                                       (pt)[len-1]=temp;                                      \
                                     }

Definition at line 144 of file eh_macros.h.

#define S_LINEMAX   (2048)

Definition at line 27 of file eh_macros.h.

Referenced by eh_fill_project_info(), eh_get_input_val(), eh_input_boolean(), eh_input_str(), eh_set_project_current_time(), and fill_sedflux_info_file().

#define S_MAXPATHNAME   (1024)

Definition at line 29 of file eh_macros.h.

#define S_NAMEMAX   (255)

Definition at line 28 of file eh_macros.h.

Referenced by run_data_dump().

#define swap_dbl ( a,
 )     { double temp=b; b=a; a=temp; }

Definition at line 52 of file eh_macros.h.

Referenced by eh_find_polygon_crossings(), four1(), and make_depth_histogram().

#define swap_dbl_vec ( x,
i,
 )     { double temp=x[i]; x[i]=x[j]; x[j]=temp; }

Definition at line 53 of file eh_macros.h.

#define swap_int ( a,
 )     { int temp=b; b=a; a=temp; }

Definition at line 51 of file eh_macros.h.

Referenced by make_depth_histogram().

#define turn_bit_off ( pt,
 )     (pt)[(n)/8] = (pt)[(n)/8] &~ (0x80>>((n)%8));

Definition at line 109 of file eh_macros.h.

#define turn_bit_on ( pt,
 )     (pt)[(n)/8] = (pt)[(n)/8] | (0x80>>((n)%8))

Definition at line 108 of file eh_macros.h.

#define YES   1

Definition at line 72 of file eh_macros.h.


Generated on Fri Jan 4 18:04:18 2008 for sedflux by  doxygen 1.5.2