Changeset b3404fe in tol for tol/contrib/kmlocal/KMrand.cpp
- Timestamp:
- Jan 20, 2014, 11:22:55 AM (13 years ago)
- Branches:
- 1941-docker-image-to-test, devel, master
- Children:
- 0e51c9d
- Parents:
- dbf50f6
- File:
-
- 1 edited
-
tol/contrib/kmlocal/KMrand.cpp (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
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
Note: See TracChangeset
for help on using the changeset viewer.
