test3 Program

Uses

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

Calls

program~~test3~~CallsGraph program~test3 test3 interface~svd forsvd::svd program~test3->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 test3

   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, 'gesdd')

   ! 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 test3