base/modules/psb_c_base_vect_mod.f90
 base/modules/psb_c_mat_mod.f90
 base/modules/psb_d_base_vect_mod.f90
 base/modules/psb_d_mat_mod.f90
 base/modules/psb_s_base_mat_mod.f90
 base/modules/psb_s_base_vect_mod.f90
 base/modules/psb_s_mat_mod.f90
 base/modules/psb_z_base_vect_mod.f90
 base/modules/psb_z_mat_mod.f90
 base/serial/impl/psb_c_base_mat_impl.f90
 base/serial/impl/psb_c_coo_impl.f90
 base/serial/impl/psb_c_csc_impl.f90
 base/serial/impl/psb_c_csr_impl.f90
 base/serial/impl/psb_c_mat_impl.F90
 base/serial/impl/psb_d_base_mat_impl.f90
 base/serial/impl/psb_d_coo_impl.f90
 base/serial/impl/psb_d_csc_impl.f90
 base/serial/impl/psb_d_csr_impl.f90
 base/serial/impl/psb_d_mat_impl.F90
 base/serial/impl/psb_s_base_mat_impl.f90
 base/serial/impl/psb_s_coo_impl.f90
 base/serial/impl/psb_s_csc_impl.f90
 base/serial/impl/psb_s_csr_impl.f90
 base/serial/impl/psb_s_mat_impl.F90
 base/serial/impl/psb_z_base_mat_impl.f90
 base/serial/impl/psb_z_coo_impl.f90
 base/serial/impl/psb_z_csc_impl.f90
 base/serial/impl/psb_z_csr_impl.f90
 base/serial/impl/psb_z_mat_impl.F90
 krylov/psb_dbicg.f90
 krylov/psb_dcg.F90
 krylov/psb_dcgs.f90
 krylov/psb_dcgstab.F90
 krylov/psb_dcgstabl.f90
 krylov/psb_dkrylov.f90
 krylov/psb_drgmres.f90
 prec/psb_c_diagprec.f90

