[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: vectorization help
From: |
Jordi Gutiérrez Hermoso |
Subject: |
Re: vectorization help |
Date: |
Tue, 4 Oct 2011 00:34:04 -0500 |
2011/10/3 Jordi Gutiérrez Hermoso <address@hidden>:
> On 3 October 2011 18:26, Liam Groener <address@hidden> wrote:
>> On Oct 3, 2011, at 12:10 PM, William Krekeler wrote:
>>
>> Thanks for the useful and very informative response. That definitely works.
>> I'll have to read more on broadcasting to see if I can apply it elsewhere.
>>
>> My code has to be cross-compatible with ML. As an FYI the bsxfun version
>> will work in matlab 7.8.0.347:
>> Cube = bsxfun(@rdivide, permute(RC, [1, 3, 2]), Cube);
>>
>> I'm curious; does this actually save any significant time over your for loop
>> version?
>
> Actually, it doesn't. It's in fact slower!
I'm sorry, please ignore what I just said. This is very embarrassing,
but I was tick-tocking the permute() calls as well in the sample code
I posted, which accounted for the difference in time.
I still do see slowness in bsxfun, and I'm trying to pinpoint its cause.
- Jordi G. H.