> On May 15, 12:29am, Robin Vowels wrote:
> > Subject: Re: Extension of {MIN,MAX}{LOC,VAL} to LOGICAL arrays?
> >
> > [ plain text
> > Encoded with "quoted-printable" ] :
> i = lbound(array)
> > do while (array(i))
> > i = i + 1
> > if (i > ubound(array) exit
> > end do
> >
> > is likely to be shade faster....
> > ----------
> > > Thanks for both suggestions. Both, however, are likely to
> > > create large temporary arrays and be considerably slower than
> > > DO i=1,SIZE(array)
> > > IF( .NOT. array(i) )EXIT
> > > END DO
>
>
> Why? Because you don't have to enter the loop body if the first
> element is .FALSE. ?
> -P.
No, it's because the loop has one lesss operation in it. The array
element is not complemented in the test.
>
>
>
> --
> *********** How can we have ethnic music without ethnic hatred? ***********
> * Peter S. Shenkin; Chemistry, Columbia U.; 3000 Broadway, Mail Code 3153 *
> ** NY, NY 10027; [log in to unmask]; (212)854-5143; FAX: 678-9039 ***
> *MacroModel WWW page: http://www.columbia.edu/cu/chemistry/mmod/mmod.html *
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|