compile fct. using Goto and If (vrs. 8)
- To: mathgroup at smc.vnet.net
- Subject: [mg128047] compile fct. using Goto and If (vrs. 8)
- From: Chris <kristoph.steikert at gmail.com>
- Date: Tue, 11 Sep 2012 02:33:49 -0400 (EDT)
- Delivered-to: l-mathgroup@mail-archive0.wolfram.com
- Delivered-to: l-mathgroup@wolfram.com
- Delivered-to: mathgroup-newout@smc.vnet.net
- Delivered-to: mathgroup-newsend@smc.vnet.net
Hi Below I post some rudimentary and insubstantial code. My basic question is why the command Goto does not work properly when used in an if statement in a compile function. Does anybody know a way around this problem? Thanks in advance. Chris toy=Compile[{{x,_Real}}, Label[t]; y=RandomReal[{-1.,1.}]; If[x*y<-0.,Print[y*x];Goto[t],Print[y*x," ","done"]] ];