test2 Program

Uses

  • program~~test2~~UsesGraph program~test2 test2 kinds kinds program~test2->kinds module~forsvd forsvd program~test2->module~forsvd module~forsvd->kinds

Calls

program~~test2~~CallsGraph program~test2 test2 interface~svd forsvd::svd program~test2->interface~svd proc~svd_rel forsvd::svd_rel interface~svd->proc~svd_rel proc~gesdd_rel forsvd::gesdd_rel proc~svd_rel->proc~gesdd_rel proc~gesvd_rel forsvd::gesvd_rel proc~svd_rel->proc~gesvd_rel

Variables

Type Attributes Name Initial
real(kind=rk), dimension(:, :), allocatable :: A
real(kind=rk), dimension(:, :), allocatable :: U
real(kind=rk), dimension(:, :), allocatable :: VT
real(kind=rk), dimension(:), allocatable :: S
integer :: m
integer :: n
integer :: i
integer :: j

Source Code

program test2

   use kinds
   use forsvd, only: svd

   implicit none

   real(rk), dimension(:, :), allocatable :: A, U, VT
   real(rk), dimension(:),    allocatable :: S
   integer                                :: m, n, i, j

   m = 4
   n = 3

   allocate(A(m,n), U(m,m), S(min(m,n)), VT(n,n))

   call random_number(A)
   A = A*10.0_rk

   call svd(A, U,S,VT, 'gesvd')

   ! Print U
   print *, "U:"
   print "(4F10.6)", (U(:,j), j = 1, m)

   ! Print S
   print *, "S:"
   print "(3F10.6)", S

   ! Print VT
   print *, "VT:"
   print "(3F10.6)", (VT(:,j), j = 1, n)

   deallocate(A, U, S, VT)

end program test2