Added implementation of A = alpha A + beta B for sparse matrices

This commit is contained in:
Cirdans-Home
2020-04-08 09:19:03 +02:00
parent dc55713541
commit 3b36c2196b
20 changed files with 972 additions and 8 deletions
+74 -2
View File
@@ -126,6 +126,7 @@ module psb_c_base_mat_mod
procedure, pass(a) :: colsum => psb_c_base_colsum
procedure, pass(a) :: aclsum => psb_c_base_aclsum
procedure, pass(a) :: scalpid => psb_c_base_scalplusidentity
procedure, pass(a) :: spaxpby => psb_c_base_spaxpby
end type psb_c_base_sparse_mat
private :: c_base_mat_sync, c_base_mat_is_host, c_base_mat_is_dev, &
@@ -228,7 +229,7 @@ module psb_c_base_mat_mod
procedure, pass(a) :: colsum => psb_c_coo_colsum
procedure, pass(a) :: aclsum => psb_c_coo_aclsum
procedure, pass(a) :: scalpid => psb_c_coo_scalplusidentity
procedure, pass(a) :: spaxpby => psb_c_coo_spaxpby
end type psb_c_coo_sparse_mat
private :: c_coo_get_nzeros, c_coo_set_nzeros, &
@@ -293,6 +294,7 @@ module psb_c_base_mat_mod
procedure, pass(a) :: colsum => psb_lc_base_colsum
procedure, pass(a) :: aclsum => psb_lc_base_aclsum
procedure, pass(a) :: scalpid => psb_lc_base_scalplusidentity
procedure, pass(a) :: spaxpby => psb_lc_base_spaxpby
!
! Convert internal indices
!
@@ -394,7 +396,7 @@ module psb_c_base_mat_mod
procedure, pass(a) :: colsum => psb_lc_coo_colsum
procedure, pass(a) :: aclsum => psb_lc_coo_aclsum
procedure, pass(a) :: scalpid => psb_lc_coo_scalplusidentity
procedure, pass(a) :: spaxpby => psb_lc_coo_spaxpby
!
! This is COO specific
!
@@ -1475,6 +1477,28 @@ module psb_c_base_mat_mod
end subroutine psb_c_base_scalplusidentity
end interface
!
!> Function base_spaxpby:
!! \memberof psb_c_base_sparse_mat
!! \brief Scale add tow sparse matrices A = alpha A + beta B
!!
!! \param alpha scaling for A
!! \param A sparse matrix A (intent inout)
!! \param beta scaling for B
!! \param B sparse matrix B (intent in)
!! \param info return code
!
interface
subroutine psb_c_base_spaxpby(alpha,a,beta,b,info)
import
class(psb_c_base_sparse_mat), intent(inout) :: a
class(psb_c_base_sparse_mat), intent(inout) :: b
complex(psb_spk_), intent(in) :: alpha
complex(psb_spk_), intent(in) :: beta
integer(psb_ipk_), intent(out) :: info
end subroutine psb_c_base_spaxpby
end interface
!
!> Function base_maxval:
!! \memberof psb_c_base_sparse_mat
@@ -2131,6 +2155,19 @@ module psb_c_base_mat_mod
integer(psb_ipk_), intent(out) :: info
end subroutine psb_c_coo_scalplusidentity
end interface
!
!! \memberof psb_c_coo_sparse_mat
!! \see psb_c_base_mat_mod::psb_c_base_spaxpby
interface
subroutine psb_c_coo_spaxpby(alpha,a,beta,b,info)
import
class(psb_c_coo_sparse_mat), intent(inout) :: a
class(psb_c_base_sparse_mat), intent(inout) :: b
complex(psb_spk_), intent(in) :: alpha
complex(psb_spk_), intent(in) :: beta
integer(psb_ipk_), intent(out) :: info
end subroutine psb_c_coo_spaxpby
end interface
! == =================
!
@@ -2887,6 +2924,28 @@ module psb_c_base_mat_mod
integer(psb_ipk_), intent(out) :: info
end subroutine psb_lc_base_scalplusidentity
end interface
!
!> Function base_spaxpby:
!! \memberof psb_lc_base_sparse_mat
!! \brief Scale add tow sparse matrices A = alpha A + beta B
!!
!! \param alpha scaling for A
!! \param A sparse matrix A (intent inout)
!! \param beta scaling for B
!! \param B sparse matrix B (intent in)
!! \param info return code
!
interface
subroutine psb_lc_base_spaxpby(alpha,a,beta,b,info)
import
class(psb_lc_base_sparse_mat), intent(inout) :: a
class(psb_lc_base_sparse_mat), intent(inout) :: b
complex(psb_spk_), intent(in) :: alpha
complex(psb_spk_), intent(in) :: beta
integer(psb_ipk_), intent(out) :: info
end subroutine psb_lc_base_spaxpby
end interface
!
!> Function base_scal:
@@ -3496,6 +3555,19 @@ module psb_c_base_mat_mod
integer(psb_ipk_), intent(out) :: info
end subroutine psb_lc_coo_scalplusidentity
end interface
!>
!! \memberof psb_lc_coo_sparse_mat
!! \see psb_lc_base_mat_mod::psb_lc_base_spaxpby
interface
subroutine psb_lc_coo_spaxpby(alpha,a,beta,b,info)
import
class(psb_lc_coo_sparse_mat), intent(inout) :: a
class(psb_lc_base_sparse_mat), intent(inout) :: b
complex(psb_spk_), intent(in) :: alpha
complex(psb_spk_), intent(in) :: beta
integer(psb_ipk_), intent(out) :: info
end subroutine psb_lc_coo_spaxpby
end interface
contains
+24
View File
@@ -234,6 +234,7 @@ module psb_c_mat_mod
procedure, pass(a) :: cssm => psb_c_cssm
generic, public :: spsm => cssm, cssv, cssv_v
procedure, pass(a) :: scalpid => psb_c_scalplusidentity
procedure, pass(a) :: spaxpby => psb_c_spaxpby
end type psb_cspmat_type
@@ -419,6 +420,7 @@ module psb_c_mat_mod
procedure, pass(a) :: scalv => psb_lc_scal
generic, public :: scal => scals, scalv
procedure, pass(a) :: scalpid => psb_lc_scalplusidentity
procedure, pass(a) :: spaxpby => psb_lc_spaxpby
end type psb_lcspmat_type
@@ -1168,6 +1170,17 @@ module psb_c_mat_mod
end subroutine psb_c_scalplusidentity
end interface
interface psb_spaxpby
subroutine psb_c_spaxpby(alpha,a,beta,b,info)
import :: psb_ipk_, psb_lpk_, psb_cspmat_type, psb_spk_
class(psb_cspmat_type), intent(inout) :: a
class(psb_cspmat_type), intent(inout) :: b
complex(psb_spk_), intent(in) :: alpha
complex(psb_spk_), intent(in) :: beta
integer(psb_ipk_), intent(out) :: info
end subroutine psb_c_spaxpby
end interface
! == ===================================
!
!
@@ -1772,6 +1785,17 @@ module psb_c_mat_mod
end subroutine psb_lc_scalplusidentity
end interface
interface psb_spaxpby
subroutine psb_lc_spaxpby(alpha,a,beta,b,info)
import :: psb_ipk_, psb_lpk_, psb_lcspmat_type, psb_spk_
class(psb_lcspmat_type), intent(inout) :: a
class(psb_lcspmat_type), intent(inout) :: b
complex(psb_spk_), intent(in) :: alpha
complex(psb_spk_), intent(in) :: beta
integer(psb_ipk_), intent(out) :: info
end subroutine psb_lc_spaxpby
end interface
interface
function psb_lc_maxval(a) result(res)
import :: psb_ipk_, psb_lpk_, psb_lcspmat_type, psb_spk_
+74 -2
View File
@@ -126,6 +126,7 @@ module psb_d_base_mat_mod
procedure, pass(a) :: colsum => psb_d_base_colsum
procedure, pass(a) :: aclsum => psb_d_base_aclsum
procedure, pass(a) :: scalpid => psb_d_base_scalplusidentity
procedure, pass(a) :: spaxpby => psb_d_base_spaxpby
end type psb_d_base_sparse_mat
private :: d_base_mat_sync, d_base_mat_is_host, d_base_mat_is_dev, &
@@ -228,7 +229,7 @@ module psb_d_base_mat_mod
procedure, pass(a) :: colsum => psb_d_coo_colsum
procedure, pass(a) :: aclsum => psb_d_coo_aclsum
procedure, pass(a) :: scalpid => psb_d_coo_scalplusidentity
procedure, pass(a) :: spaxpby => psb_d_coo_spaxpby
end type psb_d_coo_sparse_mat
private :: d_coo_get_nzeros, d_coo_set_nzeros, &
@@ -293,6 +294,7 @@ module psb_d_base_mat_mod
procedure, pass(a) :: colsum => psb_ld_base_colsum
procedure, pass(a) :: aclsum => psb_ld_base_aclsum
procedure, pass(a) :: scalpid => psb_ld_base_scalplusidentity
procedure, pass(a) :: spaxpby => psb_ld_base_spaxpby
!
! Convert internal indices
!
@@ -394,7 +396,7 @@ module psb_d_base_mat_mod
procedure, pass(a) :: colsum => psb_ld_coo_colsum
procedure, pass(a) :: aclsum => psb_ld_coo_aclsum
procedure, pass(a) :: scalpid => psb_ld_coo_scalplusidentity
procedure, pass(a) :: spaxpby => psb_ld_coo_spaxpby
!
! This is COO specific
!
@@ -1475,6 +1477,28 @@ module psb_d_base_mat_mod
end subroutine psb_d_base_scalplusidentity
end interface
!
!> Function base_spaxpby:
!! \memberof psb_d_base_sparse_mat
!! \brief Scale add tow sparse matrices A = alpha A + beta B
!!
!! \param alpha scaling for A
!! \param A sparse matrix A (intent inout)
!! \param beta scaling for B
!! \param B sparse matrix B (intent in)
!! \param info return code
!
interface
subroutine psb_d_base_spaxpby(alpha,a,beta,b,info)
import
class(psb_d_base_sparse_mat), intent(inout) :: a
class(psb_d_base_sparse_mat), intent(inout) :: b
real(psb_dpk_), intent(in) :: alpha
real(psb_dpk_), intent(in) :: beta
integer(psb_ipk_), intent(out) :: info
end subroutine psb_d_base_spaxpby
end interface
!
!> Function base_maxval:
!! \memberof psb_d_base_sparse_mat
@@ -2131,6 +2155,19 @@ module psb_d_base_mat_mod
integer(psb_ipk_), intent(out) :: info
end subroutine psb_d_coo_scalplusidentity
end interface
!
!! \memberof psb_d_coo_sparse_mat
!! \see psb_d_base_mat_mod::psb_d_base_spaxpby
interface
subroutine psb_d_coo_spaxpby(alpha,a,beta,b,info)
import
class(psb_d_coo_sparse_mat), intent(inout) :: a
class(psb_d_base_sparse_mat), intent(inout) :: b
real(psb_dpk_), intent(in) :: alpha
real(psb_dpk_), intent(in) :: beta
integer(psb_ipk_), intent(out) :: info
end subroutine psb_d_coo_spaxpby
end interface
! == =================
!
@@ -2887,6 +2924,28 @@ module psb_d_base_mat_mod
integer(psb_ipk_), intent(out) :: info
end subroutine psb_ld_base_scalplusidentity
end interface
!
!> Function base_spaxpby:
!! \memberof psb_ld_base_sparse_mat
!! \brief Scale add tow sparse matrices A = alpha A + beta B
!!
!! \param alpha scaling for A
!! \param A sparse matrix A (intent inout)
!! \param beta scaling for B
!! \param B sparse matrix B (intent in)
!! \param info return code
!
interface
subroutine psb_ld_base_spaxpby(alpha,a,beta,b,info)
import
class(psb_ld_base_sparse_mat), intent(inout) :: a
class(psb_ld_base_sparse_mat), intent(inout) :: b
real(psb_dpk_), intent(in) :: alpha
real(psb_dpk_), intent(in) :: beta
integer(psb_ipk_), intent(out) :: info
end subroutine psb_ld_base_spaxpby
end interface
!
!> Function base_scal:
@@ -3496,6 +3555,19 @@ module psb_d_base_mat_mod
integer(psb_ipk_), intent(out) :: info
end subroutine psb_ld_coo_scalplusidentity
end interface
!>
!! \memberof psb_ld_coo_sparse_mat
!! \see psb_ld_base_mat_mod::psb_ld_base_spaxpby
interface
subroutine psb_ld_coo_spaxpby(alpha,a,beta,b,info)
import
class(psb_ld_coo_sparse_mat), intent(inout) :: a
class(psb_ld_base_sparse_mat), intent(inout) :: b
real(psb_dpk_), intent(in) :: alpha
real(psb_dpk_), intent(in) :: beta
integer(psb_ipk_), intent(out) :: info
end subroutine psb_ld_coo_spaxpby
end interface
contains
+24
View File
@@ -234,6 +234,7 @@ module psb_d_mat_mod
procedure, pass(a) :: cssm => psb_d_cssm
generic, public :: spsm => cssm, cssv, cssv_v
procedure, pass(a) :: scalpid => psb_d_scalplusidentity
procedure, pass(a) :: spaxpby => psb_d_spaxpby
end type psb_dspmat_type
@@ -419,6 +420,7 @@ module psb_d_mat_mod
procedure, pass(a) :: scalv => psb_ld_scal
generic, public :: scal => scals, scalv
procedure, pass(a) :: scalpid => psb_ld_scalplusidentity
procedure, pass(a) :: spaxpby => psb_ld_spaxpby
end type psb_ldspmat_type
@@ -1168,6 +1170,17 @@ module psb_d_mat_mod
end subroutine psb_d_scalplusidentity
end interface
interface psb_spaxpby
subroutine psb_d_spaxpby(alpha,a,beta,b,info)
import :: psb_ipk_, psb_lpk_, psb_dspmat_type, psb_dpk_
class(psb_dspmat_type), intent(inout) :: a
class(psb_dspmat_type), intent(inout) :: b
real(psb_dpk_), intent(in) :: alpha
real(psb_dpk_), intent(in) :: beta
integer(psb_ipk_), intent(out) :: info
end subroutine psb_d_spaxpby
end interface
! == ===================================
!
!
@@ -1772,6 +1785,17 @@ module psb_d_mat_mod
end subroutine psb_ld_scalplusidentity
end interface
interface psb_spaxpby
subroutine psb_ld_spaxpby(alpha,a,beta,b,info)
import :: psb_ipk_, psb_lpk_, psb_ldspmat_type, psb_dpk_
class(psb_ldspmat_type), intent(inout) :: a
class(psb_ldspmat_type), intent(inout) :: b
real(psb_dpk_), intent(in) :: alpha
real(psb_dpk_), intent(in) :: beta
integer(psb_ipk_), intent(out) :: info
end subroutine psb_ld_spaxpby
end interface
interface
function psb_ld_maxval(a) result(res)
import :: psb_ipk_, psb_lpk_, psb_ldspmat_type, psb_dpk_
+74 -2
View File
@@ -126,6 +126,7 @@ module psb_s_base_mat_mod
procedure, pass(a) :: colsum => psb_s_base_colsum
procedure, pass(a) :: aclsum => psb_s_base_aclsum
procedure, pass(a) :: scalpid => psb_s_base_scalplusidentity
procedure, pass(a) :: spaxpby => psb_s_base_spaxpby
end type psb_s_base_sparse_mat
private :: s_base_mat_sync, s_base_mat_is_host, s_base_mat_is_dev, &
@@ -228,7 +229,7 @@ module psb_s_base_mat_mod
procedure, pass(a) :: colsum => psb_s_coo_colsum
procedure, pass(a) :: aclsum => psb_s_coo_aclsum
procedure, pass(a) :: scalpid => psb_s_coo_scalplusidentity
procedure, pass(a) :: spaxpby => psb_s_coo_spaxpby
end type psb_s_coo_sparse_mat
private :: s_coo_get_nzeros, s_coo_set_nzeros, &
@@ -293,6 +294,7 @@ module psb_s_base_mat_mod
procedure, pass(a) :: colsum => psb_ls_base_colsum
procedure, pass(a) :: aclsum => psb_ls_base_aclsum
procedure, pass(a) :: scalpid => psb_ls_base_scalplusidentity
procedure, pass(a) :: spaxpby => psb_ls_base_spaxpby
!
! Convert internal indices
!
@@ -394,7 +396,7 @@ module psb_s_base_mat_mod
procedure, pass(a) :: colsum => psb_ls_coo_colsum
procedure, pass(a) :: aclsum => psb_ls_coo_aclsum
procedure, pass(a) :: scalpid => psb_ls_coo_scalplusidentity
procedure, pass(a) :: spaxpby => psb_ls_coo_spaxpby
!
! This is COO specific
!
@@ -1475,6 +1477,28 @@ module psb_s_base_mat_mod
end subroutine psb_s_base_scalplusidentity
end interface
!
!> Function base_spaxpby:
!! \memberof psb_s_base_sparse_mat
!! \brief Scale add tow sparse matrices A = alpha A + beta B
!!
!! \param alpha scaling for A
!! \param A sparse matrix A (intent inout)
!! \param beta scaling for B
!! \param B sparse matrix B (intent in)
!! \param info return code
!
interface
subroutine psb_s_base_spaxpby(alpha,a,beta,b,info)
import
class(psb_s_base_sparse_mat), intent(inout) :: a
class(psb_s_base_sparse_mat), intent(inout) :: b
real(psb_spk_), intent(in) :: alpha
real(psb_spk_), intent(in) :: beta
integer(psb_ipk_), intent(out) :: info
end subroutine psb_s_base_spaxpby
end interface
!
!> Function base_maxval:
!! \memberof psb_s_base_sparse_mat
@@ -2131,6 +2155,19 @@ module psb_s_base_mat_mod
integer(psb_ipk_), intent(out) :: info
end subroutine psb_s_coo_scalplusidentity
end interface
!
!! \memberof psb_s_coo_sparse_mat
!! \see psb_s_base_mat_mod::psb_s_base_spaxpby
interface
subroutine psb_s_coo_spaxpby(alpha,a,beta,b,info)
import
class(psb_s_coo_sparse_mat), intent(inout) :: a
class(psb_s_base_sparse_mat), intent(inout) :: b
real(psb_spk_), intent(in) :: alpha
real(psb_spk_), intent(in) :: beta
integer(psb_ipk_), intent(out) :: info
end subroutine psb_s_coo_spaxpby
end interface
! == =================
!
@@ -2887,6 +2924,28 @@ module psb_s_base_mat_mod
integer(psb_ipk_), intent(out) :: info
end subroutine psb_ls_base_scalplusidentity
end interface
!
!> Function base_spaxpby:
!! \memberof psb_ls_base_sparse_mat
!! \brief Scale add tow sparse matrices A = alpha A + beta B
!!
!! \param alpha scaling for A
!! \param A sparse matrix A (intent inout)
!! \param beta scaling for B
!! \param B sparse matrix B (intent in)
!! \param info return code
!
interface
subroutine psb_ls_base_spaxpby(alpha,a,beta,b,info)
import
class(psb_ls_base_sparse_mat), intent(inout) :: a
class(psb_ls_base_sparse_mat), intent(inout) :: b
real(psb_spk_), intent(in) :: alpha
real(psb_spk_), intent(in) :: beta
integer(psb_ipk_), intent(out) :: info
end subroutine psb_ls_base_spaxpby
end interface
!
!> Function base_scal:
@@ -3496,6 +3555,19 @@ module psb_s_base_mat_mod
integer(psb_ipk_), intent(out) :: info
end subroutine psb_ls_coo_scalplusidentity
end interface
!>
!! \memberof psb_ls_coo_sparse_mat
!! \see psb_ls_base_mat_mod::psb_ls_base_spaxpby
interface
subroutine psb_ls_coo_spaxpby(alpha,a,beta,b,info)
import
class(psb_ls_coo_sparse_mat), intent(inout) :: a
class(psb_ls_base_sparse_mat), intent(inout) :: b
real(psb_spk_), intent(in) :: alpha
real(psb_spk_), intent(in) :: beta
integer(psb_ipk_), intent(out) :: info
end subroutine psb_ls_coo_spaxpby
end interface
contains
+24
View File
@@ -234,6 +234,7 @@ module psb_s_mat_mod
procedure, pass(a) :: cssm => psb_s_cssm
generic, public :: spsm => cssm, cssv, cssv_v
procedure, pass(a) :: scalpid => psb_s_scalplusidentity
procedure, pass(a) :: spaxpby => psb_s_spaxpby
end type psb_sspmat_type
@@ -419,6 +420,7 @@ module psb_s_mat_mod
procedure, pass(a) :: scalv => psb_ls_scal
generic, public :: scal => scals, scalv
procedure, pass(a) :: scalpid => psb_ls_scalplusidentity
procedure, pass(a) :: spaxpby => psb_ls_spaxpby
end type psb_lsspmat_type
@@ -1168,6 +1170,17 @@ module psb_s_mat_mod
end subroutine psb_s_scalplusidentity
end interface
interface psb_spaxpby
subroutine psb_s_spaxpby(alpha,a,beta,b,info)
import :: psb_ipk_, psb_lpk_, psb_sspmat_type, psb_spk_
class(psb_sspmat_type), intent(inout) :: a
class(psb_sspmat_type), intent(inout) :: b
real(psb_spk_), intent(in) :: alpha
real(psb_spk_), intent(in) :: beta
integer(psb_ipk_), intent(out) :: info
end subroutine psb_s_spaxpby
end interface
! == ===================================
!
!
@@ -1772,6 +1785,17 @@ module psb_s_mat_mod
end subroutine psb_ls_scalplusidentity
end interface
interface psb_spaxpby
subroutine psb_ls_spaxpby(alpha,a,beta,b,info)
import :: psb_ipk_, psb_lpk_, psb_lsspmat_type, psb_spk_
class(psb_lsspmat_type), intent(inout) :: a
class(psb_lsspmat_type), intent(inout) :: b
real(psb_spk_), intent(in) :: alpha
real(psb_spk_), intent(in) :: beta
integer(psb_ipk_), intent(out) :: info
end subroutine psb_ls_spaxpby
end interface
interface
function psb_ls_maxval(a) result(res)
import :: psb_ipk_, psb_lpk_, psb_lsspmat_type, psb_spk_
+74 -2
View File
@@ -126,6 +126,7 @@ module psb_z_base_mat_mod
procedure, pass(a) :: colsum => psb_z_base_colsum
procedure, pass(a) :: aclsum => psb_z_base_aclsum
procedure, pass(a) :: scalpid => psb_z_base_scalplusidentity
procedure, pass(a) :: spaxpby => psb_z_base_spaxpby
end type psb_z_base_sparse_mat
private :: z_base_mat_sync, z_base_mat_is_host, z_base_mat_is_dev, &
@@ -228,7 +229,7 @@ module psb_z_base_mat_mod
procedure, pass(a) :: colsum => psb_z_coo_colsum
procedure, pass(a) :: aclsum => psb_z_coo_aclsum
procedure, pass(a) :: scalpid => psb_z_coo_scalplusidentity
procedure, pass(a) :: spaxpby => psb_z_coo_spaxpby
end type psb_z_coo_sparse_mat
private :: z_coo_get_nzeros, z_coo_set_nzeros, &
@@ -293,6 +294,7 @@ module psb_z_base_mat_mod
procedure, pass(a) :: colsum => psb_lz_base_colsum
procedure, pass(a) :: aclsum => psb_lz_base_aclsum
procedure, pass(a) :: scalpid => psb_lz_base_scalplusidentity
procedure, pass(a) :: spaxpby => psb_lz_base_spaxpby
!
! Convert internal indices
!
@@ -394,7 +396,7 @@ module psb_z_base_mat_mod
procedure, pass(a) :: colsum => psb_lz_coo_colsum
procedure, pass(a) :: aclsum => psb_lz_coo_aclsum
procedure, pass(a) :: scalpid => psb_lz_coo_scalplusidentity
procedure, pass(a) :: spaxpby => psb_lz_coo_spaxpby
!
! This is COO specific
!
@@ -1475,6 +1477,28 @@ module psb_z_base_mat_mod
end subroutine psb_z_base_scalplusidentity
end interface
!
!> Function base_spaxpby:
!! \memberof psb_z_base_sparse_mat
!! \brief Scale add tow sparse matrices A = alpha A + beta B
!!
!! \param alpha scaling for A
!! \param A sparse matrix A (intent inout)
!! \param beta scaling for B
!! \param B sparse matrix B (intent in)
!! \param info return code
!
interface
subroutine psb_z_base_spaxpby(alpha,a,beta,b,info)
import
class(psb_z_base_sparse_mat), intent(inout) :: a
class(psb_z_base_sparse_mat), intent(inout) :: b
complex(psb_dpk_), intent(in) :: alpha
complex(psb_dpk_), intent(in) :: beta
integer(psb_ipk_), intent(out) :: info
end subroutine psb_z_base_spaxpby
end interface
!
!> Function base_maxval:
!! \memberof psb_z_base_sparse_mat
@@ -2131,6 +2155,19 @@ module psb_z_base_mat_mod
integer(psb_ipk_), intent(out) :: info
end subroutine psb_z_coo_scalplusidentity
end interface
!
!! \memberof psb_z_coo_sparse_mat
!! \see psb_z_base_mat_mod::psb_z_base_spaxpby
interface
subroutine psb_z_coo_spaxpby(alpha,a,beta,b,info)
import
class(psb_z_coo_sparse_mat), intent(inout) :: a
class(psb_z_base_sparse_mat), intent(inout) :: b
complex(psb_dpk_), intent(in) :: alpha
complex(psb_dpk_), intent(in) :: beta
integer(psb_ipk_), intent(out) :: info
end subroutine psb_z_coo_spaxpby
end interface
! == =================
!
@@ -2887,6 +2924,28 @@ module psb_z_base_mat_mod
integer(psb_ipk_), intent(out) :: info
end subroutine psb_lz_base_scalplusidentity
end interface
!
!> Function base_spaxpby:
!! \memberof psb_lz_base_sparse_mat
!! \brief Scale add tow sparse matrices A = alpha A + beta B
!!
!! \param alpha scaling for A
!! \param A sparse matrix A (intent inout)
!! \param beta scaling for B
!! \param B sparse matrix B (intent in)
!! \param info return code
!
interface
subroutine psb_lz_base_spaxpby(alpha,a,beta,b,info)
import
class(psb_lz_base_sparse_mat), intent(inout) :: a
class(psb_lz_base_sparse_mat), intent(inout) :: b
complex(psb_dpk_), intent(in) :: alpha
complex(psb_dpk_), intent(in) :: beta
integer(psb_ipk_), intent(out) :: info
end subroutine psb_lz_base_spaxpby
end interface
!
!> Function base_scal:
@@ -3496,6 +3555,19 @@ module psb_z_base_mat_mod
integer(psb_ipk_), intent(out) :: info
end subroutine psb_lz_coo_scalplusidentity
end interface
!>
!! \memberof psb_lz_coo_sparse_mat
!! \see psb_lz_base_mat_mod::psb_lz_base_spaxpby
interface
subroutine psb_lz_coo_spaxpby(alpha,a,beta,b,info)
import
class(psb_lz_coo_sparse_mat), intent(inout) :: a
class(psb_lz_base_sparse_mat), intent(inout) :: b
complex(psb_dpk_), intent(in) :: alpha
complex(psb_dpk_), intent(in) :: beta
integer(psb_ipk_), intent(out) :: info
end subroutine psb_lz_coo_spaxpby
end interface
contains
+24
View File
@@ -234,6 +234,7 @@ module psb_z_mat_mod
procedure, pass(a) :: cssm => psb_z_cssm
generic, public :: spsm => cssm, cssv, cssv_v
procedure, pass(a) :: scalpid => psb_z_scalplusidentity
procedure, pass(a) :: spaxpby => psb_z_spaxpby
end type psb_zspmat_type
@@ -419,6 +420,7 @@ module psb_z_mat_mod
procedure, pass(a) :: scalv => psb_lz_scal
generic, public :: scal => scals, scalv
procedure, pass(a) :: scalpid => psb_lz_scalplusidentity
procedure, pass(a) :: spaxpby => psb_lz_spaxpby
end type psb_lzspmat_type
@@ -1168,6 +1170,17 @@ module psb_z_mat_mod
end subroutine psb_z_scalplusidentity
end interface
interface psb_spaxpby
subroutine psb_z_spaxpby(alpha,a,beta,b,info)
import :: psb_ipk_, psb_lpk_, psb_zspmat_type, psb_dpk_
class(psb_zspmat_type), intent(inout) :: a
class(psb_zspmat_type), intent(inout) :: b
complex(psb_dpk_), intent(in) :: alpha
complex(psb_dpk_), intent(in) :: beta
integer(psb_ipk_), intent(out) :: info
end subroutine psb_z_spaxpby
end interface
! == ===================================
!
!
@@ -1772,6 +1785,17 @@ module psb_z_mat_mod
end subroutine psb_lz_scalplusidentity
end interface
interface psb_spaxpby
subroutine psb_lz_spaxpby(alpha,a,beta,b,info)
import :: psb_ipk_, psb_lpk_, psb_lzspmat_type, psb_dpk_
class(psb_lzspmat_type), intent(inout) :: a
class(psb_lzspmat_type), intent(inout) :: b
complex(psb_dpk_), intent(in) :: alpha
complex(psb_dpk_), intent(in) :: beta
integer(psb_ipk_), intent(out) :: info
end subroutine psb_lz_spaxpby
end interface
interface
function psb_lz_maxval(a) result(res)
import :: psb_ipk_, psb_lpk_, psb_lzspmat_type, psb_dpk_