generators.h
上传用户:shenzhenrh
上传日期:2013-05-12
资源大小:2904k
文件大小:23k
源码类别:

信息检索与抽取

开发平台:

Unix_Linux

  1. //
  2. // <random/generators.h>
  3. //
  4. //     1997-09-01 (v. 0.7)
  5. //     1998-10-08 (v. 0.8)
  6. //     2000-02-21 (v. 0.81)
  7. //
  8. // 
  9. // See the file docs/README.Generators for guide to usage
  10. // 
  11. //
  12. // Every implemented random number generator is --
  13. // 
  14. //   A predefined algorithm for generating non-negative integral
  15. //   values uniformly distributed across an algorithm-specific
  16. //   closed interval [0,unsignedMax], as well as floating point
  17. //   values uniformly distributed over the half-open interval 
  18. //   [0.0,1.0).
  19. //
  20. // 
  21. // ---------------------------------------------------------------------
  22. // Protocol components:
  23. //
  24. @protocol CommonGenerator
  25. //S: Internal
  26. CREATING
  27. + createWithDefaults: (id <Zone>)aZone;
  28. SETTING
  29. //M: The setStateFromSeed method initializes the seed dependent part of the 
  30. //M: state from a single seed value.
  31. - setStateFromSeed: (unsigned)seed;
  32. //M: The setStateFromSeeds method initializes the seed dependent part of the 
  33. //M: state from a vector of seed values.
  34. - setStateFromSeeds: (unsigned *)seeds;
  35. //M: The setAntithetic method turns on or off antithetic output (default=off).
  36. //M: Antithetic output is (unsignedMax - u) or (1.0 - d).
  37. - setAntithetic: (BOOL) antiT;
  38. USING
  39. //M: The getAntithetic method returns the current values of the parameter.
  40. - (BOOL)getAntithetic;
  41. //M: The getMaxSeedValue method returns the upper limit on the seed value
  42. //M: that can be supplied.
  43. - (unsigned)getMaxSeedValue; // minvalue is 1
  44. //M: The getMaxSeedValues method returns a vector of upper limits on the 
  45. //M: seed values that can be supplied.
  46. - (unsigned *)getMaxSeedValues; // minvalue is 1
  47. //M: The getInitialSeed method returns the value of the generator's 
  48. //M: starting seed.
  49. - (unsigned)getInitialSeed;
  50. //M: The getInitialSeeds method returns a vector of the generator's 
  51. //M: starting seed values.
  52. - (unsigned *)getInitialSeeds;
  53. //M: The lengthOfSeedVector method returns the number of seeds required
  54. //M: if you wish to set the state directly.
  55. - (unsigned)lengthOfSeedVector;
  56. //M: The -reset method sets the generator back to the state it had at start
  57. //M: or at the last use of -setStateFromSeed(s). CurrentCount is zeroed.
  58. - reset;
  59. //M: The getUnsignedMax method returns the highest value that will ever 
  60. //M: be returned by -getUnsignedSample (the lowest is 0).
  61. - (unsigned)getUnsignedMax;
  62. @end
  63. @protocol SimpleGenerator
  64. //S: Internal
  65. CREATING
  66. + create: (id <Zone>)aZone setStateFromSeed: (unsigned)seed;
  67. + create: (id <Zone>)aZone setStateFromSeeds: (unsigned *)seeds;
  68. USING
  69. //M: The getUnsignedSample method returns a random unsigned integer 
  70. //M: uniformly distributed over [0,unsignedMax].
  71. - (unsigned)getUnsignedSample;
  72. //M: The getFloatSample method returns a random floating point number
  73. //M: of size float, uniformly distributed in the range [0.0, 1.0).
  74. //M: It uses 1 call to -getUnsignedSample to fill the mantissa.
  75. - (float)getFloatSample;
  76. //M: The getThinDoubleSample method returns a random floating point number
  77. //M: of size double, uniformly distributed in the range [0.0, 1.0).
  78. //M: It uses 1 call to -getUnsignedSample to fill the mantissa.
  79. - (double)getThinDoubleSample;
  80. //M: The getDoubleSample method returns a random floating point number
  81. //M: of size double, uniformly distributed in the range [0.0, 1.0).
  82. //M: It uses 2 calls to -getUnsignedSample to fill the mantissa.
  83. - (double)getDoubleSample;
  84. //M: The getLongDoubleSample method returns a random floating point number
  85. //M: of size long double, uniformly distributed in the range [0.0, 1.0).
  86. //M: It uses 2 calls to -getUnsignedSample to fill the mantissa.
  87. //M: Note: use of this method is not portable between architectures.
  88. - (long double)getLongDoubleSample;
  89. //M: The getCurrentCount method returns the count of variates generated.
  90. - (unsigned long long int)getCurrentCount;
  91. @end
  92. @protocol SplitGenerator
  93. //S: Internal
  94. CREATING
  95. + create          : (id <Zone>)aZone
  96.               setA: (unsigned)A  // # of virtual generators
  97.               setV: (unsigned)v  // log2(#segments/generator)
  98.               setW: (unsigned)w // log2(segment length)
  99.   setStateFromSeed: (unsigned)seed;
  100. + create          : (id <Zone>)aZone
  101.               setA: (unsigned)A         // # of virtual generators
  102.               setV: (unsigned)v         // log2(#segments/generator)
  103.               setW: (unsigned)w         // log2(segment length)
  104.  setStateFromSeeds: (unsigned *)seeds;
  105. SETTING
  106. //M: The initGenerator method resets the state of a virtual generator to 
  107. //M: the start of segment #0.
  108. - initGenerator: (unsigned)vGen;
  109. //M: The initAll method resets the state of all the virtual generators to 
  110. //M: the start of segment #0.
  111. - initAll; 
  112. USING
  113. // Note: Valid values for vGen are [0,getNumGenerators-1]
  114. //M: The getNumGenerators method returns the current number of 
  115. //M: virtual generators (A).
  116. - (unsigned)getNumGenerators;
  117. //M: The getNumSegments method returns log2(the current number of 
  118. //M: segments) = v.
  119. - (unsigned)getNumSegments;
  120. //M: The getSegmentLength method returns log2(the current segment 
  121. //M: length) = w.
  122. - (unsigned)getSegmentLength;
  123. //M: The restartGenerator method resets the state of a virtual generator to
  124. //M: the start of the current segment.
  125. - restartGenerator: (unsigned)vGen;
  126. //M: The advanceGenerator method resets the state of a virtual generator to 
  127. //M: the start of the next segment.
  128. - advanceGenerator: (unsigned)vGen;
  129. //M: The jumpGenerator:toSegment: method resets the state of a virtual 
  130. //M: generator to the start of the specified segment.
  131. - jumpGenerator: (unsigned)vGen  toSegment: (unsigned long long int)seg;
  132. //M: The restartAll method resets the state of all the virtual generators to
  133. //M: the start of their current segment.
  134. - restartAll; // start of current segment
  135. //M: The advanceAll method resets the state of all the virtual generators to 
  136. //M: the start of their next segment.
  137. - advanceAll; // to next segment
  138. //M: The jumpAlltoSegment: method resets the state of all the virtual 
  139. //M: generators to the start of the specified segment.
  140. - jumpAllToSegment: (unsigned long long int)seg;
  141. //M: The getUnsignedSample method returns a random unsigned integer 
  142. //M: uniformly distributed over the interval [0,unsignedMax] 
  143. //M: from virtual generator (data stream) vGen.
  144. - (unsigned)getUnsignedSample: (unsigned)vGen;
  145. //M: The getFloatSample method returns a random floating-point number 
  146. //M: of size float, uniformly distributed in the range [0.0,1.0),
  147. //M: from virtual generator (data stream) vGen.
  148. //M: This method uses 1 call to -getUnsignedSample to fill the mantissa.
  149. - (float)getFloatSample: (unsigned)vGen; // using 1 unsigned
  150. //M: The getThinDoubleSample method returns a random floating-point number 
  151. //M: of size double, uniformly distributed in the range [0.0,1.0),
  152. //M: from virtual generator (data stream) vGen.
  153. //M: This method uses 1 call to -getUnsignedSample to fill the mantissa.
  154. - (double)getThinDoubleSample: (unsigned)vGen;      // using 1 unsigned
  155. //M: The getDoubleSample method returns a random floating-point number 
  156. //M: of size double, uniformly distributed in the range [0.0,1.0),
  157. //M: from virtual generator (data stream) vGen.
  158. //M: This method uses 2 calls to -getUnsignedSample to fill the mantissa.
  159. - (double)getDoubleSample: (unsigned)vGen;          // using 2 unsigneds
  160. //M: The getLongDoubleSample method returns a random floating-point number 
  161. //M: of size long double, uniformly distributed in the range [0.0,1.0),
  162. //M: from virtual generator (data stream) vGen.
  163. //M: This method uses 2 calls to -getUnsignedSample to fill the mantissa.
  164. //M: Warning: use of this method is not portable between architectures.
  165. - (long double)getLongDoubleSample: (unsigned)vGen; // using 2 unsigneds
  166. //M: The getCurrentSegment method returns the number of the current segment 
  167. //M: of the specified virtual generator.
  168. - (unsigned long long int)getCurrentSegment: (unsigned)vGen;
  169. //M: The getCurrentCount method returns the current count of the specified
  170. //M: virtual generator (i.e. the number of variates delivered).
  171. - (unsigned long long int)getCurrentCount: (unsigned)vGen;
  172. @end
  173. // 
  174. // ------------------------------------------------------------------------
  175. // Implemented generator types:
  176. //
  177. // 
  178. // NOTE: all the split generators implement the same protocols,
  179. //   and likewise for the non-split (simple) generators.
  180. //
  181. @protocol BasicRandomGenerator <SwarmObject, InternalState, CommonGenerator>
  182. //S: The common functionality of simple and split generators.
  183. //D: This protocol covers methods common to simple and split generators.
  184. @end
  185. @protocol SimpleRandomGenerator <BasicRandomGenerator, SimpleGenerator>
  186. // <SwarmObject, InternalState, SimpleOut, Simple, SingleSeed, MultiSeed>
  187. //S: A Simple (non-split) generator.
  188. //D: This protocol covers all implemented non-split generators.
  189. @end
  190. @protocol SplitRandomGenerator <BasicRandomGenerator, SplitGenerator>
  191. // <SwarmObject, InternalState, SplitOut, Split, 
  192. // SplitSingleSeed, SplitMultiSeed>
  193. //S: A split generator.
  194. //D: This protocol covers the implemented split generators
  195. //D: (C2LCGX and C4LCGX.)
  196. @end
  197. // 
  198. // -----------------------------------------------------------------
  199. // @protocols for individual generator classes:
  200. //
  201. // NOTE: these protocols are included for backward compatibility only.
  202. // Use protocols <SimpleRandomGenerator> and <SplitRandomGenerator>.
  203. // LCG[1-3] -- single short random number generators, 
  204. @protocol LCGgen <SimpleRandomGenerator>
  205. //S: Linear Congruential Generator
  206. //D: This classic generator relies on controlled overflow at 32 bits.
  207. //D: This requires that unsigned be a 32bit value that follows ANSI C rules.
  208. //D: Knuth claims that the adder c does not matter much, as long as it has 
  209. //D: no factors in common with the modulus 2^32.
  210. //D: NOT recommended for serious use; these are included for
  211. //D: historical reasons (compatibility with earlier releases).
  212. @end
  213. @protocol LCG1gen <LCGgen, CREATABLE>
  214. //S: Linear Congruential Generator 1
  215. //D: With the parameters: a = 1,664,525 and c = 1,013,904,223 this generator
  216. //D: has a single full cycle of length m.
  217. @end
  218. @protocol LCG2gen <LCGgen, CREATABLE>
  219. //S: Linear Congruential Generator 2
  220. //D: With the parameters: a = 69,069 and c = 1,013,904,223 this generator
  221. //D: has a single full cycle of length m.
  222. @end
  223. @protocol LCG3gen <LCGgen, CREATABLE>
  224. //S: Linear Congruential Generator 3
  225. //D: With the parameters: a = 1,664,525 and c = 152,193,325 this generator
  226. //D: has a single full cycle of length m.
  227. @end
  228. //
  229. // PMMLCG1, PMMLCG2, PMMLCG3 --
  230. //   single short random number generators recommended for use.
  231. //
  232. // PMMLCG4, PMMLCG5, PMMLCG6, PMMLCG7 --
  233. //   component generators of C4LCGX
  234. //
  235. // PMMLCG8, PMMLCG9 --
  236. //   component generators of C2LCGX
  237. @protocol PMMLCGgen <SimpleRandomGenerator>
  238. //S: Prime Modulus Multiplicative Linear Congruential Generator
  239. //D: These generator have single full cycle of length (m-1).
  240. @end
  241. @protocol PMMLCG1gen <PMMLCGgen, CREATABLE>
  242. //S: Prime Modulus Multiplicative Linear Congruential Generator 1
  243. //D: With parameters a = 16,807 and m = 2,147,483,647, this generator has a
  244. //D: single full cycle of length (m-1).
  245. @end
  246. @protocol PMMLCG2gen <PMMLCGgen, CREATABLE>
  247. //S: Prime Modulus Multiplicative Linear Congruential Generator 2
  248. //D: With parameters a = 48,271 and m = 2,147,483,647, this generator has a
  249. //D: single full cycle of length (m-1).
  250. @end
  251. @protocol PMMLCG3gen <PMMLCGgen, CREATABLE>
  252. //S: Prime Modulus Multiplicative Linear Congruential Generator 3
  253. //D: With parameters a = 69,621 and m = 2,147,483,647, this generator has a
  254. //D: single full cycle of length (m-1).
  255. @end
  256. @protocol PMMLCG4gen  <PMMLCGgen, CREATABLE>
  257. //S: Prime Modulus Multiplicative Linear Congruential Generator 4
  258. //D: With parameters a = 45,991 and m = 2,147,483,647, this generator has a
  259. //D: single full cycle of length (m-1). This is one of the component generators
  260. //D: of the CLOG4.
  261. @end
  262. @protocol PMMLCG5gen  <PMMLCGgen, CREATABLE>
  263. //S: Prime Modulus Multiplicative Linear Congruential Generator 5
  264. //D: With parameters a = 207,707 and m = 2,147,483,543, this generator has a
  265. //D: single full cycle of length (m-1). This is one of the component generators
  266. //D: of the CLOG4.
  267. @end
  268. @protocol PMMLCG6gen <PMMLCGgen, CREATABLE>
  269. //S: Prime Modulus Multiplicative Linear Congruential Generator 6
  270. //D: With parameters a = 138,556 and m = 2,147,483,423, this generator has a
  271. //D: single full cycle of length (m-1). This is one of the component generators
  272. //D: of the CLOG4.
  273. @end
  274. @protocol PMMLCG7gen <PMMLCGgen, CREATABLE>
  275. //S: Prime Modulus Multiplicative Linear Congruential Generator 7
  276. //D: With parameters a = 49,689 and m = 2,147,483,323, this generator has a
  277. //D: single full cycle of length (m-1). This is one of the component generators
  278. //D: of the CLOG4.
  279. @end
  280. @protocol PMMLCG8gen <PMMLCGgen, CREATABLE>
  281. //S: Prime Modulus Multiplicative Linear Congruential Generator 8
  282. //D: With parameters a = 40,014 and m = 2,147,483,563, this generator has a
  283. //D: single full cycle of length (m-1). This is one of the component generators
  284. //D: of the C2LOGX.
  285. @end
  286. @protocol PMMLCG9gen <PMMLCGgen, CREATABLE>
  287. //S: Prime Modulus Multiplicative Linear Congruential Generator 9
  288. //D: With parameters a = 40,692 and m = 2,147,483,399, this generator has a
  289. //D: single full cycle of length (m-1). This is one of the component generators
  290. //D: of the C2LOGX.
  291. @end
  292. // ACG, SCG -- single long random number generators
  293. @protocol ACGgen <SimpleRandomGenerator, CREATABLE>
  294. //S: Additive Congruential Generator
  295. //D: ACG is in the Lagged Fibonacci class of generators. These generators 
  296. //D: use a basic algorithm of the form X_n = f(X_(n-r),X_(n-s)) mod m; r>s
  297. //D: The function f is typically xor, addition, subtraction, multiplication 
  298. //D: or subtraction with carry. It uses simpler math than a basic LCG, but 
  299. //D: keeps a larger state.
  300. //D: NOT recommended for serious use; these are included for
  301. //D: historical reasons (compatibility with earlier releases).
  302. @end
  303. @protocol SCGgen <SimpleRandomGenerator, CREATABLE>
  304. //S: Subtractive Congruential Generator
  305. //D: SCG is in the Lagged Fibonacci class of generators. These generators use 
  306. //D: a basic algorithm of the form X_n = f(X_(n-r),X_(n-s)) mod m; r>s
  307. //D: The function f is typically xor, addition, subtraction, multiplication 
  308. //D: or subtraction with carry. It uses simpler math than a basic LCG, but 
  309. //D: keeps a larger state.
  310. //D: NOT recommended for serious use; these are included for
  311. //D: historical reasons (compatibility with earlier releases).
  312. @end
  313. // SWB1, SWB2, SWB3 -- single long generators recommended for use.
  314. @protocol SWBgen <SimpleRandomGenerator>
  315. //S: Subtract-with-borrow Congruential Generator
  316. //D: These generators use a basic algorithm of the form 
  317. //D: X_n = f(X_(n-r),X_(n-s)) mod m; r>s
  318. //D: The function f is typically xor, addition, subtraction, multiplication 
  319. //D: or subtraction with carry. It uses simpler math than a basic LCG, but 
  320. //D: keeps a larger state.
  321. @end
  322. @protocol SWB1gen <SWBgen, CREATABLE>
  323. //S: Subtract-with-borrow Congruential Generator 1
  324. //D: With the parameters r = 37 and s = 24, this generator has 64 cycles of 
  325. //D: length 10^354.
  326. @end
  327. @protocol SWB2gen <SWBgen, CREATABLE>
  328. //S: Subtract-with-borrow Congruential Generator 2
  329. //D: With the parameters r = 24 and s = 19, this generator has 1536 cycles of 
  330. //D: length 10^228.
  331. @end
  332. @protocol SWB3gen <SWBgen, CREATABLE>
  333. //S: Subtract-with-borrow Congruential Generator 3
  334. //D: With the parameters r = 21 and s = 6, this generator has 192 cycles of 
  335. //D: length 10^200.
  336. @end
  337. // PSWB -- single long generator recommended for use.
  338. @protocol PSWBgen   <SimpleRandomGenerator, CREATABLE>
  339. //S: Subtract-with-borrow Congruential Generator with prime modulus
  340. //D: PSWB is an improvement on SWB in that the use of a prime modulus 
  341. //D: guarantees a single full cycle. It's slower, of course.
  342. @end
  343. // MWC -- two long generators recommended for use.
  344. @protocol MWCAgen <SimpleRandomGenerator, CREATABLE>
  345. //S: Multiply-With-Carry generator
  346. //D: This generator is claimed to be strictly periodic, with a period > 2^59. 
  347. //D: (There's possibly two such cycles.)
  348. @end
  349. @protocol MWCBgen <SimpleRandomGenerator, CREATABLE>
  350. //S: Multiply-With-Carry generator
  351. //D: This generator implements an alternate manner of conjoining the two 
  352. //D: components (differs from MWCA). This generator is claimed to be strictly 
  353. //D: periodic, with a period > 2^59. (There's possibly two such cycles.)
  354. @end
  355. // RWC2 -- single long generator recommended for use.
  356. @protocol RWC2gen <SimpleRandomGenerator, CREATABLE>
  357. //S: 2-lag Recursion With Carry generator
  358. //D: This generator is a 2-lag MWC generator implemented using 64-bit math.
  359. @end
  360. // RWC8 ("Mother") -- single long generator recommended for use.
  361. @protocol RWC8gen <SimpleRandomGenerator, CREATABLE>
  362. //S: Multiply With Carry generator ("The Mother of all RNG's")
  363. //D: This generator is a combination of 2 16-bit 8-lag Recursion-With-Carry 
  364. //D: generators. 
  365. @end
  366. // TT403, TT775, TT800 -- single long generators recommended for use.
  367. @protocol TGFSRgen <SimpleRandomGenerator>
  368. //S: Twisted GFSR generator
  369. //D: With properly chosen parameters, these generators have a single cycle 
  370. //D: of length 2^(w*N) -1.
  371. @end
  372. @protocol TT403gen <TGFSRgen, CREATABLE>
  373. //S: A single long generator recommended for use.
  374. //D: A single long generator recommended for use.
  375. @end
  376. @protocol TT775gen <TGFSRgen, CREATABLE>
  377. //S: A single long generator recommended for use.
  378. //D: A single long generator recommended for use.
  379. @end
  380. @protocol TT800gen <TGFSRgen, CREATABLE>
  381. //S: A single long generator recommended for use.
  382. //D: A single long generator recommended for use.
  383. @end
  384. // MT19937 -- single *very* long generator recommended for use.
  385. @protocol MT19937gen <SimpleRandomGenerator, CREATABLE>
  386. //S: 'Mersenne Twister' Twisted GFSR generator
  387. //D:  This generator has a single cycle of length 2^19937-1.
  388. @end
  389. // MRG5, MRG6, MRG7 -- single long generators recommended for use.
  390. @protocol MRGgen <SimpleRandomGenerator>
  391. //S: Multiple Recursive [LCG] Generator
  392. //D: These generators require k multipliers and k past values to be kept. 
  393. //D: In their paper, the authors investigate MRG's of order k from 1 to 7. 
  394. //D: They provide several sets of parameters which they recommend out of a 
  395. //D: large number that were tested. Generally, the quality of the generators
  396. //D: increases with k.
  397. @end
  398. @protocol MRG5gen <MRGgen, CREATABLE>
  399. //S: Multiple Recursive [LCG] Generator 5
  400. //D: This generator has a single full cycle of length (2^31-1)^5 - 1,
  401. //D: i.e. 2^154 < cycle < 2^155.
  402. @end
  403. @protocol MRG6gen <MRGgen, CREATABLE>
  404. //S: Multiple Recursive [LCG] Generator 6
  405. //D: This generator has a single full cycle of length (2^31-1)^6 - 1,
  406. //D: i.e. 2^185 < cycle < 2^186.
  407. @end
  408. @protocol MRG7gen <MRGgen, CREATABLE>
  409. //S: Multiple Recursive [LCG] Generator 7
  410. //D: This generator has a single full cycle of length (2^31-1)^7 - 1,
  411. //D: i.e. 2^216 < cycle < 2^217.
  412. @end
  413. // C2TAUS[1-3]: short component based generator recommended for use.
  414. @protocol C2TAUSgen <SimpleRandomGenerator>
  415. //S: Combined Tausworthe generator 
  416. //D: This generator is based on 2 component generators of periods 2^31-1 and 
  417. //D: 2^29-1.
  418. @end
  419. @protocol C2TAUS1gen <C2TAUSgen, CREATABLE>
  420. //S: Combined Tausworthe generator 1
  421. //D: Component 1 parameters: P = 31, S = 12, Q = 13
  422. //D: Component 2 parameters: P = 29, S = 17, Q =  2
  423. //D: With these parameters, this generator has a single full cycle of 
  424. //D: length ~ 2^60.
  425. @end
  426. @protocol C2TAUS2gen <C2TAUSgen, CREATABLE>
  427. //S: Combined Tausworthe generator 2
  428. //D: Component 1 parameters: P = 31, S = 21, Q =  3
  429. //D: Component 2 parameters: P = 29, S = 17, Q =  2
  430. //D: With these parameters, this generator has a single full cycle of 
  431. //D: length ~ 2^60.
  432. @end
  433. @protocol C2TAUS3gen <C2TAUSgen, CREATABLE>
  434. //S: Combined Tausworthe generator 3
  435. //D: Component 1 parameters: P = 31, S = 13, Q = 13
  436. //D: Component 2 parameters: P = 29, S = 20, Q =  2
  437. //D: With these parameters, this generator has a single full cycle of 
  438. //D: length ~ 2^60.
  439. @end
  440. // C2MRG3 -- long component based generator recommended for use.
  441. @protocol C2MRG3gen <SimpleRandomGenerator, CREATABLE>
  442. //S: Combined Multiple Recursive Generator.  A combination of 2 multiple
  443. //S: recursive LCG generators.
  444. //D: Combinations of like generators are shown to have better statistical 
  445. //D: properties than single generators. The components of this generator 
  446. //D: each has two nonzero multipliers (and one that's zero). They use 
  447. //D: different moduli (2^31-1, 2145483479.)
  448. @end
  449. // C3MWC -- long component based generator recommended for use.
  450. @protocol C3MWCgen <SimpleRandomGenerator, CREATABLE>
  451. //S: Combined Multiply With Carry generator
  452. //D: This generator is a combination of 3 MWC generators, each of which is 
  453. //D: a combination of 2 16-bit Multiply-With-Carry generators. 
  454. @end
  455. // 
  456. // XXX --
  457. //   single short generator with splitting facilities.
  458. //
  459. //   (no generators in this class implemented.)
  460. //
  461. // @protocol XXXgen <SingleShortSplitGenerator, CREATABLE> @end
  462. // 
  463. // YYY --
  464. //   single long generator with splitting facilities.
  465. //
  466. //   (no generators in this class implemented.)
  467. //
  468. // @protocol YYYgen <SingleLongSplitGenerator, CREATABLE> @end
  469. @protocol C2LCGXgen <SplitRandomGenerator, CREATABLE>
  470. //S: A short component based generator with splitting facilities. Recommended.
  471. //S: This combined random generator uses 2 (PMM)LGC generators.
  472. //D: This portable generator is based on a backbone generator which is a 
  473. //D: combination of 2 (PMM)LCG generators. It has a period length of almost 
  474. //D: 2^61 (2.3e18). The backbone generator's period can be split up into a
  475. //D: number of 'virtual generators' (A), each of which can be set to access 
  476. //D: a number of 'segments' (V) of length W, subject to the constraint that 
  477. //D: A * V * W <= 2^60.
  478. @end
  479. // C4LCGX -- recommended short component based generator with splitting
  480. @protocol C4LCGXgen  <SplitRandomGenerator, CREATABLE>
  481. //S: Combined random generator using 4 (PMM)LGC generators.
  482. //D:  This portable generator is based on a backbone generator which is a 
  483. //D: combination of 4 (PMM)LCG generators. It has a period length of 
  484. //D: (m1-1)(m2-1)(m3-1)(m4-1) / 8, or almost 2^121 (2.6e36).
  485. @end
  486. // 
  487. // ZZZ --
  488. //   long component based generator with splitting facilities.
  489. //
  490. //   (no generators in this class implemented.)
  491. //
  492. // @protocol ZZZgen <CombinedLongSplitGenerator, CREATABLE> @end
  493. // 
  494. // ---------------------------------------------------------------
  495. // @class definitions for implemented generators:
  496. // 
  497. // ----- <SimpleRandomGenerator> -----
  498. // <SingleShortGenerator>
  499. @class LCG1gen;
  500. @class LCG2gen;
  501. @class LCG3gen;
  502. @class PMMLCG1gen;
  503. @class PMMLCG2gen;
  504. @class PMMLCG3gen;
  505. @class PMMLCG4gen;
  506. @class PMMLCG5gen;
  507. @class PMMLCG6gen;
  508. @class PMMLCG7gen;
  509. @class PMMLCG8gen;
  510. @class PMMLCG9gen;
  511. // <SingleLongGenerator>
  512. @class ACGgen;
  513. @class SCGgen;
  514. @class SWB1gen;
  515. @class SWB2gen;
  516. @class SWB3gen;
  517. @class PSWBgen;
  518. @class TT403gen;
  519. @class TT775gen;
  520. @class TT800gen;
  521. @class MT19937gen;
  522. @class MRG5gen;
  523. @class MRG6gen;
  524. @class MRG7gen;
  525. @class MWCAgen;
  526. @class MWCBgen;
  527. @class RWC2gen;
  528. @class RWC8gen;
  529. // <CombinedShortGenerator>
  530. @class C2TAUS1gen;
  531. @class C2TAUS2gen;
  532. @class C2TAUS3gen;
  533. // <CombinedLongGenerator>
  534. @class C2MRG3gen;
  535. @class C3MWCgen;
  536. // ----- <SplitRandomGenerator> -----
  537. // <SingleShortSplitGenerator>
  538. //   (none)
  539. // <SingleLongSplitGenerator>
  540. //   (none)
  541. // <CombinedShortSplitGenerator>
  542. @class C2LCGXgen;
  543. @class C4LCGXgen;
  544. // <CombinedLongSplitGenerator>
  545. //   (none)