MathGroup Archive 2005

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

Search the Archive

Re: Thread behaviour

  • To: mathgroup at smc.vnet.net
  • Subject: [mg57952] Re: Thread behaviour
  • From: "Jens-Peer Kuska" <kuska at informatik.uni-leipzig.de>
  • Date: Tue, 14 Jun 2005 05:10:17 -0400 (EDT)
  • Organization: Uni Leipzig
  • References: <d8jlgk$stn$1@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

Hi,

Mathematica evaluates the inner expession first 
and
so
Thread[k[a+b,c d],Plus]

evaluates first to

Thread[(a+b)^2+(c*d)^2,Plus]

and than there is nothing to thread any more

Regards
  Jens

"Dick Barends" <dick.barends at wxs.nl> schrieb im 
Newsbeitrag news:d8jlgk$stn$1 at smc.vnet.net...
> Hallo,
>
> k[x_,y_] = x^2+y^2
> Thread[k[a+b,c d],Plus]
> gives: (a+b)^2+c^2 d^2
> I would expect: a^2 + (c d)^2 + b^2 + (c d)^2 
> (See below)
>
> -----------------
> When I use:
> Thread[m[a+b, c d],Plus]
> gives: m[a, c d] + m[b, c d]
> This is what should happen.
>
> What gives "m" a different solution than "k"????
>
> I hoop some of you will answer:-)
>
> greetings
> Dick
> 



  • Prev by Date: Re: ArrayPlot: ColorRules v. ColorFunction
  • Next by Date: Re: Q: Thread behaviour
  • Previous by thread: Re: spotlight escape sequences
  • Next by thread: For Loop and Array related