From a3adf4c0ce7ef16b9fff75132ff5a18b0e7a5c8e Mon Sep 17 00:00:00 2001 From: William Daniau Date: Tue, 3 Nov 2020 21:40:38 +0100 Subject: [PATCH] Split de test_matev en test_matev_c et test_matev_r --- fvn_test/Makefile | 4 +-- fvn_test/{test_matev.f90 => test_matev_c.f90} | 8 +++--- fvn_test/test_matev_r.f90 | 41 +++++++++++++++++++++++++++ 3 files changed, 47 insertions(+), 6 deletions(-) rename fvn_test/{test_matev.f90 => test_matev_c.f90} (82%) create mode 100644 fvn_test/test_matev_r.f90 diff --git a/fvn_test/Makefile b/fvn_test/Makefile index 381b4f7..5d743b9 100644 --- a/fvn_test/Makefile +++ b/fvn_test/Makefile @@ -2,12 +2,12 @@ include $(BTREE)/Make.inc programs = test_fac$(exext) test_matinv$(exext) test_specfunc$(exext) \ -test_det$(exext) test_matcon$(exext) test_matev$(exext) test_inter1d$(exext) \ +test_det$(exext) test_matcon$(exext) test_inter1d$(exext) \ 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) \ 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) \ -test_lm$(exext) +test_lm$(exext) test_matev_c$(exext) test_matev_r$(exext) prog:$(programs) diff --git a/fvn_test/test_matev.f90 b/fvn_test/test_matev_c.f90 similarity index 82% rename from fvn_test/test_matev.f90 rename to fvn_test/test_matev_c.f90 index 28cd173..70a6705 100644 --- a/fvn_test/test_matev.f90 +++ b/fvn_test/test_matev_c.f90 @@ -1,10 +1,10 @@ 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 +complex(8),dimension(3,3) :: a +real(8),dimension(3,3) :: ra,ia +complex(8),dimension(3) :: evala +complex(8),dimension(3,3) :: eveca integer :: status,i,j call init_random_seed() diff --git a/fvn_test/test_matev_r.f90 b/fvn_test/test_matev_r.f90 new file mode 100644 index 0000000..59209d2 --- /dev/null +++ b/fvn_test/test_matev_r.f90 @@ -0,0 +1,41 @@ +program test_matev +use fvn_linear +implicit none +real(8),dimension(3,3) :: a +complex(8),dimension(3) :: evala +complex(8),dimension(3,3) :: eveca +integer :: status,i,j + +call init_random_seed() +call random_number(a) +a=a*100 +call fvn_matev(3,a,evala,eveca,status) + +write(*,*) "The matrix :" +write (*,'(3e12.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 -- 2.16.4