MathGroup Archive 2004

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

Search the Archive

Re: Alternative to defining 'operator' function?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg47591] Re: Alternative to defining 'operator' function?
  • From: Bill Rowe <readnewsciv at earthlink.net>
  • Date: Fri, 16 Apr 2004 05:22:13 -0400 (EDT)
  • Sender: owner-wri-mathgroup at wolfram.com

On 4/15/04 at 3:39 AM, H.L.Owen at dl.ac.uk (Owen, HL (Hywel)) wrote:

>I often have programming problem where I'd like to calculate a set
>of dot products, e.g. applying a list of square matrices
>{R1,R2,R3...} to a vector v to obtain:

>{R1.v,R2.R1.v,R3.R2.R1.v,...}

>or other functions like that.

>The method I've been using is to define an 'operator' function,
>e.g.

>DotOperator[M_] := Dot[M, #] &

>Is there a simpler way than this that doesn't involve defining
>functions like DotOperator?

I would consider the following simpler

(#.v)&/@{R1,R2,R3, ...}

But since the only real difference is I didn't explicitly define a function like DotOperator, I don't know this meets your criteria above.
--
To reply via email subtract one hundred and four


  • Prev by Date: Re: How to check if a file exists?
  • Next by Date: Re: When Is Precision[ ] $MachinePrecision, And When Is It Not?
  • Previous by thread: Re: Alternative to defining 'operator' function?
  • Next by thread: Re: Alternative to defining 'operator' function?