MathGroup Archive 2006

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

Search the Archive

Compile RandomArray


Hi

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 
difficulty:

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.

Thanks,
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