MathGroup Archive 2007

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

Search the Archive

Dot or Inner ... but not quite

  • To: mathgroup at smc.vnet.net
  • Subject: [mg79622] Dot or Inner ... but not quite
  • From: "Diamond, Mark" <dot at dot.dot>
  • Date: Tue, 31 Jul 2007 06:13:49 -0400 (EDT)

I have two equi-length lists, the first of number, the second of 
(equi-length) lists of numbers , such as

l1={1,4,3};
l2={{1,7},{1,9},{5,2}};

I want to produce 1*{1,7}+4*{1,9}+3*{5,2}

It looks so close to Inner that I thought I could use it in some form, but I 
have ended up using

(#[[1]]*#[[2]])& /@ Transpose[{l1,l2}]

Is there a better way using one of the builtin functions with which I am 
unfamiliar?

Cheers,

Mark Diamond 




  • Prev by Date: Debugger tutorial
  • Next by Date: Re: Unbearably slow plotting (v6)
  • Previous by thread: Debugger tutorial
  • Next by thread: Re: Double Integration involving Struve and Neumann functions..(Corrections in my code)