I wish to represent index pairs {ia} by single indices {A}. Thus for
example a matrix m_{ia} is represented by the vector v_{A}. The
ordering is such that {a} is the major index, {i} is the minor index,
eg with a=1:4, i=1:2 the ordering is
- -
v = | m_{11} |
| m_{21} |
| m_{12} |
| m_{22} |
| m_{13} |
| m_{23} |
| m_{14} |
| m_{24} |
- -
This assignment m-->v can easily be accomplished in Fortran through
v = m
and the converse v-->m should work too (correct me if I'm wrong)
m = v
My question concerns the case when their are 2 index pairs
ie a 4-tensor t_{iajb} which is to be represented as a matrix
m_{AB} with {A} representing the index pair {ia} and {B} representing
the index pair {jb}, and the same ordering principles apply.
How does one do this (easily) in Fortran 90? ie rules for
t --> m
m --> t
Can anyone help?
Roger Young.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
|