Re: Finding maximum of an array



I see the point. I did something like this by moving row pointers
(consisting of arrays of singles) rather than row data. In this case, I am
exchanging pointers, moving pointers of invalid rows at the end of the
matrix and then ignoring them when doing additional computer. But when
deleting columns, I still have to move a lot of data for every row.

But if I understand it well, I would add an array of row/column index,
indicating that row or column #1 is actually row and column #10 and row and
column number #2 actually correspond to the row and columns #12. It will
add an extra step to the access of the data, but I believe it could result
in a major speed improvement.

Since the procedure delete row n and column n at the same time, only one
index would be needed. Seems like a pretty good way to do it and I will
test this for sure. It may however take some times for me to implement
something like this (busy solving another bottleneck) but I will be back and
will let you know whether it works.

Richard



"Q Correll" <qcorrell@xxxxxxxxxxxxx> wrote in message
news:48164c24$1@xxxxxxxxxxxxxxxxxxxxxxxxx
Anders,

| If you address your matrix indirectly through a Row vector and a Col
| vector the 'deletion' will take almost no time at all. Just remove
| the row index from the Row vector and the col index from the Col
| vector. No need to actually move all the matrix data around.

I was just about to mention that same approach when I encountered your
post. <g>

--
Q

04/28/2008 15:13:21

XanaNews Version 1.17.5.7 [Q's Salutation mod]


.



Relevant Pages

  • Re: Array comparison
    ... > Deep and recursive. ... the pointers and comparing their referents instead of comparing the ... >> arrays, then I think you also need to argue against assigning arrays. ... semantics (notably, reference counting). ...
    (alt.comp.lang.borland-delphi)
  • Re: double pointer
    ... Nor is it up to me, Deitel 1, Deitel 2, Schildt, ... that arrays are pointers, or that pointers are arrays, in C++. ...
    (comp.lang.c)
  • Re: Doubt about arrays name
    ... basicly pointers are arrays and arrays are pointers, ... but "int main" is better. ... In this case, for traversing a string, using int can't ...
    (comp.lang.c)
  • Re: new IL: C (sort of...).
    ... about the fact that in PIC's C you can't have arrays larger than 256 bytes. ... Its pointers are rudimentary) Its semantics are rather Delphi than C. ... This goes nearly for any static compiled imperative language. ... result of some minor memory saving in the original compiler or to its funky ...
    (comp.lang.misc)
  • Re: low-level pointer vs. array question
    ... arrays, I was not aware of this: ... pointers and arrays, ... it is indeed a platform (and compiler) ...
    (comp.lang.c)