MathGroup Archive 2006

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

Search the Archive

Why Does Repeated Dot Product Take So Long?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg67938] Why Does Repeated Dot Product Take So Long?
  • From: Gregory Lypny <gregory.lypny at videotron.ca>
  • Date: Mon, 17 Jul 2006 06:51:55 -0400 (EDT)
  • Sender: owner-wri-mathgroup at wolfram.com

Hello Everyone,

x and y are both 2000 x 3 matrices.  I wanted to created a 2000 x 1  
vector with each element equal to the dot product of the  
corresponding rows of x and y.  So I tried this:

Table[x[[i]].y[[i]], {i, 1, 2000}]

It took more than two and a half minutes on my iBook G4.  Is that  
normal?  I've done seemingly more demanding computations in Do loops  
and Tables that are completed in a split second.  Am I doing  
something wrong with this one?

Regards,

	Gregory


  • Prev by Date: RE: log scaling axes
  • Next by Date: NDSolve Problems
  • Previous by thread: RE: Best testing framework?
  • Next by thread: Re: Why Does Repeated Dot Product Take So Long?