Changeset b3404fe in tol
- Timestamp:
- Jan 20, 2014, 11:22:55 AM (13 years ago)
- Branches:
- 1941-docker-image-to-test, devel, master
- Children:
- 0e51c9d
- Parents:
- dbf50f6
- Location:
- tol
- Files:
-
- 3 edited
-
bmath/bprdist/prd.cpp (modified) (2 diffs)
-
contrib/kmlocal/KMrand.cpp (modified) (3 diffs)
-
contrib/kmlocal/KMrand.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
tol/bmath/bprdist/prd.cpp
rdbf50f6 rb3404fe 35 35 #include <gsl/gsl_sf_result.h> 36 36 #include <gsl/gsl_sf_gamma.h> 37 #include <../../contrib/kmlocal/KMrand.h> 37 38 38 39 BTraceInit("prd.cpp"); … … 120 121 { 121 122 InitGSLRand(seed); 123 kmInitialice(seed); 122 124 }; 123 125 -
tol/contrib/kmlocal/KMrand.cpp
rdbf50f6 rb3404fe 44 44 // to initialise or reinitialise the sequence. 45 45 //------------------------------------------------------------------------ 46 47 static double kmRan0() 48 { 49 int j; 46 void kmInitialice(int seed) 47 { 48 int j; 50 49 51 50 static double y, maxran, v[98]; // The exact number 98 is unimportant 52 static int iff = 0; 53 54 // As a precaution against misuse, we will always initialize on the first 55 // call, even if "kmIdum" is not set negative. Determine "maxran", the 56 // next integer after the largest representable value of type int. We 57 // assume this is a factor of 2 smaller than the corresponding value of 58 // type unsigned int. 59 60 if (kmIdum < 0 || iff == 0) { // initialize 51 52 kmIdum = seed; 53 61 54 /* compute maximum random number */ 62 55 #ifdef WIN32 // Microsoft Visual C++ … … 71 64 maxran = (double) k; 72 65 #endif 73 iff = 1; 74 66 75 67 srandom(kmIdum); 76 kmIdum = 1;77 68 78 69 for (j = 1; j <= 97; j++) // exercise the system routine … … 82 73 v[j] = random(); 83 74 y = random(); 84 } 75 } 76 77 78 79 static double kmRan0() 80 { 81 int j; 82 83 static double y, maxran, v[98]; // The exact number 98 is unimportant 85 84 86 85 // This is where we start if not initializing. Use the previously saved -
tol/contrib/kmlocal/KMrand.h
rdbf50f6 rb3404fe 37 37 // External entry points 38 38 //---------------------------------------------------------------------- 39 40 void kmInitialice(int seed); 39 41 40 42 int kmRanInt( // random integer
Note: See TracChangeset
for help on using the changeset viewer.
