Blame view

fvn_test/test_matev_c.f90 1.02 KB
27d3b84d6   daniau   git-svn-id: https...
1
  program test_matev
2919a9e2d   daniau   git-svn-id: https...
2
  use fvn_linear
27d3b84d6   daniau   git-svn-id: https...
3
  implicit none
6dd358516   William Daniau   Ajout de fvn_d_ma...
4
5
6
7
  complex(8),dimension(3,3) :: a
  real(8),dimension(3,3) :: ra,ia
  complex(8),dimension(3) :: evala
  complex(8),dimension(3,3) :: eveca
27d3b84d6   daniau   git-svn-id: https...
8
  integer :: status,i,j
af246bca4   wdaniau   +) Sorting of eig...
9

27d3b84d6   daniau   git-svn-id: https...
10
  call init_random_seed()
af246bca4   wdaniau   +) Sorting of eig...
11
12
13
  call random_number(ra)
  call random_number(ia)
  a=ra+fvn_i*ia
27d3b84d6   daniau   git-svn-id: https...
14
15
16
17
  a=a*100
  call fvn_matev(3,a,evala,eveca,status)
  
  write(*,*) "The matrix :"
af246bca4   wdaniau   +) Sorting of eig...
18
  write (*,'(3("(",e12.5,",",e12.5,")"))') a
27d3b84d6   daniau   git-svn-id: https...
19
20
  write (*,*)
  do i=1,3
af246bca4   wdaniau   +) Sorting of eig...
21
22
23
24
25
26
27
    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(*,*)
27d3b84d6   daniau   git-svn-id: https...
28
  end do
af246bca4   wdaniau   +) Sorting of eig...
29
30
31
32
33
34
35
36
37
38
39
40
  
  ! 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(*,*)
27d3b84d6   daniau   git-svn-id: https...
41
  end do
af246bca4   wdaniau   +) Sorting of eig...
42

27d3b84d6   daniau   git-svn-id: https...
43
  end program