Declaration: RandomFillVector(var Vec: TDoubleArray; Mode: integer; Mean, Range: double): integer;);
Fills the dynamic array Vec with random numbers whose properties are controlled by the parameters Mode, Mean and Range. The Mode parameter controls whether uniformly distributed random numbers are generated (Mode = 0) or normally distributed random numbers (Mode = 1).

Depending on the type of distribution the other parameters have different meanings:

Distribution Uniform (Mode=0) Normal (Mode=1)
Mean median of the distribution mean of the distribution
Range range of the distribution standard deviation

Example: The statement RandomFillVector (MyVec,0,100,20); fills the vector MyVec with uniformly distributed random numbers in the range between 90 and 110 (= Median +/- Range/2

Last Update: 2017-Mai-26