[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Vectorization question



In fact, my first idea was to try Histogram to do this. But I could
never claim I reached perfection with it, as Craig did.
I tested the code, and here are the results (once I converted A and B to
FLOAT to clear the embarassing "floating illegal operand" that was
produced by my code when operating on LONG type arrays):

IDL> liam, a, b, x
% Array requires more memory than IDL can address.
% Execution halted at:  LIAM               40 untitled_1.pro
%                       $MAIN$                 
IDL> pavel, a, b, x, iter=10
       5.6166667
IDL> craig, a, b, x, iter=10
       4.7333333

Just as I expected, Craig's code is more efficient than mine (the magic
of Histogram!). Good answer to those "when to use a loop" questions.
IDL 5.3, PowerMac G4-400.
Cheers,
Pavel