Re: simplest way to sort a bi-dimensional array? mat(a,b)...
- From: jwm <jwmwalrus@xxxxxxxxx>
- Date: Thu, 26 Jul 2007 05:19:46 -0700
On Jul 26, 4:41 am, ginko <gi...@xxxxxxxxxxx> wrote:
i heard of the bubble sort algorithm, but i found examples for a
mono-dimensional array only.
now i need to sort a BI-dimensional array.
I think you need an additional rule for sorting bi-dimensional arrays,
e.g., if you have a matrix, say A(m, n), will the maximum element be
in the A(m,n) entry, or will there be a maximum value per row (A(:,n))
or per column (A(m,:))?
Others might correct me, but as I see it, you don't need a "special"
bi-dimensional algorithm to approach any of the three possibilities I
just mentioned: In the first case, you just need to pack your "matrix"
as a "vector" before calling the sorting routine (and unpack it on
return); for the remaining cases, just apply a loop.
PS: i use fortran 77
Such task could be a lot easier using a Fortran 90/95 compiler.
John.
.
- Follow-Ups:
- Re: simplest way to sort a bi-dimensional array? mat(a,b)...
- From: Gordon Sande
- Re: simplest way to sort a bi-dimensional array? mat(a,b)...
- References:
- Prev by Date: Re: convert f77 code from mixed case to lower case
- Next by Date: How to call a Java program from Fortran?
- Previous by thread: simplest way to sort a bi-dimensional array? mat(a,b)...
- Next by thread: Re: simplest way to sort a bi-dimensional array? mat(a,b)...
- Index(es):