Commit a3adf4c0ce7ef16b9fff75132ff5a18b0e7a5c8e
1 parent
68642e5d21
Exists in
geevx_2020
Split de test_matev en test_matev_c et test_matev_r
Showing 4 changed files with 47 additions and 6 deletions Inline Diff
fvn_test/Makefile
| 1 | 1 | |||
| include $(BTREE)/Make.inc | 2 | 2 | include $(BTREE)/Make.inc | |
| 3 | 3 | |||
| programs = test_fac$(exext) test_matinv$(exext) test_specfunc$(exext) \ | 4 | 4 | programs = test_fac$(exext) test_matinv$(exext) test_specfunc$(exext) \ | |
| test_det$(exext) test_matcon$(exext) test_matev$(exext) test_inter1d$(exext) \ | 5 | 5 | test_det$(exext) test_matcon$(exext) test_inter1d$(exext) \ | |
| test_inter2d$(exext) test_inter3d$(exext) test_akima$(exext) test_lsp$(exext) test_muller$(exext) \ | 6 | 6 | test_inter2d$(exext) test_inter3d$(exext) test_akima$(exext) test_lsp$(exext) test_muller$(exext) \ | |
| test_integ$(exext) test_bsyn$(exext) test_bsjn$(exext) test_bskn$(exext) test_bsin$(exext) test_operators$(exext) test_ze1$(exext) \ | 7 | 7 | test_integ$(exext) test_bsyn$(exext) test_bsjn$(exext) test_bskn$(exext) test_bsin$(exext) test_operators$(exext) test_ze1$(exext) \ | |
| test_besri$(exext) test_besrj$(exext) test_bestime$(exext) \ | 8 | 8 | test_besri$(exext) test_besrj$(exext) test_bestime$(exext) \ | |
| test_sparse_zi$(exext) test_sparse_zl$(exext) test_sparse_di$(exext) test_sparse_dl$(exext) \ | 9 | 9 | test_sparse_zi$(exext) test_sparse_zl$(exext) test_sparse_di$(exext) test_sparse_dl$(exext) \ | |
| test_lm$(exext) | 10 | 10 | test_lm$(exext) test_matev_c$(exext) test_matev_r$(exext) | |
| 11 | 11 | |||
| prog:$(programs) | 12 | 12 | prog:$(programs) | |
| 13 | 13 | |||
| clean: | 14 | 14 | clean: | |
| rm -f {*.o,*.oo,*.ipo,*.a,*.mod,*.dat} | 15 | 15 | rm -f {*.o,*.oo,*.ipo,*.a,*.mod,*.dat} | |
| rm -f $(programs) | 16 | 16 | rm -f $(programs) | |
| 17 | 17 | |||
| %$(exext): %.o | 18 | 18 | %$(exext): %.o | |
| $(LINK) $(LINKFLAGS) $< init_random_seed.o $(LINKFVN) -o $@ | 19 | 19 | $(LINK) $(LINKFLAGS) $< init_random_seed.o $(LINKFVN) -o $@ | |
| 20 | 20 | |||
| %.o: %.f90 | 21 | 21 | %.o: %.f90 | |
| $(F95) $(F95FLAGS) -c $< -o $@ | 22 | 22 | $(F95) $(F95FLAGS) -c $< -o $@ |
fvn_test/test_matev.f90
| program test_matev | 1 | File was deleted | ||
| use fvn_linear | 2 | |||
| implicit none | 3 | |||
| complex(kind=dp_kind),dimension(3,3) :: a | 4 | |||
| real(kind=dp_kind),dimension(3,3) :: ra,ia | 5 | |||
| complex(kind=dp_kind),dimension(3) :: evala | 6 | |||
| complex(kind=dp_kind),dimension(3,3) :: eveca | 7 | |||
| integer :: status,i,j | 8 | |||
| 9 | ||||
| call init_random_seed() | 10 | |||
| call random_number(ra) | 11 | |||
| call random_number(ia) | 12 | |||
| a=ra+fvn_i*ia | 13 | |||
| a=a*100 | 14 | |||
| call fvn_matev(3,a,evala,eveca,status) | 15 | |||
| 16 | ||||
| write(*,*) "The matrix :" | 17 | |||
| write (*,'(3("(",e12.5,",",e12.5,")"))') a | 18 | |||
| write (*,*) | 19 | |||
| do i=1,3 | 20 | |||
| write(*,'("Eigenvalue ",I3," : (",e12.5,",",e12.5,") ")') i,evala(i) | 21 | |||
| write(*,'("Modulus : ",e12.5)') abs(evala(i)) | 22 | |||
| write(*,*) "Associated Eigenvector :" | 23 | |||
| do j=1,3 | 24 | |||
| write(*,'("(",e12.5,",",e12.5,") ")') eveca(j,i) | 25 | |||
| end do | 26 | |||
| write(*,*) | 27 | |||
| end do | 28 | |||
| 29 | ||||
| ! tri | 30 | |||
| write(*,*) "With sort option" | 31 | |||
| call fvn_matev(3,a,evala,eveca,status,.true.) | 32 | |||
| do i=1,3 | 33 | |||
| write(*,'("Eigenvalue ",I3," : (",e12.5,",",e12.5,") ")') i,evala(i) | 34 | |||
| write(*,'("Modulus : ",e12.5)') abs(evala(i)) | 35 | |||
| write(*,*) "Associated Eigenvector :" | 36 | |||
| do j=1,3 | 37 | |||
| write(*,'("(",e12.5,",",e12.5,") ")') eveca(j,i) | 38 | |||
| end do | 39 |
fvn_test/test_matev_c.f90
| File was created | 1 | program test_matev | ||
| 2 | use fvn_linear | |||
| 3 | implicit none | |||
| 4 | complex(8),dimension(3,3) :: a | |||
| 5 | real(8),dimension(3,3) :: ra,ia | |||
| 6 | complex(8),dimension(3) :: evala | |||
| 7 | complex(8),dimension(3,3) :: eveca | |||
| 8 | integer :: status,i,j | |||
| 9 | ||||
| 10 | call init_random_seed() | |||
| 11 | call random_number(ra) | |||
| 12 | call random_number(ia) | |||
| 13 | a=ra+fvn_i*ia | |||
| 14 | a=a*100 | |||
| 15 | call fvn_matev(3,a,evala,eveca,status) | |||
| 16 | ||||
| 17 | write(*,*) "The matrix :" | |||
| 18 | write (*,'(3("(",e12.5,",",e12.5,")"))') a | |||
| 19 | write (*,*) | |||
| 20 | do i=1,3 | |||
| 21 | write(*,'("Eigenvalue ",I3," : (",e12.5,",",e12.5,") ")') i,evala(i) | |||
| 22 | write(*,'("Modulus : ",e12.5)') abs(evala(i)) | |||
| 23 | write(*,*) "Associated Eigenvector :" | |||
| 24 | do j=1,3 | |||
| 25 | write(*,'("(",e12.5,",",e12.5,") ")') eveca(j,i) | |||
| 26 | end do | |||
| 27 | write(*,*) | |||
| 28 | end do | |||
| 29 | ||||
| 30 | ! tri | |||
| 31 | write(*,*) "With sort option" | |||
| 32 | call fvn_matev(3,a,evala,eveca,status,.true.) | |||
| 33 | do i=1,3 | |||
| 34 | write(*,'("Eigenvalue ",I3," : (",e12.5,",",e12.5,") ")') i,evala(i) | |||
| 35 | write(*,'("Modulus : ",e12.5)') abs(evala(i)) | |||
| 36 | write(*,*) "Associated Eigenvector :" | |||
| 37 | do j=1,3 | |||
| 38 | write(*,'("(",e12.5,",",e12.5,") ")') eveca(j,i) | |||
| 39 | end do |
fvn_test/test_matev_r.f90
| File was created | 1 | program test_matev | ||
| 2 | use fvn_linear | |||
| 3 | implicit none | |||
| 4 | real(8),dimension(3,3) :: a | |||
| 5 | complex(8),dimension(3) :: evala | |||
| 6 | complex(8),dimension(3,3) :: eveca | |||
| 7 | integer :: status,i,j | |||
| 8 | ||||
| 9 | call init_random_seed() | |||
| 10 | call random_number(a) | |||
| 11 | a=a*100 | |||
| 12 | call fvn_matev(3,a,evala,eveca,status) | |||
| 13 | ||||
| 14 | write(*,*) "The matrix :" | |||
| 15 | write (*,'(3e12.5)') a | |||
| 16 | write (*,*) | |||
| 17 | do i=1,3 | |||
| 18 | write(*,'("Eigenvalue ",I3," : (",e12.5,",",e12.5,") ")') i,evala(i) | |||
| 19 | write(*,'("Modulus : ",e12.5)') abs(evala(i)) | |||
| 20 | write(*,*) "Associated Eigenvector :" | |||
| 21 | do j=1,3 | |||
| 22 | write(*,'("(",e12.5,",",e12.5,") ")') eveca(j,i) | |||
| 23 | end do | |||
| 24 | write(*,*) | |||
| 25 | end do | |||
| 26 | ||||
| 27 | ! tri | |||
| 28 | write(*,*) "With sort option" | |||
| 29 | call fvn_matev(3,a,evala,eveca,status,.true.) | |||
| 30 | do i=1,3 | |||
| 31 | write(*,'("Eigenvalue ",I3," : (",e12.5,",",e12.5,") ")') i,evala(i) | |||
| 32 | write(*,'("Modulus : ",e12.5)') abs(evala(i)) | |||
| 33 | write(*,*) "Associated Eigenvector :" | |||
| 34 | do j=1,3 | |||
| 35 | write(*,'("(",e12.5,",",e12.5,") ")') eveca(j,i) | |||
| 36 | end do |