On May 14, 10:10pm, N8TM wrote:
> Subject: Re: Extension of {MIN,MAX}{LOC,VAL} to LOGICAL arrays?
> In a message dated 5/14/98 7:15:48 AM Pacific Daylight Time,
> [log in to unmask] writes:
>
>
> Thanks for both suggestions. Both, however, are likely to
> create large temporary arrays
> _____________________________
> There are enough such situations that the compiler writers should be motivated
> to find a way to optimize them e.g.
>
> MAXLOC(ABS(X(1:n)))
>
> isn't too slow on the SGI 7.2 compiler, although it is dead slow on some
> others. Supposing that such expressions expand initially into a sequence of
> DO loops, a decent optimizer should be able to fuse them and come up with
> reasonable results.
The key diff between an example like this and MAXLOC(logical_array)
is that the latter doesn't have to look at all the elements -- it
can stop if/when it finds the first .TRUE.
-P.
--
*********** 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 *
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|