Changeset 852 in Sophya for trunk/SophyaLib/NTools/nbrandom.h
- Timestamp:
- Apr 10, 2000, 2:59:45 PM (25 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/SophyaLib/NTools/nbrandom.h
r682 r852 5 5 #define NBRANDOM_H_SEEN 6 6 7 #include "machdefs.h" 8 #include <stdlib.h> 9 #ifdef __MWERKS__ 10 #include "unixmac.h" 11 #endif 7 /* Pour compatibilite anterieure R. Ansari 04/2000 */ 8 /* remplace par srandgen.h */ 12 9 13 #define frand01() ( (float) drand48() ) 14 #define drand01() ( drand48() ) 15 #define ranf01() drand01() 16 17 #define frandpm1() ( 2. * frand01() - 1.) 18 #define drandpm1() ( 2. * drand01() - 1.) 19 #define ranfpm1() drandpm1() 20 21 struct tirage_alea { 22 int Nbin; 23 double Min,Max,Lbin; 24 double *Tab; 25 }; 26 typedef struct tirage_alea TIREALEA; 27 28 #ifdef __cplusplus 29 extern "C" { 30 #endif 31 32 void Ini_Ranf_Quick(long seed_val, int lp); 33 void Ini_Ranf(unsigned short seed_16v[3], int lp); 34 void Get_Ranf(unsigned short seed_16v[3], int lp); 35 void Auto_Ini_Ranf(int lp); 36 37 void SetGauRange(double range); 38 float NorRand1(void); 39 double GauRnd1(double am, double s); 40 float NorRand(void); 41 double GauRnd(double am, double s); 42 int NormCo(double *a,double *b 43 ,double mx,double my,double sx,double sy,double ro); 44 void NormGau(double *x,double *y 45 ,double mx,double my,double sa,double sb,double teta); 46 47 TIREALEA *init_tirage_alea(int nbin,double xmin,double xmax,double (*fonc) (double)); 48 double tirage_alea(TIREALEA *alea); 49 int end_tirage_alea(TIREALEA *alea); 50 51 #ifdef __cplusplus 52 } 53 #endif 10 #include "srandgen.h" 54 11 55 12 #endif
Note:
See TracChangeset
for help on using the changeset viewer.