MathGroup Archive 1998

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Compile and NormalDistribution


At 11:11 PM -0800 12/17/98, Brett Patterson wrote:
>Hi,
>
>I am trying to speed up the generation of a large array of random
>complex Gaussian numbers (e.g. 360 x 360).


How about:

In[1]:=
<<Statistics`ContinuousDistributions`

gaussianArray[n_] :=
	RandomArray[NormalDistribution[0.0, 1.0],{n,n}]  +
	 I  RandomArray[NormalDistribution[0.0, 1.0],{n,n}]


In[6]:=
Timing[tmp=gaussianArray[128] ;]

Out[6]=
{1.26667 Second,Null}

In[5]:=
tmp[[1,1]]

Out[5]=
-1.25342-0.570081 I


Andrew B. Watson
MS 262-2
NASA Ames Research Center
Moffett Field, CA 94035-1000
(650) 604-5419	(650) 604-0255 fax
abwatson at mail.arc.nasa.gov	http://vision.arc.nasa.gov/


  • Prev by Date: Including Mathematica notebooks in LaTeX
  • Next by Date: Question about how Contex resolving works in Mathematica
  • Previous by thread: Compile and NormalDistribution
  • Next by thread: Re: Compile and NormalDistribution