Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
1998
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 1998

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

Search the Archive

Re: Compile and NormalDistribution

  • To: mathgroup at smc.vnet.net
  • Subject: [mg15182] Re: [mg15187] Compile and NormalDistribution
  • From: Andrew Watson <abwatson at mail.arc.nasa.gov>
  • Date: Fri, 18 Dec 1998 23:20:24 -0500
  • Sender: owner-wri-mathgroup at wolfram.com

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