|
From: | Jaroslav Hajek |
Subject: | Re: FYI: smarter indexing by logical masks |
Date: | Tue, 1 Dec 2009 08:01:50 +0100 |
On Sat, Nov 28, 2009 at 1:23 AM, Jaroslav Hajek <address@hidden> wrote:That is even better. I didn't pick up on octave caching the result in
> Not really. Let me explain how this works (not in 3.2.x though). When a
> matrix is first used in index _expression_, the internal conversion to
> index_vector is, if successful, cached for subsequent uses.
your first email. Now I don't even have to do that manually anymore
which is also a huge deal! :) When you were reporting the two times in
your benchmark, I misunderstood and thought that was about filling the
CPU cache/conditioning along the lines of timeit.m
http://blogs.mathworks.com/steve/2008/02/29/timing-code-in-matlab/
find() returning doubles is yet another case of WWMWT that I hadn't
noticed. In a sane world index vectors would map immediately to one of
the integer array types based on the architecture. At least that's how
it works in IDL. But you're right, Matlab returns doubles. WITWWMWT D:
Great work!
[Prev in Thread] | Current Thread | [Next in Thread] |