adr_lnr_2_Nplet
maps the linear address, lnr_adr, to N-dim coordinates, Nplet, to based on the fortran's standard of memory arrangement of N-dim array. The linear address, lnr_adr, is also assumed to start at 0. Here the Nplet(ii) returned starts at 0. So the formula of conversion is
Synopsis
void adr_lnr_2_Nplet(
int lnr_adr,
int Ndim,
int bdy_lgths[],
int Nplet[]
)
adr = Nplet( 0 ) * 1
+ Nplet( 1 ) * bdy_lgths(0)
+ Nplet( 2 ) * bdy_lgths(0) * bdy_lgths(1)
+ Nplet( 3 ) * bdy_lgths(0) * bdy_lgths(1) * bdy_lgths(2)
+ ..................
+ Nplet(N-1) * bdy_lgths(0) * ...... * bdy_lgths(N-2)
Unmodified Input Variables
- lnr_adr - linear address, adr, relates to N-dim coordiantes, Nplet[],
with the above formula.
- Ndim - Dimensionality of the coordinates, i.e. Number of the elements
in the coordinates, Nplet[].
- bdy_lgths - Integer Array, of size Ndim, holds maximum size in each
dimension of Nplet[].
Modified Output Variables
- Nplet - Integer Array, of size Ndim, the N-dim coordinates to be converted
from the given linear address, lnr_adr.
Definition Location
This subroutine is defined in the librgx.a.
Location:../src/librgx/adr_lnr_2_Nplet.c