program T_TredTql


use std_type
use VstupVystup
use eigen

implicit none

integer :: dimA, iteraci
real(kind=DP),dimension(:),allocatable :: A1,d,e

call cti_cislo("Dimenze matice = ",dimA)
Allocate(A1(dimA*(dimA+1)/2))
allocate(d(dimA))
allocate(e(dimA))

print *,"Zadej spodni trojuhelnik A1 po radcich"
call cti_vektor(dimA*(dimA+1)/2,A1)

print *,char(10)//"Zadana matice A1"
call pis_t_matici(dimA,A1,"(f10.3)")


call Tred(dimA,A1,d,e)

print *,char(10)//"Hlavni diagonala z Tred"
call pis_vektor(dimA,d,"(es15.6e3)")

print *,char(10)//"Vedlejsi diagonala z Tred"
call pis_vektor(dimA,e,"(es15.6e3)")

iteraci =20
call Tql(dimA,d,e,iteraci)

print "(/,a,i3)","Maximalni pocet iteraci byl",iteraci

print *,char(10)//"Vlastni hodnoty"
call pis_vektor(dimA,d,"(es14.6e3)")

print *,char(10)//"Vektor e na vystupu"
call pis_vektor(dimA,e,"(es14.6e3)")



end program T_TredTql
