MathGroup Archive 2006

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

Search the Archive

Compile RandomArray

  • To: mathgroup at
  • Subject: [mg72418] Compile RandomArray
  • From: Alberto Verga <Alberto.Verga at>
  • Date: Wed, 27 Dec 2006 05:31:06 -0500 (EST)


Compilation of the following function fails:

cf1 = Compile[{{n, _Integer}},
Module[{dtn = 0.1,
        noise = RandomArray[NormalDistribution[0, 1], {n, n }]},
dtn Fourier[noise]], {{Fourier[_], _Complex, 2}}];

the same function with a table of Random[] numbers can be compiled without 

cf = Compile[{{n, _Integer}},
Module[{dtn = 0.1,
        noise = Table[Random[Real, {-1, 1}], {n}, {n}]},
dtn Fourier[noise]], {{Fourier[_], _Complex, 2}}];

I tried several modifications of cf1 (adding information about RandomArray 
in a third argument of Compile[], for exampe) without success. Perhaps 
someone knows how to compile with 'external' functions like this one.

Alberto Verga

  • Prev by Date: Re: List Manipulation
  • Next by Date: Re: List Manipulation
  • Previous by thread: How can I solve these equations using mathematica?
  • Next by thread: Re: Stylesheets vs. DTDs or XML Schemas