next up previous

Exercise 8: Vectorization of Cray's LCG.

Complete Exercise 6 above to determine the parameters a and m (probably ) of Cray's ranf(). Develop a vectorized version of ranf() by creating a vector of successive multiples of the coefficient a. For a vector length of 64, for example, you will need a vector of (). Race your vectorized version of ranf() vs. Cray's ranf(), and see how close you can come to their execution time. To do this, you will have to generate long vectors of random numbers, and use them elsewhere in the code. Use second() to obtain elapsed CPU time.