include.gens.creating.m
上传用户:shenzhenrh
上传日期:2013-05-12
资源大小:2904k
文件大小:1k
源码类别:
信息检索与抽取
开发平台:
Unix_Linux
- // include.gens.creating.m
- //
- //
- // Common code for simple generators
- // Random version 0.8
- //
- // CREATING
- -runup: (unsigned) streak {
- unsigned i;
- unsigned bitbucket;
- // Draw a number of variates from the generator:
- for (i=0; i < streak; i++)
- bitbucket = [self getUnsignedSample];
- return self;
- }
- -createEnd {
- // This test will disallow the use of [aGenerator create: aZone]
- // (user must call createBegin, setStateFromSeed, createEnd):
- if (currentCount == TESTCASE) // no instantiation chosen:
- [InvalidCombination raiseEvent:
- "%s not Initialized with a Seed!n", genName];
- getUnsignedSample =
- (unsigned (*) (id, SEL))[self methodFor: M(getUnsignedSample)];
- return [super createEnd];
- }
- //
- // include.gens.creating.m
English
