-
git-svn-id: https://lxsd.femto-st.fr/svn/fvn@59 b657c933-2333-4658-acf2-d3c7c2708721
test_matev.f90
1.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
program test_matev
use fvn_linear
implicit none
complex(kind=dp_kind),dimension(3,3) :: a
real(kind=dp_kind),dimension(3,3) :: ra,ia
complex(kind=dp_kind),dimension(3) :: evala
complex(kind=dp_kind),dimension(3,3) :: eveca
integer :: status,i,j
call init_random_seed()
call random_number(ra)
call random_number(ia)
a=ra+fvn_i*ia
a=a*100
call fvn_matev(3,a,evala,eveca,status)
write(*,*) "The matrix :"
write (*,'(3("(",e12.5,",",e12.5,")"))') a
write (*,*)
do i=1,3
write(*,'("Eigenvalue ",I3," : (",e12.5,",",e12.5,") ")') i,evala(i)
write(*,'("Modulus : ",e12.5)') abs(evala(i))
write(*,*) "Associated Eigenvector :"
do j=1,3
write(*,'("(",e12.5,",",e12.5,") ")') eveca(j,i)
end do
write(*,*)
end do
! tri
write(*,*) "With sort option"
call fvn_matev(3,a,evala,eveca,status,.true.)
do i=1,3
write(*,'("Eigenvalue ",I3," : (",e12.5,",",e12.5,") ")') i,evala(i)
write(*,'("Modulus : ",e12.5)') abs(evala(i))
write(*,*) "Associated Eigenvector :"
do j=1,3
write(*,'("(",e12.5,",",e12.5,") ")') eveca(j,i)
end do
write(*,*)
end do
end program