Re: Re-ordering columns or rows of an array efficiently




"Mike" <mkjohnst@xxxxxxxxx> wrote in message
news:8a370769-5a66-4532-8480-20e62e19a6dc@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Hi,

I'm somewhat new to FORTRAN, and just have what is probably a simple
question to which I've been unable to find the answer (after much
Googling).

I need to re-order the columns of an array. The way that I've done
this is to construct a vector of integers E which contains the desired
order of the columns, and then I do this:

A0=A(:,E)
A=A0

Of course, this requires having a matrix the size of A allocated
twice. Since A is several gigabytes on my system, this is a rather
undesirable way to do things. Yet, I get errors if I try something
like A=A(:,E). Can anyone suggest a way of doing this that doesn't
require as much memory?

Best regards,

Mike
Perhaps you could initially store the data in vectors rather than an array
then form the array from the vectors? - Mike


.



Relevant Pages

  • Re: FOAK - buying music.
    ... from my youth - beginning with All Along The Watchtower. ... After googling I've been offered a staggering ... array of sites, some from Russia, thus I am cautious. ...
    (uk.rec.motorcycles)
  • convert 2D array to cute text table with | pipes ?
    ... I have only started googling I will report back here what I find or write. ... Does anyone have a code snippet which reads a 2D array and outputs a cute formatted text table, ...
    (comp.lang.ruby)
  • Re: FOAK - buying music.
    ... from my youth - beginning with All Along The Watchtower. ... After googling I've been offered a staggering ... array of sites, some from Russia, thus I am cautious. ...
    (uk.rec.motorcycles)
  • About array to hash conversion
    ... I want to convert an array to a hash. ... googling a bit I got: ... But this is not safe as Array#flatten is recursive. ...
    (comp.lang.ruby)
  • Re: Who uses clapack?
    ... > functions like SUM and MAXVAL and the ability to use array sections ... > drastically change the meaning of a Fortran code. ... >>Have you ever seen those bills for a Fortran compiler for an ... engineering applications in the C and C++ languages. ...
    (comp.lang.fortran)