real, dimension(1000,1000):: A, B, Tmp Tmp=A; A=B; B=Tmp ! 3 array copies involved

real, dimension(1000,1000) :: mat1, mat2 real, dimension(:,:), pointer :: a, b, tmp a=>mat1; b=> mat2 ! initial tmp=>a; ! tmp points to the target of a, i.e. to mat1 a=>b; ! a points to the target of b, i.e. to mat2 b=>tmp ! b points to the target of tmp, i.e. to mat1

real, dimension(1000,1000), target :: MatA, MatB real, dimension(:,:), pointer :: A, A A=>MatA; B=>MatB ! normal A=>MatB; B=>MatA ! swapped

Adrian Sandu 2001-08-26