Path: news.mathworks.com!newsfeed-00.mathworks.com!newscon02.news.prodigy.net!prodigy.net!nx02.iad01.newshosting.com!newshosting.com!216.196.98.140.MISMATCH!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 12:32:47 -0500
From: richardstartz@comcast.net
Newsgroups: comp.soft-sys.matlab
Subject: Re: Speeding up sum of squares
Date: Tue, 06 May 2008 10:32:45 -0700
Message-ID: <bh5124p9ikki4v4hek8vc3hgs0at4qi0vo@4ax.com>
References: <fm012450tjat7jgv5hqhtiokid3ketdsgj@4ax.com> <fvq0qr$7tv$1@fred.mathworks.com> <1v2124dbkuukhhprui7a8ss4vhmtgn3jcg@4ax.com> <fvq421$p13$1@fred.mathworks.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: 38
X-Usenet-Provider: http://www.giganews.com
NNTP-Posting-Host: 67.183.112.173
X-Trace: sv3-WAZExGDRrnEn5e+WoKc48ZPGyz+4odkNTBpOLX005/9ucOLnxhku3gdnhBh97lhfdv79ngjq4TQ2ij2!4xAxJId8e5u6fq6Q7ODvx9bAkN0tdKEtSxrCKS0cyrG3lc8XLjxcg9naMcwnx0SC82wnlUVxzKM3!4CgA2QfKrPjn4V74EhJNTcMfDhEw
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: 2398
Xref: news.mathworks.com comp.soft-sys.matlab:466970


On Tue, 6 May 2008 17:21:05 +0000 (UTC), "John D'Errico"
<woodchips@rochester.rr.com> wrote:

>richardstartz@comcast.net wrote in message 
><1v2124dbkuukhhprui7a8ss4vhmtgn3jcg@4ax.com>...
>
>> Thank you, John.
>> 
>> I have real column vectors, so it looks like your last suggestion will
>> speed things up my nearly an order of magnitude. That would be really
>> great.
>> 
>> If you have a minute, could you explain what it is that @() x'*x does
>> and why it makes such a difference, or point me to the right stuff to
>> read?
>> 
>> -Dick Startz
>> 
>> PS If it matters, I'm running 2007B on a dual processor Windows
>> machine.
>> 
>> PPS What's timeit()?
>
>timeit is a function from the file exchange,
>written by Steve Eddins. Its a better way to
>time code fragments than using tic and toc.
>
>The product x'*x uses blas routines to speed
>up the inner product. They are clearly much
>more highly optimized than is the code
>matlab produces for sum(x.^2). Bruno
>pointed out that norm(x)^2 also is fairly fast.
>I assume that it too is well optimized.
>
>John
>
Thanks again. I got it now.
-Dick Startz