MathGroup Archive 1996

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

Search the Archive

Help - Compile[] problems

  • To: mathgroup at
  • Subject: [mg4871] Help - Compile[] problems
  • From: frankeye at (FrankEye)
  • Date: Thu, 26 Sep 1996 22:42:25 -0400
  • Organization: America Online, Inc. (1-800-827-6364)
  • Sender: owner-wri-mathgroup at

Apparently, either Compile[] has trouble inferring variable types, or I
don't well understand how to use it.  Insights wanted -- TIA.  

Here's the problem, with code snippets below.  I'm trying to compile an
expression, which is a function which takes arguments and passes into a

{sigma2,_Real},{torflag,_Integer},{nsweeps, _Integer}},


...etc...{stuff which causes no problem for Compile[]}...

For[m=1, m<=npix, m++, 
   i=indices[[m,1]]; j=indices[[m,2]];
(* indices is a rank-2 matrix of integer indices *)
   storem=Flatten[ image[[ Range[i-halfWts,i+halfWts],
                        Range[j-halfWts,j+halfWts] ]] ];

So, I try to Enter this Compile[] request, and get back messages such as
the following:

    "Range[i-halfWts,i+halfWts] at position <<2>> of 
image[[ Range[i-halfWts,i+halfWts],
                        Range[j-halfWts,j+halfWts] ]]
should be either a non-zero integer or a vector of non-zero integers;
evaluation will use the uncompiled function."

Well, I thought that my declaration of sub-expression types in the
trailing portion of the Compile[] request would tell Mathematica what it
is apparently not understanding.  I *am* using Version 3.0 beta 3.  

What am I doing that is wrong?  Would the more bulletproof version 2.2.2


Frank J. Iannarilli, Jr.
frankeye at  OR franki at


  • Prev by Date: Re: functional code
  • Next by Date: Length of cubic polynomial (spline) ?
  • Previous by thread: Different Plots in the Same Window?
  • Next by thread: Length of cubic polynomial (spline) ?