Mathematica 9 is now available
Services & Resources / Wolfram Forums
MathGroup Archive
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2005

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

Search the Archive

unable to compile function with Part as an argument

  • To: mathgroup at
  • Subject: [mg55701] unable to compile function with Part as an argument
  • From: jules at (Julian)
  • Date: Mon, 4 Apr 2005 00:59:08 -0400 (EDT)
  • Sender: owner-wri-mathgroup at

Hi Folks,

I have got a fairly complex program which I am trying to compile as it's
quite numerically intensive, but I am running into problems when passing
in a value that comes from an array.

I've boiled it down to a toy example which illustrates what is going wrong.
why the following code fails to compile?

Developer`SetSystemOptions["CompileReportExternal" -> True]

"CompileReportExternal" -> True

f[x_] = Log[x]


Compile[{{v, _Real, 1}}, f[Part[v, 1]]]

From In[4]:=
Compile::"extscalar": "\!\(f[\(\(v \[LeftDoubleBracket] 1 \
\[RightDoubleBracket]\)\)]\) cannot be compiled and will be evaluated \
externally.  The result is assumed to be of type \!\(Real\)."

  f[v\[LeftDoubleBracket]1\[RightDoubleBracket]], "-CompiledCode-"]

Any help would be greatly appreciated.

Thanks & regards,

  • Prev by Date: Re: MultipleListPlot Prolem
  • Next by Date: cannot evaluate HelpBrowser input cells
  • Previous by thread: Re: Use of mathlink in C++
  • Next by thread: cannot evaluate HelpBrowser input cells