Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!ucsd!ucbvax!bloom-beacon!oliver From: oliver@athena.mit.edu (James D. Oliver III) Newsgroups: comp.lang.fortran Subject: Re: Random Number Functions--Generate versus Input Message-ID: <1990Nov8.215752.7075@athena.mit.edu> Date: 8 Nov 90 21:57:52 GMT References: <1990Nov8.170334.24579@athena.mit.edu> Sender: daemon@athena.mit.edu (Mr Background) Organization: Massachusetts Institute of Technology Lines: 21 I guess I need to make this clear: the random number genertor itself is vectorizable, however, the values of interest to me are *functions* of these randome variables. To be more specific, I'm generating a series of randomly oriented 3-D unit vectors. The fastest way to do this is to generate two random numbers for x and y and calculate z as long as x**2 + y**2 <= 1. This process, however, involves a conditional loop back to the ranf() function and thus is not vectorizable. However, the fact that this method is not vectorizable is just of incidental interest, since it remains the fastest way of doing it. What I'd like to know is, *given* this way of generating my values, should I expect it to be faster than reading the values from a file? Like I said, for this particular case I can run a benchmark, but I was wondering if there was a general rule of thumb for the speed of I/O operations. -- ____________________________ Jim Oliver oliver@athena.mit.edu / joliver@hstbme.mit.edu oliver%mitwccf.BITNET@MITVMA.MIT.EDU