Made test program generate symmetric matrices.

stopcriterion
Salvatore Filippone 7 years ago
parent d6e990b04c
commit 8ee76a1a82

@ -93,19 +93,29 @@ contains
! !
! functions parametrizing the differential equation ! functions parametrizing the differential equation
! !
!
! Note: b1 and b2 are the coefficients of the first
! derivative of the unknown function. The default
! we apply here is to have them zero, so that the resulting
! matrix is symmetric/hermitian and suitable for
! testing with CG and FCG.
! When testing methods for non-hermitian matrices you can
! change the B1/B2 functions to e.g. done/sqrt((2*done))
!
function b1(x,y) function b1(x,y)
use psb_base_mod, only : psb_dpk_, done, dzero use psb_base_mod, only : psb_dpk_, done, dzero
implicit none implicit none
real(psb_dpk_) :: b1 real(psb_dpk_) :: b1
real(psb_dpk_), intent(in) :: x,y real(psb_dpk_), intent(in) :: x,y
b1=done/sqrt((2*done)) b1=dzero
end function b1 end function b1
function b2(x,y) function b2(x,y)
use psb_base_mod, only : psb_dpk_, done, dzero use psb_base_mod, only : psb_dpk_, done, dzero
implicit none implicit none
real(psb_dpk_) :: b2 real(psb_dpk_) :: b2
real(psb_dpk_), intent(in) :: x,y real(psb_dpk_), intent(in) :: x,y
b2=done/sqrt((2*done)) b2=dzero
end function b2 end function b2
function c(x,y) function c(x,y)
use psb_base_mod, only : psb_dpk_, done, dzero use psb_base_mod, only : psb_dpk_, done, dzero

@ -95,26 +95,36 @@ contains
! !
! functions parametrizing the differential equation ! functions parametrizing the differential equation
! !
!
! Note: b1, b2 and b3 are the coefficients of the first
! derivative of the unknown function. The default
! we apply here is to have them zero, so that the resulting
! matrix is symmetric/hermitian and suitable for
! testing with CG and FCG.
! When testing methods for non-hermitian matrices you can
! change the B1/B2/B3 functions to e.g. done/sqrt((3*done))
!
function b1(x,y,z) function b1(x,y,z)
use psb_base_mod, only : psb_dpk_, done, dzero use psb_base_mod, only : psb_dpk_, done, dzero
implicit none implicit none
real(psb_dpk_) :: b1 real(psb_dpk_) :: b1
real(psb_dpk_), intent(in) :: x,y,z real(psb_dpk_), intent(in) :: x,y,z
b1=done/sqrt((3*done)) b1=dzero
end function b1 end function b1
function b2(x,y,z) function b2(x,y,z)
use psb_base_mod, only : psb_dpk_, done, dzero use psb_base_mod, only : psb_dpk_, done, dzero
implicit none implicit none
real(psb_dpk_) :: b2 real(psb_dpk_) :: b2
real(psb_dpk_), intent(in) :: x,y,z real(psb_dpk_), intent(in) :: x,y,z
b2=done/sqrt((3*done)) b2=dzero
end function b2 end function b2
function b3(x,y,z) function b3(x,y,z)
use psb_base_mod, only : psb_dpk_, done, dzero use psb_base_mod, only : psb_dpk_, done, dzero
implicit none implicit none
real(psb_dpk_) :: b3 real(psb_dpk_) :: b3
real(psb_dpk_), intent(in) :: x,y,z real(psb_dpk_), intent(in) :: x,y,z
b3=done/sqrt((3*done)) b3=dzero
end function b3 end function b3
function c(x,y,z) function c(x,y,z)
use psb_base_mod, only : psb_dpk_, done, dzero use psb_base_mod, only : psb_dpk_, done, dzero

@ -93,19 +93,29 @@ contains
! !
! functions parametrizing the differential equation ! functions parametrizing the differential equation
! !
!
! Note: b1 and b2 are the coefficients of the first
! derivative of the unknown function. The default
! we apply here is to have them zero, so that the resulting
! matrix is symmetric/hermitian and suitable for
! testing with CG and FCG.
! When testing methods for non-hermitian matrices you can
! change the B1/B2 functions to e.g. sone/sqrt((2*sone))
!
function b1(x,y) function b1(x,y)
use psb_base_mod, only : psb_spk_, sone, szero use psb_base_mod, only : psb_spk_, sone, szero
implicit none implicit none
real(psb_spk_) :: b1 real(psb_spk_) :: b1
real(psb_spk_), intent(in) :: x,y real(psb_spk_), intent(in) :: x,y
b1=sone/sqrt((2*sone)) b1=szero
end function b1 end function b1
function b2(x,y) function b2(x,y)
use psb_base_mod, only : psb_spk_, sone, szero use psb_base_mod, only : psb_spk_, sone, szero
implicit none implicit none
real(psb_spk_) :: b2 real(psb_spk_) :: b2
real(psb_spk_), intent(in) :: x,y real(psb_spk_), intent(in) :: x,y
b2=sone/sqrt((2*sone)) b2=szero
end function b2 end function b2
function c(x,y) function c(x,y)
use psb_base_mod, only : psb_spk_, sone, szero use psb_base_mod, only : psb_spk_, sone, szero

@ -95,26 +95,36 @@ contains
! !
! functions parametrizing the differential equation ! functions parametrizing the differential equation
! !
!
! Note: b1, b2 and b3 are the coefficients of the first
! derivative of the unknown function. The default
! we apply here is to have them zero, so that the resulting
! matrix is symmetric/hermitian and suitable for
! testing with CG and FCG.
! When testing methods for non-hermitian matrices you can
! change the B1/B2/B3 functions to e.g. sone/sqrt((3*sone))
!
function b1(x,y,z) function b1(x,y,z)
use psb_base_mod, only : psb_spk_, sone, szero use psb_base_mod, only : psb_spk_, sone, szero
implicit none implicit none
real(psb_spk_) :: b1 real(psb_spk_) :: b1
real(psb_spk_), intent(in) :: x,y,z real(psb_spk_), intent(in) :: x,y,z
b1=sone/sqrt((3*sone)) b1=szero
end function b1 end function b1
function b2(x,y,z) function b2(x,y,z)
use psb_base_mod, only : psb_spk_, sone, szero use psb_base_mod, only : psb_spk_, sone, szero
implicit none implicit none
real(psb_spk_) :: b2 real(psb_spk_) :: b2
real(psb_spk_), intent(in) :: x,y,z real(psb_spk_), intent(in) :: x,y,z
b2=sone/sqrt((3*sone)) b2=szero
end function b2 end function b2
function b3(x,y,z) function b3(x,y,z)
use psb_base_mod, only : psb_spk_, sone, szero use psb_base_mod, only : psb_spk_, sone, szero
implicit none implicit none
real(psb_spk_) :: b3 real(psb_spk_) :: b3
real(psb_spk_), intent(in) :: x,y,z real(psb_spk_), intent(in) :: x,y,z
b3=sone/sqrt((3*sone)) b3=szero
end function b3 end function b3
function c(x,y,z) function c(x,y,z)
use psb_base_mod, only : psb_spk_, sone, szero use psb_base_mod, only : psb_spk_, sone, szero

Loading…
Cancel
Save