Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.soft-sys.math.mathematica > #3384 > unrolled thread
| Started by | DrMajorBob <btreat1@austin.rr.com> |
|---|---|
| First post | 2011-06-29 21:45 +0000 |
| Last post | 2011-06-29 21:45 +0000 |
| Articles | 1 — 1 participant |
Back to article view | Back to comp.soft-sys.math.mathematica
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
Re: Problem with Compile DrMajorBob <btreat1@austin.rr.com> - 2011-06-29 21:45 +0000
| From | DrMajorBob <btreat1@austin.rr.com> |
|---|---|
| Date | 2011-06-29 21:45 +0000 |
| Subject | Re: Problem with Compile |
| Message-ID | <iug6ct$9jo$1@smc.vnet.net> |
g = Compile[{{z, _Integer}},
NestWhileList[# + z &, 0, # < 10 &, 1,
9], {{NestWhileList[__], _Integer, 1}}];
g[1]
{0, 1, 2, 3, 4, 5, 6, 7, 8, 9}
Bobby
On Tue, 28 Jun 2011 06:55:48 -0500, Arthur Evans <24evansa@gmail.com>
wrote:
> 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
>
--
DrMajorBob@yahoo.com
Back to top | Article view | comp.soft-sys.math.mathematica
csiph-web