Compiled function not working
- To: mathgroup at smc.vnet.net
- Subject: [mg110445] Compiled function not working
- From: Fred Bartoli <myname_with_a_dot_inbetween at free.fr>
- Date: Fri, 18 Jun 2010 07:44:12 -0400 (EDT)
- Reply-to: myname_with_a_dot_inbetween at free.fr
Hello, I've a function that I need compiled for better performances. ZsNoR[n_]=(3 4^(1+n))/(2+4^(1+n)) cf=Compile[{{code,_Integer},{nb,_Integer}},Module[{SwList=Reverse@IntegerDigits[code,2,nb]},\!\( \*UnderoverscriptBox[\(\[Sum]\), \(i = 0\), \(nb - 1\)] \*FractionBox[\(1\), \(ZsNoR[Part[SwList, i + 1]]\)]\)]] cf[128,8] But when I evaluate cf I get a "CompiledFunction::cfse: Compiled expression 8/3 should be a machine-size integer" error message that make no sense to me. What am I doing wrong? -- Thanks, Fred.