test1 Program

Uses

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

Calls

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

   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)

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