Matrix transposition: Difference between revisions

Content added Content deleted
Line 200: Line 200:
=={{header|Fortran}}==
=={{header|Fortran}}==
In ISO Fortran 90 or later, use the TRANSPOSE intrinsic function:
In ISO Fortran 90 or later, use the TRANSPOSE intrinsic function:
REAL, DIMENSION(N,M) :: A = RESHAPE( (/ (i,i=1,n*m) /), (/ n, m /) )
real, dimension(n,m) :: a = reshape( (/ (i,i=1,n*m) /), (/ n, m /) )
REAL, DIMENSION(M,N) :: B
real, dimension(m,n) :: b
B = TRANSPOSE(A)
b = transpose(a)


In MIL-STD-1753 Fortran or later, use nested structured DO loops:
In MIL-STD-1753 Fortran or later, use nested structured DO loops: