Mathematica 9 is now available
Services & Resources / Wolfram Forums / MathGroup Archive
-----

MathGroup Archive 2011

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

Search the Archive

Problem with Compile

  • To: mathgroup at smc.vnet.net
  • Subject: [mg119889] Problem with Compile
  • From: Arthur Evans <24evansa at gmail.com>
  • Date: Tue, 28 Jun 2011 07:55:48 -0400 (EDT)

Dear Mathgroup,

I am having some problems with Compile.

Here the below expression compiles and executes as expected

f = Compile[{{z, _Integer}}, NestList[# + z &, 0, 9]];
f[1]

Out[89]={0, 1, 2, 3, 4, 5, 6, 7, 8, 9}


But this one gives an error

g = Compile[{{z, _Integer}},NestWhileList[# + z &, 0, # < 10 &, 1, 9]]
g[1]

CompiledFunction::cfse: Compiled expression {0,1,2,3,4,5,6,7,8,9}
should be a machine-size integer. >>

CompiledFunction::cfex: Could not complete external evaluation at
instruction 1; proceeding with uncompiled evaluation. >>

Any help is appreciated.

Regards,

Arthur


  • Prev by Date: how to visualize unstructured data
  • Next by Date: Remote presentation clicker for mathematica slideshows.
  • Previous by thread: Re: How to find the difference between two lists (opposite of union[]?)
  • Next by thread: Re: Problem with Compile