Various merges from testpre. To be reviewed
Krylov subspace: take out D version without VECT.
This commit is contained in:
Salvatore Filippone
2011-11-29 09:45:26 +00:00
parent c804941be6
commit 5087a02aaf
37 changed files with 3632 additions and 3388 deletions
+35 -31
View File
@@ -118,12 +118,14 @@ contains
complex(psb_spk_), intent(in) :: val(:)
integer :: nr
integer :: info
if (allocated(x%v)) then
nr = min(size(x%v),size(val))
x%v(1:nr) = val(1:nr)
else
x%v = val
end if
end subroutine c_base_set_vect
@@ -150,23 +152,27 @@ contains
implicit none
class(psb_c_base_vect_type), intent(in) :: x
integer :: res
res = 0
if (allocated(x%v)) res = size(x%v)
end function c_base_get_nrows
function c_base_sizeof(x) result(res)
implicit none
class(psb_c_base_vect_type), intent(in) :: x
integer(psb_long_int_k_) :: res
res = (2*psb_sizeof_sp)*x%get_nrows()
res = (1_psb_long_int_k_ * (2*psb_sizeof_sp)) * x%get_nrows()
end function c_base_sizeof
function c_base_dot_v(n,x,y) result(res)
implicit none
class(psb_c_base_vect_type), intent(inout) :: x, y
integer, intent(in) :: n
complex(psb_spk_) :: res
complex(psb_spk_), external :: cdotc
complex(psb_spk_) :: res
complex(psb_spk_), external :: cdotc
res = czero
!
@@ -186,10 +192,10 @@ contains
function c_base_dot_a(n,x,y) result(res)
implicit none
class(psb_c_base_vect_type), intent(inout) :: x
complex(psb_spk_), intent(in) :: y(:)
complex(psb_spk_), intent(in) :: y(:)
integer, intent(in) :: n
complex(psb_spk_) :: res
complex(psb_spk_), external :: cdotc
complex(psb_spk_) :: res
complex(psb_spk_), external :: cdotc
res = cdotc(n,y,1,x%v,1)
@@ -268,13 +274,11 @@ contains
subroutine c_base_mlt_a_2(alpha,x,y,beta,z,info)
use psi_serial_mod
implicit none
complex(psb_spk_), intent(in) :: alpha,beta
complex(psb_spk_), intent(in) :: y(:)
complex(psb_spk_), intent(in) :: x(:)
class(psb_c_base_vect_type), intent(inout) :: z
integer, intent(out) :: info
! character(len=1), intent(in), optional :: conjgx, conjgy
complex(psb_spk_), intent(in) :: alpha,beta
complex(psb_spk_), intent(in) :: y(:)
complex(psb_spk_), intent(in) :: x(:)
class(psb_c_base_vect_type), intent(inout) :: z
integer, intent(out) :: info
integer :: i, n
info = 0
@@ -339,29 +343,29 @@ contains
use psi_serial_mod
use psb_string_mod
implicit none
complex(psb_spk_), intent(in) :: alpha,beta
class(psb_c_base_vect_type), intent(inout) :: x
class(psb_c_base_vect_type), intent(inout) :: y
class(psb_c_base_vect_type), intent(inout) :: z
integer, intent(out) :: info
complex(psb_spk_), intent(in) :: alpha,beta
class(psb_c_base_vect_type), intent(inout) :: x
class(psb_c_base_vect_type), intent(inout) :: y
class(psb_c_base_vect_type), intent(inout) :: z
integer, intent(out) :: info
character(len=1), intent(in), optional :: conjgx, conjgy
integer :: i, n
logical :: conjgx_, conjgy_
info = 0
if (present(conjgx)) then
if (psb_toupper(conjgx)=='C') x%v=conjg(x%v)
if (.not.psb_c_is_complex_) then
call z%mlt(alpha,x%v,y%v,beta,info)
else
conjgx_=.false.
if (present(conjgx)) conjgx_ = (psb_toupper(conjgx)=='C')
conjgy_=.false.
if (present(conjgy)) conjgy_ = (psb_toupper(conjgy)=='C')
if (conjgx_) x%v=conjg(x%v)
if (conjgy_) y%v=conjg(y%v)
call z%mlt(alpha,x%v,y%v,beta,info)
if (conjgx_) x%v=conjg(x%v)
if (conjgy_) y%v=conjg(y%v)
end if
if (present(conjgy)) then
if (psb_toupper(conjgy)=='C') y%v=conjg(y%v)
end if
call z%mlt(alpha,x%v,y%v,beta,info)
if (present(conjgx)) then
if (psb_toupper(conjgx)=='C') x%v=conjg(x%v)
end if
if (present(conjgy)) then
if (psb_toupper(conjgy)=='C') y%v=conjg(y%v)
end if
end subroutine c_base_mlt_v_2
subroutine c_base_mlt_av(alpha,x,y,beta,z,info)
+54 -54
View File
@@ -337,9 +337,9 @@ module psb_c_mat_mod
interface
subroutine psb_c_csput(nz,ia,ja,val,a,imin,imax,jmin,jmax,info,gtl)
import :: psb_cspmat_type, psb_dpk_
import :: psb_cspmat_type, psb_spk_
class(psb_cspmat_type), intent(inout) :: a
complex(psb_dpk_), intent(in) :: val(:)
complex(psb_spk_), intent(in) :: val(:)
integer, intent(in) :: nz, ia(:), ja(:), imin,imax,jmin,jmax
integer, intent(out) :: info
integer, intent(in), optional :: gtl(:)
@@ -349,7 +349,7 @@ module psb_c_mat_mod
interface
subroutine psb_c_csgetptn(imin,imax,a,nz,ia,ja,info,&
& jmin,jmax,iren,append,nzin,rscale,cscale)
import :: psb_cspmat_type, psb_dpk_
import :: psb_cspmat_type, psb_spk_
class(psb_cspmat_type), intent(in) :: a
integer, intent(in) :: imin,imax
integer, intent(out) :: nz
@@ -365,12 +365,12 @@ module psb_c_mat_mod
interface
subroutine psb_c_csgetrow(imin,imax,a,nz,ia,ja,val,info,&
& jmin,jmax,iren,append,nzin,rscale,cscale)
import :: psb_cspmat_type, psb_dpk_
import :: psb_cspmat_type, psb_spk_
class(psb_cspmat_type), intent(in) :: a
integer, intent(in) :: imin,imax
integer, intent(out) :: nz
integer, allocatable, intent(inout) :: ia(:), ja(:)
complex(psb_dpk_), allocatable, intent(inout) :: val(:)
complex(psb_spk_), allocatable, intent(inout) :: val(:)
integer,intent(out) :: info
logical, intent(in), optional :: append
integer, intent(in), optional :: iren(:)
@@ -382,7 +382,7 @@ module psb_c_mat_mod
interface
subroutine psb_c_csgetblk(imin,imax,a,b,info,&
& jmin,jmax,iren,append,rscale,cscale)
import :: psb_cspmat_type, psb_dpk_
import :: psb_cspmat_type, psb_spk_
class(psb_cspmat_type), intent(in) :: a
class(psb_cspmat_type), intent(out) :: b
integer, intent(in) :: imin,imax
@@ -397,7 +397,7 @@ module psb_c_mat_mod
interface
subroutine psb_c_csclip(a,b,info,&
& imin,imax,jmin,jmax,rscale,cscale)
import :: psb_cspmat_type, psb_dpk_
import :: psb_cspmat_type, psb_spk_
class(psb_cspmat_type), intent(in) :: a
class(psb_cspmat_type), intent(out) :: b
integer,intent(out) :: info
@@ -409,7 +409,7 @@ module psb_c_mat_mod
interface
subroutine psb_c_b_csclip(a,b,info,&
& imin,imax,jmin,jmax,rscale,cscale)
import :: psb_cspmat_type, psb_dpk_, psb_c_coo_sparse_mat
import :: psb_cspmat_type, psb_spk_, psb_c_coo_sparse_mat
class(psb_cspmat_type), intent(in) :: a
type(psb_c_coo_sparse_mat), intent(out) :: b
integer,intent(out) :: info
@@ -420,7 +420,7 @@ module psb_c_mat_mod
interface
subroutine psb_c_cscnv(a,b,info,type,mold,upd,dupl)
import :: psb_cspmat_type, psb_dpk_, psb_c_base_sparse_mat
import :: psb_cspmat_type, psb_spk_, psb_c_base_sparse_mat
class(psb_cspmat_type), intent(in) :: a
class(psb_cspmat_type), intent(out) :: b
integer, intent(out) :: info
@@ -433,7 +433,7 @@ module psb_c_mat_mod
interface
subroutine psb_c_cscnv_ip(a,iinfo,type,mold,dupl)
import :: psb_cspmat_type, psb_dpk_, psb_c_base_sparse_mat
import :: psb_cspmat_type, psb_spk_, psb_c_base_sparse_mat
class(psb_cspmat_type), intent(inout) :: a
integer, intent(out) :: iinfo
integer,optional, intent(in) :: dupl
@@ -445,7 +445,7 @@ module psb_c_mat_mod
interface
subroutine psb_c_cscnv_base(a,b,info,dupl)
import :: psb_cspmat_type, psb_dpk_, psb_c_base_sparse_mat
import :: psb_cspmat_type, psb_spk_, psb_c_base_sparse_mat
class(psb_cspmat_type), intent(in) :: a
class(psb_c_base_sparse_mat), intent(out) :: b
integer, intent(out) :: info
@@ -472,7 +472,7 @@ module psb_c_mat_mod
interface
subroutine psb_c_mv_from(a,b)
import :: psb_cspmat_type, psb_dpk_, psb_c_base_sparse_mat
import :: psb_cspmat_type, psb_spk_, psb_c_base_sparse_mat
class(psb_cspmat_type), intent(out) :: a
class(psb_c_base_sparse_mat), intent(inout) :: b
end subroutine psb_c_mv_from
@@ -480,7 +480,7 @@ module psb_c_mat_mod
interface
subroutine psb_c_cp_from(a,b)
import :: psb_cspmat_type, psb_dpk_, psb_c_base_sparse_mat
import :: psb_cspmat_type, psb_spk_, psb_c_base_sparse_mat
class(psb_cspmat_type), intent(out) :: a
class(psb_c_base_sparse_mat), intent(inout), allocatable :: b
end subroutine psb_c_cp_from
@@ -488,7 +488,7 @@ module psb_c_mat_mod
interface
subroutine psb_c_mv_to(a,b)
import :: psb_cspmat_type, psb_dpk_, psb_c_base_sparse_mat
import :: psb_cspmat_type, psb_spk_, psb_c_base_sparse_mat
class(psb_cspmat_type), intent(inout) :: a
class(psb_c_base_sparse_mat), intent(out) :: b
end subroutine psb_c_mv_to
@@ -496,7 +496,7 @@ module psb_c_mat_mod
interface
subroutine psb_c_cp_to(a,b)
import :: psb_cspmat_type, psb_dpk_, psb_c_base_sparse_mat
import :: psb_cspmat_type, psb_spk_, psb_c_base_sparse_mat
class(psb_cspmat_type), intent(in) :: a
class(psb_c_base_sparse_mat), intent(out) :: b
end subroutine psb_c_cp_to
@@ -584,26 +584,26 @@ module psb_c_mat_mod
interface psb_csmm
subroutine psb_c_csmm(alpha,a,x,beta,y,info,trans)
import :: psb_cspmat_type, psb_dpk_
import :: psb_cspmat_type, psb_spk_
class(psb_cspmat_type), intent(in) :: a
complex(psb_dpk_), intent(in) :: alpha, beta, x(:,:)
complex(psb_dpk_), intent(inout) :: y(:,:)
complex(psb_spk_), intent(in) :: alpha, beta, x(:,:)
complex(psb_spk_), intent(inout) :: y(:,:)
integer, intent(out) :: info
character, optional, intent(in) :: trans
end subroutine psb_c_csmm
subroutine psb_c_csmv(alpha,a,x,beta,y,info,trans)
import :: psb_cspmat_type, psb_dpk_
import :: psb_cspmat_type, psb_spk_
class(psb_cspmat_type), intent(in) :: a
complex(psb_dpk_), intent(in) :: alpha, beta, x(:)
complex(psb_dpk_), intent(inout) :: y(:)
complex(psb_spk_), intent(in) :: alpha, beta, x(:)
complex(psb_spk_), intent(inout) :: y(:)
integer, intent(out) :: info
character, optional, intent(in) :: trans
end subroutine psb_c_csmv
subroutine psb_c_csmv_vect(alpha,a,x,beta,y,info,trans)
use psb_c_vect_mod, only : psb_c_vect_type
import :: psb_cspmat_type, psb_dpk_
import :: psb_cspmat_type, psb_spk_
class(psb_cspmat_type), intent(in) :: a
complex(psb_dpk_), intent(in) :: alpha, beta
complex(psb_spk_), intent(in) :: alpha, beta
type(psb_c_vect_type), intent(inout) :: x
type(psb_c_vect_type), intent(inout) :: y
integer, intent(out) :: info
@@ -613,28 +613,28 @@ module psb_c_mat_mod
interface psb_cssm
subroutine psb_c_cssm(alpha,a,x,beta,y,info,trans,scale,d)
import :: psb_cspmat_type, psb_dpk_
import :: psb_cspmat_type, psb_spk_
class(psb_cspmat_type), intent(in) :: a
complex(psb_dpk_), intent(in) :: alpha, beta, x(:,:)
complex(psb_dpk_), intent(inout) :: y(:,:)
complex(psb_spk_), intent(in) :: alpha, beta, x(:,:)
complex(psb_spk_), intent(inout) :: y(:,:)
integer, intent(out) :: info
character, optional, intent(in) :: trans, scale
complex(psb_dpk_), intent(in), optional :: d(:)
complex(psb_spk_), intent(in), optional :: d(:)
end subroutine psb_c_cssm
subroutine psb_c_cssv(alpha,a,x,beta,y,info,trans,scale,d)
import :: psb_cspmat_type, psb_dpk_
import :: psb_cspmat_type, psb_spk_
class(psb_cspmat_type), intent(in) :: a
complex(psb_dpk_), intent(in) :: alpha, beta, x(:)
complex(psb_dpk_), intent(inout) :: y(:)
complex(psb_spk_), intent(in) :: alpha, beta, x(:)
complex(psb_spk_), intent(inout) :: y(:)
integer, intent(out) :: info
character, optional, intent(in) :: trans, scale
complex(psb_dpk_), intent(in), optional :: d(:)
complex(psb_spk_), intent(in), optional :: d(:)
end subroutine psb_c_cssv
subroutine psb_c_cssv_vect(alpha,a,x,beta,y,info,trans,scale,d)
use psb_c_vect_mod, only : psb_c_vect_type
import :: psb_cspmat_type, psb_dpk_
import :: psb_cspmat_type, psb_spk_
class(psb_cspmat_type), intent(in) :: a
complex(psb_dpk_), intent(in) :: alpha, beta
complex(psb_spk_), intent(in) :: alpha, beta
type(psb_c_vect_type), intent(inout) :: x
type(psb_c_vect_type), intent(inout) :: y
integer, intent(out) :: info
@@ -645,85 +645,85 @@ module psb_c_mat_mod
interface
function psb_c_maxval(a) result(res)
import :: psb_cspmat_type, psb_dpk_
import :: psb_cspmat_type, psb_spk_
class(psb_cspmat_type), intent(in) :: a
real(psb_dpk_) :: res
real(psb_spk_) :: res
end function psb_c_maxval
end interface
interface
function psb_c_csnmi(a) result(res)
import :: psb_cspmat_type, psb_dpk_
import :: psb_cspmat_type, psb_spk_
class(psb_cspmat_type), intent(in) :: a
real(psb_dpk_) :: res
real(psb_spk_) :: res
end function psb_c_csnmi
end interface
interface
function psb_c_csnm1(a) result(res)
import :: psb_cspmat_type, psb_dpk_
import :: psb_cspmat_type, psb_spk_
class(psb_cspmat_type), intent(in) :: a
real(psb_dpk_) :: res
real(psb_spk_) :: res
end function psb_c_csnm1
end interface
interface
subroutine psb_c_rowsum(d,a,info)
import :: psb_cspmat_type, psb_dpk_
import :: psb_cspmat_type, psb_spk_
class(psb_cspmat_type), intent(in) :: a
complex(psb_dpk_), intent(out) :: d(:)
complex(psb_spk_), intent(out) :: d(:)
integer, intent(out) :: info
end subroutine psb_c_rowsum
end interface
interface
subroutine psb_c_arwsum(d,a,info)
import :: psb_cspmat_type, psb_dpk_
import :: psb_cspmat_type, psb_spk_
class(psb_cspmat_type), intent(in) :: a
real(psb_dpk_), intent(out) :: d(:)
real(psb_spk_), intent(out) :: d(:)
integer, intent(out) :: info
end subroutine psb_c_arwsum
end interface
interface
subroutine psb_c_colsum(d,a,info)
import :: psb_cspmat_type, psb_dpk_
import :: psb_cspmat_type, psb_spk_
class(psb_cspmat_type), intent(in) :: a
complex(psb_dpk_), intent(out) :: d(:)
complex(psb_spk_), intent(out) :: d(:)
integer, intent(out) :: info
end subroutine psb_c_colsum
end interface
interface
subroutine psb_c_aclsum(d,a,info)
import :: psb_cspmat_type, psb_dpk_
import :: psb_cspmat_type, psb_spk_
class(psb_cspmat_type), intent(in) :: a
real(psb_dpk_), intent(out) :: d(:)
integer, intent(out) :: info
real(psb_spk_), intent(out) :: d(:)
integer, intent(out) :: info
end subroutine psb_c_aclsum
end interface
interface
subroutine psb_c_get_diag(a,d,info)
import :: psb_cspmat_type, psb_dpk_
import :: psb_cspmat_type, psb_spk_
class(psb_cspmat_type), intent(in) :: a
complex(psb_dpk_), intent(out) :: d(:)
complex(psb_spk_), intent(out) :: d(:)
integer, intent(out) :: info
end subroutine psb_c_get_diag
end interface
interface psb_scal
subroutine psb_c_scal(d,a,info)
import :: psb_cspmat_type, psb_dpk_
import :: psb_cspmat_type, psb_spk_
class(psb_cspmat_type), intent(inout) :: a
complex(psb_dpk_), intent(in) :: d(:)
complex(psb_spk_), intent(in) :: d(:)
integer, intent(out) :: info
end subroutine psb_c_scal
subroutine psb_c_scals(d,a,info)
import :: psb_cspmat_type, psb_dpk_
import :: psb_cspmat_type, psb_spk_
class(psb_cspmat_type), intent(inout) :: a
complex(psb_dpk_), intent(in) :: d
complex(psb_spk_), intent(in) :: d
integer, intent(out) :: info
end subroutine psb_c_scals
end interface
+30 -20
View File
@@ -76,7 +76,7 @@ contains
integer, intent(in) :: n
class(psb_d_base_vect_type), intent(inout) :: x
integer :: info
call psb_realloc(n,x%v,info)
call x%asb(n,info)
@@ -118,12 +118,14 @@ contains
real(psb_dpk_), intent(in) :: val(:)
integer :: nr
integer :: info
if (allocated(x%v)) then
nr = min(size(x%v),size(val))
x%v(1:nr) = val(1:nr)
else
x%v = val
end if
end subroutine d_base_set_vect
@@ -150,15 +152,19 @@ contains
implicit none
class(psb_d_base_vect_type), intent(in) :: x
integer :: res
res = 0
if (allocated(x%v)) res = size(x%v)
end function d_base_get_nrows
function d_base_sizeof(x) result(res)
implicit none
class(psb_d_base_vect_type), intent(in) :: x
integer(psb_long_int_k_) :: res
res = psb_sizeof_dp*x%get_nrows()
res = (1_psb_long_int_k_ * psb_sizeof_dp) * x%get_nrows()
end function d_base_sizeof
function d_base_dot_v(n,x,y) result(res)
@@ -227,24 +233,15 @@ contains
end subroutine d_base_axpby_a
subroutine d_base_mlt_v(x, y, info, xconj)
subroutine d_base_mlt_v(x, y, info)
use psi_serial_mod
use psb_string_mod
implicit none
class(psb_d_base_vect_type), intent(inout) :: x
class(psb_d_base_vect_type), intent(inout) :: y
integer, intent(out) :: info
character, intent(in), optional :: xconj
integer :: i, n
character :: xconj_
class(psb_d_base_vect_type), intent(inout) :: x
class(psb_d_base_vect_type), intent(inout) :: y
integer, intent(out) :: info
integer :: i, n
info = 0
if (present(xconj)) then
xconj_ = (psb_toupper(xconj))
else
xconj_ = 'N'
end if
select type(xx => x)
type is (psb_d_base_vect_type)
n = min(size(y%v), size(xx%v))
@@ -342,20 +339,33 @@ contains
end if
end subroutine d_base_mlt_a_2
subroutine d_base_mlt_v_2(alpha,x,y,beta,z,info)
subroutine d_base_mlt_v_2(alpha,x,y,beta,z,info,conjgx,conjgy)
use psi_serial_mod
use psb_string_mod
implicit none
real(psb_dpk_), intent(in) :: alpha,beta
class(psb_d_base_vect_type), intent(inout) :: x
class(psb_d_base_vect_type), intent(inout) :: y
class(psb_d_base_vect_type), intent(inout) :: z
integer, intent(out) :: info
character(len=1), intent(in), optional :: conjgx, conjgy
integer :: i, n
logical :: conjgx_, conjgy_
info = 0
call z%mlt(alpha,x%v,y%v,beta,info)
if (.not.psb_d_is_complex_) then
call z%mlt(alpha,x%v,y%v,beta,info)
else
conjgx_=.false.
if (present(conjgx)) conjgx_ = (psb_toupper(conjgx)=='C')
conjgy_=.false.
if (present(conjgy)) conjgy_ = (psb_toupper(conjgy)=='C')
if (conjgx_) x%v=(x%v)
if (conjgy_) y%v=(y%v)
call z%mlt(alpha,x%v,y%v,beta,info)
if (conjgx_) x%v=(x%v)
if (conjgy_) y%v=(y%v)
end if
end subroutine d_base_mlt_v_2
subroutine d_base_mlt_av(alpha,x,y,beta,z,info)
+4 -4
View File
@@ -699,7 +699,7 @@ module psb_d_mat_mod
import :: psb_dspmat_type, psb_dpk_
class(psb_dspmat_type), intent(in) :: a
real(psb_dpk_), intent(out) :: d(:)
integer, intent(out) :: info
integer, intent(out) :: info
end subroutine psb_d_aclsum
end interface
@@ -708,7 +708,7 @@ module psb_d_mat_mod
subroutine psb_d_get_diag(a,d,info)
import :: psb_dspmat_type, psb_dpk_
class(psb_dspmat_type), intent(in) :: a
real(psb_dpk_), intent(out) :: d(:)
real(psb_dpk_), intent(out) :: d(:)
integer, intent(out) :: info
end subroutine psb_d_get_diag
end interface
@@ -717,13 +717,13 @@ module psb_d_mat_mod
subroutine psb_d_scal(d,a,info)
import :: psb_dspmat_type, psb_dpk_
class(psb_dspmat_type), intent(inout) :: a
real(psb_dpk_), intent(in) :: d(:)
real(psb_dpk_), intent(in) :: d(:)
integer, intent(out) :: info
end subroutine psb_d_scal
subroutine psb_d_scals(d,a,info)
import :: psb_dspmat_type, psb_dpk_
class(psb_dspmat_type), intent(inout) :: a
real(psb_dpk_), intent(in) :: d
real(psb_dpk_), intent(in) :: d
integer, intent(out) :: info
end subroutine psb_d_scals
end interface
+30 -26
View File
@@ -32,13 +32,13 @@
!
! package: psb_s_base_mat_mod
!
! This module contains the implementation of the
! psb_s_base_sparse_mat, derived from the psb_base_sparse_mat to
! define a middle level definition of a real, single-precision sparse
! matrix object.This class object itself does not have any additional
! members with respect to those of the base class. No methods can be
! fully implemented at this level, but we can define the interface for
! the computational methods requiring the knowledge of the underlying
! This module contains the implementation of the psb_s_base_sparse_mat
! type, derived from the psb_base_sparse_mat one to define a middle
! level definition of a real(psb_spk_) sparse matrix
! object.This class object itself does not have any additional members
! with respect to those of the base class. No methods can be fully
! implemented at this level, but we can define the interface for the
! computational methods requiring the knowledge of the underlying
! field, such as the matrix-vector product; this interface is defined,
! but is supposed to be overridden at the leaf level.
!
@@ -50,11 +50,9 @@
! psb_s_base_sparse_mat one.
!
! About the method MOLD: this has been defined for those compilers
! not yet supporting ALLOCATE( ...MOLD=...); it's otherwise silly to
! not yet supporting ALLOCATE( ...,MOLD=...); it's otherwise silly to
! duplicate "by hand" what is specified in the language (in this case F2008)
!
module psb_s_base_mat_mod
use psb_base_mat_mod
@@ -134,13 +132,6 @@ module psb_s_base_mat_mod
procedure, pass(a) :: s_inner_cssv => psb_s_coo_cssv
procedure, pass(a) :: s_scals => psb_s_coo_scals
procedure, pass(a) :: s_scal => psb_s_coo_scal
procedure, pass(a) :: maxval => psb_s_coo_maxval
procedure, pass(a) :: csnmi => psb_s_coo_csnmi
procedure, pass(a) :: csnm1 => psb_s_coo_csnm1
procedure, pass(a) :: rowsum => psb_s_coo_rowsum
procedure, pass(a) :: arwsum => psb_s_coo_arwsum
procedure, pass(a) :: colsum => psb_s_coo_colsum
procedure, pass(a) :: aclsum => psb_s_coo_aclsum
procedure, pass(a) :: reallocate_nz => psb_s_coo_reallocate_nz
procedure, pass(a) :: allocate_mnnz => psb_s_coo_allocate_mnnz
procedure, pass(a) :: cp_to_coo => psb_s_cp_coo_to_coo
@@ -152,6 +143,13 @@ module psb_s_base_mat_mod
procedure, pass(a) :: mv_to_fmt => psb_s_mv_coo_to_fmt
procedure, pass(a) :: mv_from_fmt => psb_s_mv_coo_from_fmt
procedure, pass(a) :: csput => psb_s_coo_csput
procedure, pass(a) :: maxval => psb_s_coo_maxval
procedure, pass(a) :: csnmi => psb_s_coo_csnmi
procedure, pass(a) :: csnm1 => psb_s_coo_csnm1
procedure, pass(a) :: rowsum => psb_s_coo_rowsum
procedure, pass(a) :: arwsum => psb_s_coo_arwsum
procedure, pass(a) :: colsum => psb_s_coo_colsum
procedure, pass(a) :: aclsum => psb_s_coo_aclsum
procedure, pass(a) :: get_diag => psb_s_coo_get_diag
procedure, pass(a) :: s_csgetrow => psb_s_coo_csgetrow
procedure, pass(a) :: csgetptn => psb_s_coo_csgetptn
@@ -217,7 +215,7 @@ module psb_s_base_mat_mod
character, optional, intent(in) :: trans
end subroutine psb_s_base_vect_mv
end interface
interface
subroutine psb_s_base_inner_cssm(alpha,a,x,beta,y,info,trans)
import :: psb_s_base_sparse_mat, psb_spk_
@@ -312,7 +310,7 @@ module psb_s_base_mat_mod
real(psb_spk_) :: res
end function psb_s_base_maxval
end interface
interface
function psb_s_base_csnmi(a) result(res)
import :: psb_s_base_sparse_mat, psb_spk_
@@ -360,7 +358,7 @@ module psb_s_base_mat_mod
real(psb_spk_), intent(out) :: d(:)
end subroutine psb_s_base_aclsum
end interface
interface
subroutine psb_s_base_get_diag(a,d,info)
import :: psb_s_base_sparse_mat, psb_spk_
@@ -512,7 +510,7 @@ module psb_s_base_mat_mod
subroutine psb_s_base_transp_2mat(a,b)
import :: psb_s_base_sparse_mat, psb_base_sparse_mat, psb_spk_
class(psb_s_base_sparse_mat), intent(in) :: a
class(psb_base_sparse_mat), intent(out) :: b
class(psb_base_sparse_mat), intent(out) :: b
end subroutine psb_s_base_transp_2mat
end interface
@@ -520,7 +518,7 @@ module psb_s_base_mat_mod
subroutine psb_s_base_transc_2mat(a,b)
import :: psb_s_base_sparse_mat, psb_base_sparse_mat, psb_spk_
class(psb_s_base_sparse_mat), intent(in) :: a
class(psb_base_sparse_mat), intent(out) :: b
class(psb_base_sparse_mat), intent(out) :: b
end subroutine psb_s_base_transc_2mat
end interface
@@ -578,7 +576,7 @@ module psb_s_base_mat_mod
integer, intent(in), optional :: nz
end subroutine psb_s_coo_allocate_mnnz
end interface
interface
subroutine psb_s_coo_mold(a,b,info)
import :: psb_s_coo_sparse_mat, psb_s_base_sparse_mat, psb_long_int_k_
@@ -588,6 +586,7 @@ module psb_s_base_mat_mod
end subroutine psb_s_coo_mold
end interface
interface
subroutine psb_s_coo_print(iout,a,iv,eirs,eics,head,ivr,ivc)
import :: psb_s_coo_sparse_mat
@@ -621,7 +620,7 @@ module psb_s_base_mat_mod
integer, intent(in), optional :: idir
end subroutine psb_s_fix_coo_inner
end interface
interface
subroutine psb_s_fix_coo(a,info,idir)
import :: psb_s_coo_sparse_mat
@@ -803,7 +802,7 @@ module psb_s_base_mat_mod
end subroutine psb_s_coo_csmm
end interface
interface
function psb_s_coo_maxval(a) result(res)
import :: psb_s_coo_sparse_mat, psb_spk_
@@ -811,7 +810,7 @@ module psb_s_base_mat_mod
real(psb_spk_) :: res
end function psb_s_coo_maxval
end interface
interface
function psb_s_coo_csnmi(a) result(res)
import :: psb_s_coo_sparse_mat, psb_spk_
@@ -1076,6 +1075,11 @@ contains
class(psb_s_coo_sparse_mat), intent(inout) :: a
call a%transp()
! This will morph into conjg() for C and Z
! and into a no-op for S and D, so a conditional
! on a constant ought to take it out completely.
if (psb_s_is_complex_) a%val(:) = (a%val(:))
end subroutine s_coo_transc_1mat
+25 -6
View File
@@ -118,12 +118,14 @@ contains
real(psb_spk_), intent(in) :: val(:)
integer :: nr
integer :: info
if (allocated(x%v)) then
nr = min(size(x%v),size(val))
x%v(1:nr) = val(1:nr)
else
x%v = val
end if
end subroutine s_base_set_vect
@@ -150,15 +152,19 @@ contains
implicit none
class(psb_s_base_vect_type), intent(in) :: x
integer :: res
res = 0
if (allocated(x%v)) res = size(x%v)
end function s_base_get_nrows
function s_base_sizeof(x) result(res)
implicit none
class(psb_s_base_vect_type), intent(in) :: x
integer(psb_long_int_k_) :: res
res = psb_sizeof_sp*x%get_nrows()
res = (1_psb_long_int_k_ * psb_sizeof_sp) * x%get_nrows()
end function s_base_sizeof
function s_base_dot_v(n,x,y) result(res)
@@ -333,20 +339,33 @@ contains
end if
end subroutine s_base_mlt_a_2
subroutine s_base_mlt_v_2(alpha,x,y,beta,z,info)
subroutine s_base_mlt_v_2(alpha,x,y,beta,z,info,conjgx,conjgy)
use psi_serial_mod
use psb_string_mod
implicit none
real(psb_spk_), intent(in) :: alpha,beta
class(psb_s_base_vect_type), intent(inout) :: x
class(psb_s_base_vect_type), intent(inout) :: y
class(psb_s_base_vect_type), intent(inout) :: z
integer, intent(out) :: info
character(len=1), intent(in), optional :: conjgx, conjgy
integer :: i, n
logical :: conjgx_, conjgy_
info = 0
call z%mlt(alpha,x%v,y%v,beta,info)
if (.not.psb_s_is_complex_) then
call z%mlt(alpha,x%v,y%v,beta,info)
else
conjgx_=.false.
if (present(conjgx)) conjgx_ = (psb_toupper(conjgx)=='C')
conjgy_=.false.
if (present(conjgy)) conjgy_ = (psb_toupper(conjgy)=='C')
if (conjgx_) x%v=(x%v)
if (conjgy_) y%v=(y%v)
call z%mlt(alpha,x%v,y%v,beta,info)
if (conjgx_) x%v=(x%v)
if (conjgy_) y%v=(y%v)
end if
end subroutine s_base_mlt_v_2
subroutine s_base_mlt_av(alpha,x,y,beta,z,info)
+54 -54
View File
@@ -337,9 +337,9 @@ module psb_s_mat_mod
interface
subroutine psb_s_csput(nz,ia,ja,val,a,imin,imax,jmin,jmax,info,gtl)
import :: psb_sspmat_type, psb_dpk_
import :: psb_sspmat_type, psb_spk_
class(psb_sspmat_type), intent(inout) :: a
real(psb_dpk_), intent(in) :: val(:)
real(psb_spk_), intent(in) :: val(:)
integer, intent(in) :: nz, ia(:), ja(:), imin,imax,jmin,jmax
integer, intent(out) :: info
integer, intent(in), optional :: gtl(:)
@@ -349,7 +349,7 @@ module psb_s_mat_mod
interface
subroutine psb_s_csgetptn(imin,imax,a,nz,ia,ja,info,&
& jmin,jmax,iren,append,nzin,rscale,cscale)
import :: psb_sspmat_type, psb_dpk_
import :: psb_sspmat_type, psb_spk_
class(psb_sspmat_type), intent(in) :: a
integer, intent(in) :: imin,imax
integer, intent(out) :: nz
@@ -365,12 +365,12 @@ module psb_s_mat_mod
interface
subroutine psb_s_csgetrow(imin,imax,a,nz,ia,ja,val,info,&
& jmin,jmax,iren,append,nzin,rscale,cscale)
import :: psb_sspmat_type, psb_dpk_
import :: psb_sspmat_type, psb_spk_
class(psb_sspmat_type), intent(in) :: a
integer, intent(in) :: imin,imax
integer, intent(out) :: nz
integer, allocatable, intent(inout) :: ia(:), ja(:)
real(psb_dpk_), allocatable, intent(inout) :: val(:)
real(psb_spk_), allocatable, intent(inout) :: val(:)
integer,intent(out) :: info
logical, intent(in), optional :: append
integer, intent(in), optional :: iren(:)
@@ -382,7 +382,7 @@ module psb_s_mat_mod
interface
subroutine psb_s_csgetblk(imin,imax,a,b,info,&
& jmin,jmax,iren,append,rscale,cscale)
import :: psb_sspmat_type, psb_dpk_
import :: psb_sspmat_type, psb_spk_
class(psb_sspmat_type), intent(in) :: a
class(psb_sspmat_type), intent(out) :: b
integer, intent(in) :: imin,imax
@@ -397,7 +397,7 @@ module psb_s_mat_mod
interface
subroutine psb_s_csclip(a,b,info,&
& imin,imax,jmin,jmax,rscale,cscale)
import :: psb_sspmat_type, psb_dpk_
import :: psb_sspmat_type, psb_spk_
class(psb_sspmat_type), intent(in) :: a
class(psb_sspmat_type), intent(out) :: b
integer,intent(out) :: info
@@ -409,7 +409,7 @@ module psb_s_mat_mod
interface
subroutine psb_s_b_csclip(a,b,info,&
& imin,imax,jmin,jmax,rscale,cscale)
import :: psb_sspmat_type, psb_dpk_, psb_s_coo_sparse_mat
import :: psb_sspmat_type, psb_spk_, psb_s_coo_sparse_mat
class(psb_sspmat_type), intent(in) :: a
type(psb_s_coo_sparse_mat), intent(out) :: b
integer,intent(out) :: info
@@ -420,7 +420,7 @@ module psb_s_mat_mod
interface
subroutine psb_s_cscnv(a,b,info,type,mold,upd,dupl)
import :: psb_sspmat_type, psb_dpk_, psb_s_base_sparse_mat
import :: psb_sspmat_type, psb_spk_, psb_s_base_sparse_mat
class(psb_sspmat_type), intent(in) :: a
class(psb_sspmat_type), intent(out) :: b
integer, intent(out) :: info
@@ -433,7 +433,7 @@ module psb_s_mat_mod
interface
subroutine psb_s_cscnv_ip(a,iinfo,type,mold,dupl)
import :: psb_sspmat_type, psb_dpk_, psb_s_base_sparse_mat
import :: psb_sspmat_type, psb_spk_, psb_s_base_sparse_mat
class(psb_sspmat_type), intent(inout) :: a
integer, intent(out) :: iinfo
integer,optional, intent(in) :: dupl
@@ -445,7 +445,7 @@ module psb_s_mat_mod
interface
subroutine psb_s_cscnv_base(a,b,info,dupl)
import :: psb_sspmat_type, psb_dpk_, psb_s_base_sparse_mat
import :: psb_sspmat_type, psb_spk_, psb_s_base_sparse_mat
class(psb_sspmat_type), intent(in) :: a
class(psb_s_base_sparse_mat), intent(out) :: b
integer, intent(out) :: info
@@ -472,7 +472,7 @@ module psb_s_mat_mod
interface
subroutine psb_s_mv_from(a,b)
import :: psb_sspmat_type, psb_dpk_, psb_s_base_sparse_mat
import :: psb_sspmat_type, psb_spk_, psb_s_base_sparse_mat
class(psb_sspmat_type), intent(out) :: a
class(psb_s_base_sparse_mat), intent(inout) :: b
end subroutine psb_s_mv_from
@@ -480,7 +480,7 @@ module psb_s_mat_mod
interface
subroutine psb_s_cp_from(a,b)
import :: psb_sspmat_type, psb_dpk_, psb_s_base_sparse_mat
import :: psb_sspmat_type, psb_spk_, psb_s_base_sparse_mat
class(psb_sspmat_type), intent(out) :: a
class(psb_s_base_sparse_mat), intent(inout), allocatable :: b
end subroutine psb_s_cp_from
@@ -488,7 +488,7 @@ module psb_s_mat_mod
interface
subroutine psb_s_mv_to(a,b)
import :: psb_sspmat_type, psb_dpk_, psb_s_base_sparse_mat
import :: psb_sspmat_type, psb_spk_, psb_s_base_sparse_mat
class(psb_sspmat_type), intent(inout) :: a
class(psb_s_base_sparse_mat), intent(out) :: b
end subroutine psb_s_mv_to
@@ -496,7 +496,7 @@ module psb_s_mat_mod
interface
subroutine psb_s_cp_to(a,b)
import :: psb_sspmat_type, psb_dpk_, psb_s_base_sparse_mat
import :: psb_sspmat_type, psb_spk_, psb_s_base_sparse_mat
class(psb_sspmat_type), intent(in) :: a
class(psb_s_base_sparse_mat), intent(out) :: b
end subroutine psb_s_cp_to
@@ -584,26 +584,26 @@ module psb_s_mat_mod
interface psb_csmm
subroutine psb_s_csmm(alpha,a,x,beta,y,info,trans)
import :: psb_sspmat_type, psb_dpk_
import :: psb_sspmat_type, psb_spk_
class(psb_sspmat_type), intent(in) :: a
real(psb_dpk_), intent(in) :: alpha, beta, x(:,:)
real(psb_dpk_), intent(inout) :: y(:,:)
real(psb_spk_), intent(in) :: alpha, beta, x(:,:)
real(psb_spk_), intent(inout) :: y(:,:)
integer, intent(out) :: info
character, optional, intent(in) :: trans
end subroutine psb_s_csmm
subroutine psb_s_csmv(alpha,a,x,beta,y,info,trans)
import :: psb_sspmat_type, psb_dpk_
import :: psb_sspmat_type, psb_spk_
class(psb_sspmat_type), intent(in) :: a
real(psb_dpk_), intent(in) :: alpha, beta, x(:)
real(psb_dpk_), intent(inout) :: y(:)
real(psb_spk_), intent(in) :: alpha, beta, x(:)
real(psb_spk_), intent(inout) :: y(:)
integer, intent(out) :: info
character, optional, intent(in) :: trans
end subroutine psb_s_csmv
subroutine psb_s_csmv_vect(alpha,a,x,beta,y,info,trans)
use psb_s_vect_mod, only : psb_s_vect_type
import :: psb_sspmat_type, psb_dpk_
import :: psb_sspmat_type, psb_spk_
class(psb_sspmat_type), intent(in) :: a
real(psb_dpk_), intent(in) :: alpha, beta
real(psb_spk_), intent(in) :: alpha, beta
type(psb_s_vect_type), intent(inout) :: x
type(psb_s_vect_type), intent(inout) :: y
integer, intent(out) :: info
@@ -613,28 +613,28 @@ module psb_s_mat_mod
interface psb_cssm
subroutine psb_s_cssm(alpha,a,x,beta,y,info,trans,scale,d)
import :: psb_sspmat_type, psb_dpk_
import :: psb_sspmat_type, psb_spk_
class(psb_sspmat_type), intent(in) :: a
real(psb_dpk_), intent(in) :: alpha, beta, x(:,:)
real(psb_dpk_), intent(inout) :: y(:,:)
real(psb_spk_), intent(in) :: alpha, beta, x(:,:)
real(psb_spk_), intent(inout) :: y(:,:)
integer, intent(out) :: info
character, optional, intent(in) :: trans, scale
real(psb_dpk_), intent(in), optional :: d(:)
real(psb_spk_), intent(in), optional :: d(:)
end subroutine psb_s_cssm
subroutine psb_s_cssv(alpha,a,x,beta,y,info,trans,scale,d)
import :: psb_sspmat_type, psb_dpk_
import :: psb_sspmat_type, psb_spk_
class(psb_sspmat_type), intent(in) :: a
real(psb_dpk_), intent(in) :: alpha, beta, x(:)
real(psb_dpk_), intent(inout) :: y(:)
real(psb_spk_), intent(in) :: alpha, beta, x(:)
real(psb_spk_), intent(inout) :: y(:)
integer, intent(out) :: info
character, optional, intent(in) :: trans, scale
real(psb_dpk_), intent(in), optional :: d(:)
real(psb_spk_), intent(in), optional :: d(:)
end subroutine psb_s_cssv
subroutine psb_s_cssv_vect(alpha,a,x,beta,y,info,trans,scale,d)
use psb_s_vect_mod, only : psb_s_vect_type
import :: psb_sspmat_type, psb_dpk_
import :: psb_sspmat_type, psb_spk_
class(psb_sspmat_type), intent(in) :: a
real(psb_dpk_), intent(in) :: alpha, beta
real(psb_spk_), intent(in) :: alpha, beta
type(psb_s_vect_type), intent(inout) :: x
type(psb_s_vect_type), intent(inout) :: y
integer, intent(out) :: info
@@ -645,85 +645,85 @@ module psb_s_mat_mod
interface
function psb_s_maxval(a) result(res)
import :: psb_sspmat_type, psb_dpk_
import :: psb_sspmat_type, psb_spk_
class(psb_sspmat_type), intent(in) :: a
real(psb_dpk_) :: res
real(psb_spk_) :: res
end function psb_s_maxval
end interface
interface
function psb_s_csnmi(a) result(res)
import :: psb_sspmat_type, psb_dpk_
import :: psb_sspmat_type, psb_spk_
class(psb_sspmat_type), intent(in) :: a
real(psb_dpk_) :: res
real(psb_spk_) :: res
end function psb_s_csnmi
end interface
interface
function psb_s_csnm1(a) result(res)
import :: psb_sspmat_type, psb_dpk_
import :: psb_sspmat_type, psb_spk_
class(psb_sspmat_type), intent(in) :: a
real(psb_dpk_) :: res
real(psb_spk_) :: res
end function psb_s_csnm1
end interface
interface
subroutine psb_s_rowsum(d,a,info)
import :: psb_sspmat_type, psb_dpk_
import :: psb_sspmat_type, psb_spk_
class(psb_sspmat_type), intent(in) :: a
real(psb_dpk_), intent(out) :: d(:)
real(psb_spk_), intent(out) :: d(:)
integer, intent(out) :: info
end subroutine psb_s_rowsum
end interface
interface
subroutine psb_s_arwsum(d,a,info)
import :: psb_sspmat_type, psb_dpk_
import :: psb_sspmat_type, psb_spk_
class(psb_sspmat_type), intent(in) :: a
real(psb_dpk_), intent(out) :: d(:)
real(psb_spk_), intent(out) :: d(:)
integer, intent(out) :: info
end subroutine psb_s_arwsum
end interface
interface
subroutine psb_s_colsum(d,a,info)
import :: psb_sspmat_type, psb_dpk_
import :: psb_sspmat_type, psb_spk_
class(psb_sspmat_type), intent(in) :: a
real(psb_dpk_), intent(out) :: d(:)
real(psb_spk_), intent(out) :: d(:)
integer, intent(out) :: info
end subroutine psb_s_colsum
end interface
interface
subroutine psb_s_aclsum(d,a,info)
import :: psb_sspmat_type, psb_dpk_
import :: psb_sspmat_type, psb_spk_
class(psb_sspmat_type), intent(in) :: a
real(psb_dpk_), intent(out) :: d(:)
integer, intent(out) :: info
real(psb_spk_), intent(out) :: d(:)
integer, intent(out) :: info
end subroutine psb_s_aclsum
end interface
interface
subroutine psb_s_get_diag(a,d,info)
import :: psb_sspmat_type, psb_dpk_
import :: psb_sspmat_type, psb_spk_
class(psb_sspmat_type), intent(in) :: a
real(psb_dpk_), intent(out) :: d(:)
real(psb_spk_), intent(out) :: d(:)
integer, intent(out) :: info
end subroutine psb_s_get_diag
end interface
interface psb_scal
subroutine psb_s_scal(d,a,info)
import :: psb_sspmat_type, psb_dpk_
import :: psb_sspmat_type, psb_spk_
class(psb_sspmat_type), intent(inout) :: a
real(psb_dpk_), intent(in) :: d(:)
real(psb_spk_), intent(in) :: d(:)
integer, intent(out) :: info
end subroutine psb_s_scal
subroutine psb_s_scals(d,a,info)
import :: psb_sspmat_type, psb_dpk_
import :: psb_sspmat_type, psb_spk_
class(psb_sspmat_type), intent(inout) :: a
real(psb_dpk_), intent(in) :: d
real(psb_spk_), intent(in) :: d
integer, intent(out) :: info
end subroutine psb_s_scals
end interface
+64 -92
View File
@@ -118,14 +118,15 @@ contains
complex(psb_dpk_), intent(in) :: val(:)
integer :: nr
integer :: info
if (allocated(x%v)) then
nr = min(size(x%v),size(val))
x%v(1:nr) = val(1:nr)
else
x%v = val
end if
end subroutine z_base_set_vect
end subroutine z_base_set_vect
function constructor(x) result(this)
@@ -151,23 +152,27 @@ contains
implicit none
class(psb_z_base_vect_type), intent(in) :: x
integer :: res
res = 0
if (allocated(x%v)) res = size(x%v)
end function z_base_get_nrows
function z_base_sizeof(x) result(res)
implicit none
class(psb_z_base_vect_type), intent(in) :: x
integer(psb_long_int_k_) :: res
res = (2*psb_sizeof_dp)*x%get_nrows()
res = (1_psb_long_int_k_ * (2*psb_sizeof_dp)) * x%get_nrows()
end function z_base_sizeof
function z_base_dot_v(n,x,y) result(res)
implicit none
class(psb_z_base_vect_type), intent(inout) :: x, y
integer, intent(in) :: n
complex(psb_dpk_) :: res
complex(psb_dpk_), external :: zdotc
complex(psb_dpk_) :: res
complex(psb_dpk_), external :: zdotc
res = zzero
!
@@ -187,10 +192,10 @@ contains
function z_base_dot_a(n,x,y) result(res)
implicit none
class(psb_z_base_vect_type), intent(inout) :: x
complex(psb_dpk_), intent(in) :: y(:)
complex(psb_dpk_), intent(in) :: y(:)
integer, intent(in) :: n
complex(psb_dpk_) :: res
complex(psb_dpk_), external :: zdotc
complex(psb_dpk_) :: res
complex(psb_dpk_), external :: zdotc
res = zdotc(n,y,1,x%v,1)
@@ -202,7 +207,7 @@ contains
integer, intent(in) :: m
class(psb_z_base_vect_type), intent(inout) :: x
class(psb_z_base_vect_type), intent(inout) :: y
complex(psb_dpk_), intent (in) :: alpha, beta
complex(psb_dpk_), intent (in) :: alpha, beta
integer, intent(out) :: info
select type(xx => x)
@@ -228,72 +233,41 @@ contains
end subroutine z_base_axpby_a
subroutine z_base_mlt_v(x, y, info, xconj)
subroutine z_base_mlt_v(x, y, info)
use psi_serial_mod
use psb_string_mod
implicit none
class(psb_z_base_vect_type), intent(inout) :: x
class(psb_z_base_vect_type), intent(inout) :: y
integer, intent(out) :: info
character, intent(in), optional :: xconj
integer :: i, n
character :: xconj_
class(psb_z_base_vect_type), intent(inout) :: x
class(psb_z_base_vect_type), intent(inout) :: y
integer, intent(out) :: info
integer :: i, n
info = 0
if (present(xconj)) then
xconj_ = (psb_toupper(xconj))
else
xconj_ = 'N'
end if
select type(xx => x)
type is (psb_z_base_vect_type)
n = min(size(y%v), size(xx%v))
select case (xconj_)
case ('C')
do i=1, n
y%v(i) = y%v(i)*conjg(xx%v(i))
end do
case default
do i=1, n
y%v(i) = y%v(i)*xx%v(i)
end do
end select
do i=1, n
y%v(i) = y%v(i)*xx%v(i)
end do
class default
call y%mlt(x%v,info,xconj)
call y%mlt(x%v,info)
end select
end subroutine z_base_mlt_v
subroutine z_base_mlt_a(x, y, info, xconj)
subroutine z_base_mlt_a(x, y, info)
use psi_serial_mod
use psb_string_mod
implicit none
complex(psb_dpk_), intent(in) :: x(:)
class(psb_z_base_vect_type), intent(inout) :: y
integer, intent(out) :: info
character, intent(in), optional :: xconj
character :: xconj_
complex(psb_dpk_), intent(in) :: x(:)
class(psb_z_base_vect_type), intent(inout) :: y
integer, intent(out) :: info
integer :: i, n
info = 0
if (present(xconj)) then
xconj_ = (psb_toupper(xconj))
else
xconj_ = 'N'
end if
n = min(size(y%v), size(x))
select case (xconj_)
case ('C')
do i=1, n
y%v(i) = y%v(i)*conjg(x(i))
end do
case default
do i=1, n
y%v(i) = y%v(i)*x(i)
end do
end select
do i=1, n
y%v(i) = y%v(i)*x(i)
end do
end subroutine z_base_mlt_a
@@ -365,44 +339,43 @@ contains
end if
end subroutine z_base_mlt_a_2
subroutine z_base_mlt_v_2(alpha,x,y,beta,z,info,xconj,yconj)
subroutine z_base_mlt_v_2(alpha,x,y,beta,z,info,conjgx,conjgy)
use psi_serial_mod
use psb_string_mod
implicit none
complex(psb_dpk_), intent(in) :: alpha,beta
class(psb_z_base_vect_type), intent(inout) :: x
class(psb_z_base_vect_type), intent(inout) :: y
class(psb_z_base_vect_type), intent(inout) :: z
integer, intent(out) :: info
character(len=1), intent(in), optional :: xconj, yconj
complex(psb_dpk_), intent(in) :: alpha,beta
class(psb_z_base_vect_type), intent(inout) :: x
class(psb_z_base_vect_type), intent(inout) :: y
class(psb_z_base_vect_type), intent(inout) :: z
integer, intent(out) :: info
character(len=1), intent(in), optional :: conjgx, conjgy
integer :: i, n
logical :: conjgx_, conjgy_
info = 0
if (present(xconj)) then
if (psb_toupper(xconj)=='C') x%v=conjg(x%v)
if (.not.psb_z_is_complex_) then
call z%mlt(alpha,x%v,y%v,beta,info)
else
conjgx_=.false.
if (present(conjgx)) conjgx_ = (psb_toupper(conjgx)=='C')
conjgy_=.false.
if (present(conjgy)) conjgy_ = (psb_toupper(conjgy)=='C')
if (conjgx_) x%v=conjg(x%v)
if (conjgy_) y%v=conjg(y%v)
call z%mlt(alpha,x%v,y%v,beta,info)
if (conjgx_) x%v=conjg(x%v)
if (conjgy_) y%v=conjg(y%v)
end if
if (present(yconj)) then
if (psb_toupper(yconj)=='C') y%v=conjg(y%v)
end if
call z%mlt(alpha,x%v,y%v,beta,info)
if (present(xconj)) then
if (psb_toupper(xconj)=='C') x%v=conjg(x%v)
end if
if (present(yconj)) then
if (psb_toupper(yconj)=='C') y%v=conjg(y%v)
end if
end subroutine z_base_mlt_v_2
subroutine z_base_mlt_av(alpha,x,y,beta,z,info,xconj,yconj)
subroutine z_base_mlt_av(alpha,x,y,beta,z,info)
use psi_serial_mod
implicit none
complex(psb_dpk_), intent(in) :: alpha,beta
complex(psb_dpk_), intent(in) :: x(:)
class(psb_z_base_vect_type), intent(inout) :: y
class(psb_z_base_vect_type), intent(inout) :: z
integer, intent(out) :: info
character(len=1), intent(in), optional :: xconj, yconj
complex(psb_dpk_), intent(in) :: alpha,beta
complex(psb_dpk_), intent(in) :: x(:)
class(psb_z_base_vect_type), intent(inout) :: y
class(psb_z_base_vect_type), intent(inout) :: z
integer, intent(out) :: info
integer :: i, n
info = 0
@@ -411,20 +384,19 @@ contains
end subroutine z_base_mlt_av
subroutine z_base_mlt_va(alpha,x,y,beta,z,info,xconj,yconj)
subroutine z_base_mlt_va(alpha,x,y,beta,z,info)
use psi_serial_mod
implicit none
complex(psb_dpk_), intent(in) :: alpha,beta
complex(psb_dpk_), intent(in) :: y(:)
class(psb_z_base_vect_type), intent(inout) :: x
class(psb_z_base_vect_type), intent(inout) :: z
integer, intent(out) :: info
character(len=1), intent(in), optional :: xconj, yconj
complex(psb_dpk_), intent(in) :: alpha,beta
complex(psb_dpk_), intent(in) :: y(:)
class(psb_z_base_vect_type), intent(inout) :: x
class(psb_z_base_vect_type), intent(inout) :: z
integer, intent(out) :: info
integer :: i, n
info = 0
call z%mlt(alpha,y,x,beta,info,xconj=yconj,yconj=xconj)
call z%mlt(alpha,y,x,beta,info)
end subroutine z_base_mlt_va
@@ -570,7 +542,7 @@ contains
class(psb_z_base_vect_type), intent(inout) :: x
integer, intent(in) :: n, dupl
integer, intent(in) :: irl(:)
complex(psb_dpk_), intent(in) :: val(:)
complex(psb_dpk_), intent(in) :: val(:)
integer, intent(out) :: info
integer :: i
+4 -4
View File
@@ -699,7 +699,7 @@ module psb_z_mat_mod
import :: psb_zspmat_type, psb_dpk_
class(psb_zspmat_type), intent(in) :: a
real(psb_dpk_), intent(out) :: d(:)
integer, intent(out) :: info
integer, intent(out) :: info
end subroutine psb_z_aclsum
end interface
@@ -708,7 +708,7 @@ module psb_z_mat_mod
subroutine psb_z_get_diag(a,d,info)
import :: psb_zspmat_type, psb_dpk_
class(psb_zspmat_type), intent(in) :: a
complex(psb_dpk_), intent(out) :: d(:)
complex(psb_dpk_), intent(out) :: d(:)
integer, intent(out) :: info
end subroutine psb_z_get_diag
end interface
@@ -717,13 +717,13 @@ module psb_z_mat_mod
subroutine psb_z_scal(d,a,info)
import :: psb_zspmat_type, psb_dpk_
class(psb_zspmat_type), intent(inout) :: a
complex(psb_dpk_), intent(in) :: d(:)
complex(psb_dpk_), intent(in) :: d(:)
integer, intent(out) :: info
end subroutine psb_z_scal
subroutine psb_z_scals(d,a,info)
import :: psb_zspmat_type, psb_dpk_
class(psb_zspmat_type), intent(inout) :: a
complex(psb_dpk_), intent(in) :: d
complex(psb_dpk_), intent(in) :: d
integer, intent(out) :: info
end subroutine psb_z_scals
end interface