[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: 'for' loop vectorization
From: |
John W. Eaton |
Subject: |
Re: 'for' loop vectorization |
Date: |
Tue, 23 Oct 2007 17:12:07 -0400 |
On 23-Oct-2007, Jordi Gutiérrez Hermoso wrote:
| On 23/10/2007, Hermann Schwarting <address@hidden> wrote:
| > The more I think about it, it looks like I can't vectorize this. It's
| > a bit similar to a cumulative maximum, which can't be vectorized
| > either, I think.
|
| It can be, but my vectorisation runs slower than the unvectorised code. :-(
|
| a = max(triu(repmat(a(:),1,length(a))))
|
| The triu call is the bottleneck, it seems, which mystifies me.
The triu function is a .m file with a for loop.
jwe