intrinsic_transpose.f90

来自「linux下编程用 编译软件」· F90 代码 · 共 25 行

F90
25
字号
! Program to test the transpose intrinsicprogram intrinsic_transpose   integer, dimension (3, 3) :: a, b   complex(kind=8), dimension (2, 2) :: c, d   complex(kind=4), dimension (2, 2) :: e   a = 0   b = reshape ((/1, 2, 3, 4, 5, 6, 7, 8, 9/), (/3, 3/))   a = transpose (b)   if (any (a .ne. reshape ((/1, 4, 7, 2, 5, 8, 3, 6, 9/), (/3, 3/)))) &      call abort   c = (0.0, 0.0)   d = reshape ((/(1d0,2d0), (3d0, 4d0), (5d0, 6d0), (7d0, 8d0)/), (/2, 2/))   c = transpose (d);   if (any (c .ne. reshape ((/(1d0, 2d0), (5d0, 6d0), &                              (3d0, 4d0), (7d0, 8d0)/), (/2, 2/)))) &    call abort ();      e = reshape ((/(1.0,2.0), (3.0, 4.0), (5.0, 6.0), (7.0, 8.0)/), (/2, 2/))   e = transpose (e);   if (any (e .ne. reshape ((/(1.0, 2.0), (5.0, 6.0), &                              (3.0, 4.0), (7.0, 8.0)/), (/2, 2/)))) &    call abort ();end program

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?