Re: Finding maximum of an array
- From: "Richard Lavoie" <somone@xxxxxxxxxxxxx>
- Date: Mon, 21 Apr 2008 10:54:35 -0400
(1) Changing the ">=" to ">" and "N to M" to "M downto N",
Interesting idea. I implemented it, but saw no change in performance. But
my guess is that it will only affect the performance when many numerical
values are equal. So sometimes it will make a slight difference.
(2) Change the problem to an integer problem by making a lossless
transformation
Interesting also, but harder to do. I would get an improvement of about 30%
but it would require a lot of changes.
I'm not sure about the other ones, so here are what I try to achieve.
I need to perform a hierarchical clustering from a distance matrix. I have a
huge matrix of single values all between 0 and 1and I am looking for the
highest value. It is a diagonal matrix so I don't look at every cells but
only at the upper diagonal.
I get the coordinates of the highest value, transform some values in the
matrix and then delete the corresponding row and columns. I then repeat the
operation until I end up with a small matrix of 1 x 1.
I may start with a 4000 x 4000 matrix, and reduce the dimension 3999 times,
every time looking at the maximum value and then removing the row and
column.
About 45% of the time is spent deleting rows and column, and 45% finding the
maximum value (about 10% computing other things).
Hope this help
Richard
.
- Follow-Ups:
- Re: Finding maximum of an array
- From: Dennis
- Re: Finding maximum of an array
- From: rbwinston
- Re: Finding maximum of an array
- From: Anders Isaksson
- Re: Finding maximum of an array
- From: Q Correll
- Re: Finding maximum of an array
- From: Q Correll
- Re: Finding maximum of an array
- From: Eric Grange
- Re: Finding maximum of an array
- References:
- Finding maximum of an array
- From: Richard Lavoie
- Re: Finding maximum of an array
- From: John Herbster
- Finding maximum of an array
- Prev by Date: Re: Just installed Delphi 2007 April 08 patch...
- 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
|