Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2006
*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 2006

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

Search the Archive

Compile RandomArray

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

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