Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Idl-pvware > Re: fastest way...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 10 of 10 Topic 5618 of 6258
Post > Topic >>

Re: fastest way to find the first non-zero value in an array

by karo03de <karo03de@[EMAIL PROTECTED] > Apr 9, 2008 at 01:02 PM

On 8 Apr., 10:42, "Clemens" <yy...@[EMAIL PROTECTED]
> wrote:
> it depends on the size of array. Small array is a simple loop.
> Huge one can be :
>
> index_arr = where( arr NE 0)
> print, index_arr[0]
>
> on very huge arrays you can devide arr into big peaces.
>
> Clemens
>
> <smas...@[EMAIL PROTECTED]
> schrieb im
Newsbeitragnews:ff3bf651-8707-47e8-8cff-5e694dd5622f@[EMAIL PROTECTED]
>
> > Hi,
>
> > I want to find the first non-zero value of an array. Is there a faster
> > way to do this than with the "where" command: (where(array ne 0))[0]
> > "Where" will look for all non-zero values and I only need the first
> > one. It would be great if I could stop "where" in its search process
> > as soon as it found one element...
>
> > sebastien

What about the system function ARRAY_EQUAL ?
Karsten
 




 10 Posts in Topic:
fastest way to find the first non-zero value in an array
smasson@[EMAIL PROTECTED]  2008-04-08 01:04:48 
Re: fastest way to find the first non-zero value in an array
"Clemens" <y  2008-04-08 10:42:50 
Re: fastest way to find the first non-zero value in an array
Spon <christoph.blau@[  2008-04-08 06:03:51 
Re: fastest way to find the first non-zero value in an array
Vince Hradil <hradilv@  2008-04-08 06:15:22 
Re: fastest way to find the first non-zero value in an array
David Fanning <news@[E  2008-04-08 07:34:38 
Re: fastest way to find the first non-zero value in an array
Spon <christoph.blau@[  2008-04-08 06:56:33 
Re: fastest way to find the first non-zero value in an array
Vince Hradil <hradilv@  2008-04-08 07:02:38 
Re: fastest way to find the first non-zero value in an array
=?ISO-8859-2?Q?F=D6LDY_La  2008-04-08 16:23:04 
Re: fastest way to find the first non-zero value in an array
Rick Towler <rick.towl  2008-04-08 11:41:10 
Re: fastest way to find the first non-zero value in an array
karo03de <karo03de@[EM  2008-04-09 13:02:32 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Mon Oct 13 8:45:39 CDT 2008.