Program T_svd

use std_type
use VstupVystup
use LinEqu

implicit none

integer :: radku,sloupcu
real(Kind=DP),dimension(:,:),allocatable :: A,V
character(len=20) :: FmtRetez
real(kind=DP),dimension(:),allocatable :: z

call cti_cislo("Pocet radku = ",radku)
call cti_cislo("Pocet sloupcu = ",sloupcu)
allocate(A(radku,sloupcu))
Allocate(V(sloupcu,sloupcu))
allocate(z(sloupcu))

print *, "Zadej matici A po radcich"
call cti_matici(radku,sloupcu,A)

print *
Print *,"Zadana matice A:"
FmtRetez = "(f10.3)"
call pis_matici(radku,sloupcu,A,FmtRetez)

call Svd(radku,sloupcu,A,V,z)

print *,char(10)//"Matice U z Svd:"
FmtRetez = "(f12.4)"
call pis_matici(radku,sloupcu,A,FmtRetez)

print *,char(10)//"Matice V z Svd:"
FmtRetez = "(f12.4)"
call pis_matici(sloupcu,sloupcu,V,FmtRetez)

print *,char(10)//"Singularni cisla z Svd:"
FmtRetez = "(es12.4e2)"
call pis_vektor(sloupcu,z,FmtRetez,.true.)

read *
end program T_svd
