MathGroup Archive 2004

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

Search the Archive

Re: again Compile

  • To: mathgroup at smc.vnet.net
  • Subject: [mg52531] Re: again Compile
  • From: Peter Pein <petsie at arcor.de>
  • Date: Wed, 1 Dec 2004 05:57:50 -0500 (EST)
  • References: <cohiav$1gv$1@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

Joerg Schaber wrote:
> Hi,
> 
> In a Compiled Function I have the construct
> 
> p = Position[Thread[(#1 < #2 < #3) &[lb, x, ub]], False];
> 
> gives me the error message
> 
> "Symbol not supported for type True|False"
> 
> What's the problem here. Can't I use another function definition in a 
> Compiled Function?
> 
> Best,
> 
> joerg
> 
Hi Jörg,

In the moment I see nothing better than substituting the boolean 
constants by integers:

test = Compile[{{l, _Integer}, {x, _Integer, 1}, {u, _Integer}},
     p = Position[Thread[l < x < u] /. {True -> 1, False -> 0}, 0],
   {{p, _Integer, 2}}]

test[3, Range[10], 8]
   {{1}, {2}, {3}, {8}, {9}, {10}}
-- 
Peter Pein
10245 Berlin


  • Prev by Date: Re: Finding the Fourier transform of discrete functions
  • Next by Date: Getting at an AutoGenerated Package
  • Previous by thread: Re: Finding the Fourier transform of discrete functions
  • Next by thread: Getting at an AutoGenerated Package