Re: Finding maximum of an array



Richard,

| 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.

You might try to set all the row and column elements to zero instead of
deleting rows and columns. It means iterating over the entire large
matrix for each elimination but that might be quicker that reducing the
entire matrix's size every iteration.

--
Q

04/21/2008 10:15:36

XanaNews Version 1.17.5.7 [Q's Salutation mod]
.



Relevant Pages

  • Re: altering an object as you iterate over it?
    ... One solution I tried is to open the file and use readlines(), ... you are iterating with it. ... removing the first shortens the list by one, ... for i in range(numEmptyLines): ...
    (comp.lang.python)
  • Re: Remove Row from a DataView
    ... First - you need to be very careful removing from a loop you are ... iterating - the code you have is susceptible to cumulative "off by ... the 1st would disappear. ... Perhaps an easier option is to set a RowFilter against the view? ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Remove Row from a DataView
    ... First - you need to be very careful removing from a loop you are ... iterating - the code you have is susceptible to cumulative "off by ... the 1st would disappear. ...
    (microsoft.public.dotnet.languages.csharp)