> Date: Thu, 24 Mar 2005 08:15:34 +0800
> Reply-to: Fortran 90 List <[log in to unmask]>
> From: Daniel and Nicola Grimwood <[log in to unmask]>
> Subject: Re: maxloc of a logical array
> To: [log in to unmask]
> Thanks guys,
>
> yes I was thinking in terms of 0 and 1. I agree with them not having an
> ordering now that it's been pointed out. Van, I was after the location of
> the first true element, not just any() or all().
Then MAXLOC and MINLOC would be slow for this purpose -
even if you used a mask (because the entire array would have to be
searched).
Your hand-coded loops are faster for locating the first logical .true.,
because the search halts as soon as the first .true. value is found.
> Regards,
> Daniel.
>
> ---------------------------------------------------------------------
> Dr. Daniel Grimwood Room : 305.208
> Nanochemistry Research Institute Email: [log in to unmask]
> Curtin University of Technology Phone: +61 8 9266 3204 (office)
> P.O. Box U 1987, Perth +61 8 9266 3780 (lab)
> Western Australia, 6845 Australia Fax : +61 8 9266 4699
>
|