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
- Follow-Ups:
- Re: Problem with Compile
- From: Leonid Shifrin <lshifr@gmail.com>
- Re: Problem with Compile
- From: DrMajorBob <btreat1@austin.rr.com>
- Re: Problem with Compile