MathGroup Archive 2006

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

Search the Archive

Re: x=2;Composition[f,FindMinimum][x+1,{x,a}]

  • To: mathgroup at smc.vnet.net
  • Subject: [mg68344] Re: x=2;Composition[f,FindMinimum][x+1,{x,a}]
  • From: "Chris Chiasson" <chris at chiasson.name>
  • Date: Tue, 1 Aug 2006 07:00:24 -0400 (EDT)
  • References: <eake8e$qu9$1@smc.vnet.net> <44CDE2C3.6060902@gmail.com> <acbec1a40607310518n3892e017h607c5efe958c3479@mail.gmail.com>
  • Sender: owner-wri-mathgroup at wolfram.com

I had said:

>Due to the Attributes of Composition, one would think that
>Composition[FindMinimum][args] would cause args to be evaluated before
>being caught by FindMinimum's HoldAll. But no. For some reason, it
>behaves like FindMinimum[args] - some sort of short circuit for
>performance reasons? Perhaps this optimization should be documented
>(or maybe it already is and I am too blind to find it).

As Carl Woll reminded me: The above is actually perfectly normal
evaluation of the head before the body. The reason
Composition[f,FindMinimum][args] doesn't behave like
f[FindMinimum[args]] is that the evaluation of the head returns
Composition[f,FindMinimum], which obvously doesn't have the HoldAll
attribute because it is an expression.

I regret chastising the documentation team when I should have chastised myself.

On 7/31/06, Chris Chiasson <chris at chiasson.name> wrote:
> I was testing to see if I could get around the HoldAll Attribute of
> FindMinimum by using Composition.
>
> Due to the Attributes of Composition, one would think that
> Composition[FindMinimum][args] would cause args to be evaluated before
> being caught by FindMinimum's HoldAll. But no. For some reason, it
> behaves like FindMinimum[args] - some sort of short circuit for
> performance reasons? Perhaps this optimization should be documented
> (or maybe it already is and I am too blind to find it).
>
> However, based on a Trace someone kindly sent to me,
> Composition[f,FindMinimum][args] in the older versions do cause the
> arguments to be evaluated before FindMinimum's HoldAll takes effect.
>
> It's just that in the latest version, if f does not also have the
> attribute HoldAll, then the kernel crashes...
>
> Darned if one does, and darned if one doesn't - at least in 5.2 :-)
>
> --
> http://chris.chiasson.name/
>


-- 
http://chris.chiasson.name/


  • Prev by Date: Re: Using implicit information about row indices
  • Next by Date: Re: Using implicit information about row indices
  • Previous by thread: Re: x=2;Composition[f,FindMinimum][x+1,{x,a}]
  • Next by thread: Re: x=2;Composition[f,FindMinimum][x+1,{x,a}]