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 2004

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

Search the Archive

Re: Compile ReplacePart

  • To: mathgroup at
  • Subject: [mg52559] Re: [mg52545] Compile ReplacePart
  • From: Jörg Schaber <schaber at>
  • Date: Thu, 2 Dec 2004 02:21:09 -0500 (EST)
  • References: <>
  • Sender: owner-wri-mathgroup at

Well, I am afraid that the specific code line will not really help you, 
but here it is:

Compile[ .....

p = CheckXBounds[x, lb, ub];
x = ReplacePart[x, new, p, p];
 where p is of the same form as is returned by the function Position.

The code works perfectly well, when is is not part of a Compiled Function.



yehuda ben-shimol wrote:

>It is difficult to comment to your posting without an exact reference to the
>line (or block of code) that caused the problem. Can you send it so we will
>be able to figure out what is wrong?
>-----Original Message-----
>From: Joerg Schaber [mailto:schaber at] 
To: mathgroup at
>Sent: Wednesday, December 01, 2004 12:59 PM
>To: mathgroup at
>Subject: [mg52559] [mg52545] Compile ReplacePart
>using ReplacePart with 4 arguments in a Compiled Function gives me the 
>error 'ReplacePart::argrx: ReplacePart called with 4 arguments; 3 
>arguments are expected', even though ReplacePart is defined also for 4 
>arguments in regular Mathematica code.
>What's the problem here?

Jörg Schaber
Max Planck Institute for Molecular Genetics
Ihnestrasse 63-73, 14196 Berlin, Germany
Phone: +49 30 804093 19, Fax: +49 30 804093 22

  • Prev by Date: Compiled function with NIntegrate
  • Next by Date: Re: GUIKit and VisibleRect
  • Previous by thread: Re: Compile ReplacePart
  • Next by thread: Re: Compile ReplacePart