home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.fortran
- Path: sparky!uunet!sun-barr!cs.utexas.edu!zaphod.mps.ohio-state.edu!moe.ksu.ksu.edu!ux1.cso.uiuc.edu!news.cso.uiuc.edu!uimrl7.mrl.uiuc.edu!ercolessi
- From: ercolessi@uimrl3.mrl.uiuc.edu (furio ercolessi)
- Subject: Re: 3d to 2d mapping
- References: <BxxnCt.5M0@cs.dal.ca>
- Message-ID: <Bxxv0r.Anq@news.cso.uiuc.edu>
- Sender: usenet@news.cso.uiuc.edu (Net Noise owner)
- Reply-To: ercolessi@uimrl3.mrl.uiuc.edu (furio ercolessi)
- Organization: MRL - UIUC
- Distribution: na
- Date: Thu, 19 Nov 1992 01:05:13 GMT
- Lines: 26
-
- In article <BxxnCt.5M0@cs.dal.ca>, glenn@ug.cs.dal.ca (Glenn McCarville) writes:
- |>I want to take a 3 dimensional array and map it onto a 2d array.
- |>i.e. Set B(i,j)=A(x,i,j) for all i,j and x is some constant. Can this
- |>be done easily?
-
- the easiest way, if you can do it, is to transpose the array so as
- to have the constant index in the last position.
-
- then you can
- call blas_routine(A(1,1,x),...)
- where blas_routine expects a 2d array.
-
- in fact, what is passed to the routine is the address of the specified
- element of the array, which the routine takes as starting address.
- data are stored in columnwise order, so this does exactly what you
- want.
-
- if you cannot reorder the indexes, i'm afraid you have to copy
- the data into a temporary subarray.
-
- furio
- --
- Furio Ercolessi
- Materials Research Laboratory | Intl School for Advanced Studies
- Univ. of Illinois at Urbana-Champaign | Trieste, Italy
- furio@uiuc.edu | furio@sissa.it
-