[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: 'for' loop vectorization
From: |
Jordi Gutiérrez Hermoso |
Subject: |
Re: 'for' loop vectorization |
Date: |
Tue, 23 Oct 2007 15:57:01 -0500 |
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.
- Jordi G. H.