comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: The IDL way: Find last non-zero value
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: The IDL way: Find last non-zero value [message #67737 is a reply to message #67729] Mon, 24 August 2009 13:42 Go to previous messageGo to previous message
Eric Hudson is currently offline  Eric Hudson
Messages: 19
Registered: June 2006
Junior Member
Thanks to all of you for the suggestions. I timed them all on several
of the larger matrices and found that the last suggestion (using
cumulative totals) was about twice as fast as the previous ones, and
about 5 times faster than the brute force loop. It did depend on how
many zeros ended each line on average. When the number was small the
loop could win, but for my typical matrices the cumulative total is
the clear winner.

Thanks again,
Eric
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: Histogram Too Many Array Elements
Next Topic: Integer - decimal help

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Fri Oct 10 05:09:55 PDT 2025

Total time taken to generate the page: 0.24038 seconds