00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014 # ifndef __randy_h__
00015 # define __randy_h__
00016
00017 # ifdef __make_fast__
00018 # define INLINE inline
00019 # else
00020 # define INLINE
00021 # endif
00022
00023 # ifndef NearZero
00024 # define NearZero 2.2204460492503131e-16
00025 # endif
00026
00027 class randy
00028 {
00029 public:
00030 randy ( void ) {} ;
00031 ~randy ( void ) {} ;
00032 INLINE void init ( long orseed=-1 ) ;
00033 public:
00034 INLINE long give_long ( long omax ) ;
00035 INLINE long give_long ( long olow , long ohigh ) ;
00036 INLINE long give_long ( long olow, long ohigh, long oprecision ) ;
00037 INLINE double give_double ( long oa=0, long ob=0 ) ;
00038 INLINE double give_double ( double olow, double ohigh, long oa=0, long ob=0) ;
00039 INLINE double give_double ( double olow, double ohigh, double oprecision, long oa=0, long ob=0 ) ;
00040 public:
00041 INLINE long is_less ( double oa ) ;
00042 INLINE long round ( long oa, long oprecision ) ;
00043 INLINE long move_to_bounds ( long oa, long olow, long ohigh ) ;
00044 INLINE double round ( double oa, double oprecision ) ;
00045 INLINE double move_to_bounds ( double oa, double olow, double ohigh ) ;
00046 public:
00047 INLINE long give_gauss_long ( double omi=0.0, double oss=1.0 ) ;
00048 INLINE double give_gauss_double ( double omi=0.0, double oss=1.0 ) ;
00049 public:
00050 long rseed ;
00051 };
00052
00053 # ifdef __make_fast__
00054 # include "randy.cpp_h"
00055 # endif
00056
00057 # endif
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078