Re: Finding maximum of an array
- From: Eric Grange <egrangeNO@xxxxxxxxxxxxxxx>
- Date: Mon, 21 Apr 2008 18:04:47 +0200
> I have a huge matrix of single values all between 0 and 1 and I am looking for the
highest value.
FWIW if you could add 1.0 to those values in a cheap fashion (ie. if it doesn't have to be done all the time for all values, but can be cached in some way), then you can use integer comparisons on the floats directly, as the representation of floating point numbers ensures that for values >=1.0 the ordering is correct.
ie. you could replace
(ARow[j] >= RX)
with
RX_seen_as_integer := PInteger(@RX)^
...
(PInteger(@ARow[j])^ >= RX_seen_as_integer)
Eric
.
- References:
- Finding maximum of an array
- From: Richard Lavoie
- Re: Finding maximum of an array
- From: John Herbster
- Re: Finding maximum of an array
- From: Richard Lavoie
- Finding maximum of an array
- Prev by Date: Re: Finding maximum of an array
- Next by Date: Re: Finding maximum of an array
- Previous by thread: Re: Finding maximum of an array
- Next by thread: Re: Finding maximum of an array
- Index(es):
Relevant Pages
|