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
>
> -P.
>
> On May 14, 9:52am, Carol Munroe - SMCC High Performance Computing wrote:
> > Subject: Re: Extension of {MIN,MAX}{LOC,VAL} to LOGICAL arrays?
> > I think a simpler and more general solution is MINLOC(MERGE(1,0,array)).
> >
> >
> > Date: Thu, 14 May 1998 07:41:54 -0400
> > Subject: Re: Extension of {MIN,MAX}{LOC,VAL} to LOGICAL arrays?
> > From: [log in to unmask] (William F Mitchell)
> ...
> > MINLOC( (/ (1,i=1,SIZE(array)) /), .NOT. array )
> ...
>
> --
> *********** 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 *
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|