Path: news.mathworks.com!newsfeed-00.mathworks.com!newscon02.news.prodigy.net!prodigy.net!border1.nntp.dca.giganews.com!nntp.giganews.com!local02.nntp.dca.giganews.com!nntp.comcast.com!news.comcast.com.POSTED!not-for-mail
NNTP-Posting-Date: Tue, 06 May 2008 11:11:53 -0500
From: richardstartz@comcast.net
Newsgroups: comp.soft-sys.matlab
Subject: Speeding up sum of squares
Date: Tue, 06 May 2008 09:11:51 -0700
Message-ID: <fm012450tjat7jgv5hqhtiokid3ketdsgj@4ax.com>
X-Newsreader: Forte Agent 3.3/32.846
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Lines: 16
X-Usenet-Provider: http://www.giganews.com
NNTP-Posting-Host: 67.183.112.173
X-Trace: sv3-i1CjFsjGQ5PLPnBO9qmzfJpHUwJR/Y6Zhmpm8uDCQC46RwBhLYZRYGnqDvFu8N/qcWL7oNXrNP7x52s!Vh2hrUtFGWNxI5x5UAngI5ejdkyyeSMim0Phx5RLxd78g7O3yMG2GUIqYfbqfMCv6eTjkqmKTmxx!r1SqejCRAxVRsfXCR1uT2MjgpMMf
X-Complaints-To: abuse@comcast.net
X-DMCA-Complaints-To: dmca@comcast.net
X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers
X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly
X-Postfilter: 1.3.39
Bytes: 1376
Xref: news.mathworks.com comp.soft-sys.matlab:466947


I have a problem where most of the computational time is spent
computing

sum(x.^2)

where x is a vector of length between 100 and 10,000.

It seems I can speed up computation some by using 

x'*x

instead.

Any thoughts or suggestions on further speed improvement?
Thanks.
-Dick Startz