base/modules/psb_c_base_mat_mod.f90
 base/modules/psb_c_csc_mat_mod.f90
 base/modules/psb_c_csr_mat_mod.f90
 base/modules/psb_d_base_mat_mod.f90
 base/modules/psb_d_csc_mat_mod.f90
 base/modules/psb_d_csr_mat_mod.f90
 base/modules/psb_s_base_mat_mod.f90
 base/modules/psb_s_csc_mat_mod.f90
 base/modules/psb_s_csr_mat_mod.f90
 base/modules/psb_z_base_mat_mod.f90
 base/modules/psb_z_csc_mat_mod.f90
 base/modules/psb_z_csr_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_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_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_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

Fix use of is_by_rows/is_by_cols  MV|CP FROM_COO and select type COO
in FROM|TO_FMT
psblas3-accel
Salvatore Filippone 10 years ago
parent 13f163e0be
commit 9cf678a3ea

@ -133,7 +133,7 @@ module psb_c_base_mat_mod
!> Coefficient values. !> Coefficient values.
complex(psb_spk_), allocatable :: val(:) complex(psb_spk_), allocatable :: val(:)
integer, private :: sort_status=psb_unsorted_ integer, private :: sort_status=psb_unsorted_
contains contains
! !
@ -170,6 +170,7 @@ module psb_c_base_mat_mod
procedure, pass(a) :: set_by_rows => c_coo_set_by_rows procedure, pass(a) :: set_by_rows => c_coo_set_by_rows
procedure, pass(a) :: set_by_cols => c_coo_set_by_cols procedure, pass(a) :: set_by_cols => c_coo_set_by_cols
procedure, pass(a) :: set_sort_status => c_coo_set_sort_status procedure, pass(a) :: set_sort_status => c_coo_set_sort_status
procedure, pass(a) :: get_sort_status => c_coo_get_sort_status
! !
! This is COO specific ! This is COO specific
@ -586,7 +587,7 @@ module psb_c_base_mat_mod
subroutine psb_c_base_cp_from_coo(a,b,info) subroutine psb_c_base_cp_from_coo(a,b,info)
import :: psb_ipk_, psb_c_base_sparse_mat, psb_c_coo_sparse_mat, psb_spk_ import :: psb_ipk_, psb_c_base_sparse_mat, psb_c_coo_sparse_mat, psb_spk_
class(psb_c_base_sparse_mat), intent(inout) :: a class(psb_c_base_sparse_mat), intent(inout) :: a
class(psb_c_coo_sparse_mat), intent(in) :: b class(psb_c_coo_sparse_mat), intent(in) :: b
integer(psb_ipk_), intent(out) :: info integer(psb_ipk_), intent(out) :: info
end subroutine psb_c_base_cp_from_coo end subroutine psb_c_base_cp_from_coo
end interface end interface
@ -656,7 +657,7 @@ module psb_c_base_mat_mod
subroutine psb_c_base_mv_from_coo(a,b,info) subroutine psb_c_base_mv_from_coo(a,b,info)
import :: psb_ipk_, psb_c_base_sparse_mat, psb_c_coo_sparse_mat, psb_spk_ import :: psb_ipk_, psb_c_base_sparse_mat, psb_c_coo_sparse_mat, psb_spk_
class(psb_c_base_sparse_mat), intent(inout) :: a class(psb_c_base_sparse_mat), intent(inout) :: a
class(psb_c_coo_sparse_mat), intent(inout) :: b class(psb_c_coo_sparse_mat), intent(inout) :: b
integer(psb_ipk_), intent(out) :: info integer(psb_ipk_), intent(out) :: info
end subroutine psb_c_base_mv_from_coo end subroutine psb_c_base_mv_from_coo
end interface end interface
@ -1367,7 +1368,7 @@ module psb_c_base_mat_mod
import :: psb_ipk_, psb_c_coo_sparse_mat import :: psb_ipk_, psb_c_coo_sparse_mat
class(psb_c_coo_sparse_mat), intent(inout) :: a class(psb_c_coo_sparse_mat), intent(inout) :: a
class(psb_c_coo_sparse_mat), intent(in) :: b class(psb_c_coo_sparse_mat), intent(in) :: b
integer(psb_ipk_), intent(out) :: info integer(psb_ipk_), intent(out) :: info
end subroutine psb_c_cp_coo_from_coo end subroutine psb_c_cp_coo_from_coo
end interface end interface
@ -1812,6 +1813,14 @@ contains
end subroutine c_coo_set_nzeros end subroutine c_coo_set_nzeros
function c_coo_get_sort_status(a) result(res)
implicit none
integer(psb_ipk_) :: res
class(psb_c_coo_sparse_mat), intent(in) :: a
res = a%sort_status
end function c_coo_get_sort_status
subroutine c_coo_set_sort_status(ist,a) subroutine c_coo_set_sort_status(ist,a)
implicit none implicit none
integer(psb_ipk_), intent(in) :: ist integer(psb_ipk_), intent(in) :: ist

@ -186,7 +186,7 @@ module psb_c_csc_mat_mod
import :: psb_ipk_, psb_c_csc_sparse_mat, psb_c_coo_sparse_mat import :: psb_ipk_, psb_c_csc_sparse_mat, psb_c_coo_sparse_mat
class(psb_c_csc_sparse_mat), intent(inout) :: a class(psb_c_csc_sparse_mat), intent(inout) :: a
class(psb_c_coo_sparse_mat), intent(in) :: b class(psb_c_coo_sparse_mat), intent(in) :: b
integer(psb_ipk_), intent(out) :: info integer(psb_ipk_), intent(out) :: info
end subroutine psb_c_cp_csc_from_coo end subroutine psb_c_cp_csc_from_coo
end interface end interface

@ -189,7 +189,7 @@ module psb_c_csr_mat_mod
import :: psb_ipk_, psb_c_csr_sparse_mat, psb_c_coo_sparse_mat import :: psb_ipk_, psb_c_csr_sparse_mat, psb_c_coo_sparse_mat
class(psb_c_csr_sparse_mat), intent(inout) :: a class(psb_c_csr_sparse_mat), intent(inout) :: a
class(psb_c_coo_sparse_mat), intent(in) :: b class(psb_c_coo_sparse_mat), intent(in) :: b
integer(psb_ipk_), intent(out) :: info integer(psb_ipk_), intent(out) :: info
end subroutine psb_c_cp_csr_from_coo end subroutine psb_c_cp_csr_from_coo
end interface end interface

@ -133,7 +133,7 @@ module psb_d_base_mat_mod
!> Coefficient values. !> Coefficient values.
real(psb_dpk_), allocatable :: val(:) real(psb_dpk_), allocatable :: val(:)
integer, private :: sort_status=psb_unsorted_ integer, private :: sort_status=psb_unsorted_
contains contains
! !
@ -170,6 +170,7 @@ module psb_d_base_mat_mod
procedure, pass(a) :: set_by_rows => d_coo_set_by_rows procedure, pass(a) :: set_by_rows => d_coo_set_by_rows
procedure, pass(a) :: set_by_cols => d_coo_set_by_cols procedure, pass(a) :: set_by_cols => d_coo_set_by_cols
procedure, pass(a) :: set_sort_status => d_coo_set_sort_status procedure, pass(a) :: set_sort_status => d_coo_set_sort_status
procedure, pass(a) :: get_sort_status => d_coo_get_sort_status
! !
! This is COO specific ! This is COO specific
@ -586,7 +587,7 @@ module psb_d_base_mat_mod
subroutine psb_d_base_cp_from_coo(a,b,info) subroutine psb_d_base_cp_from_coo(a,b,info)
import :: psb_ipk_, psb_d_base_sparse_mat, psb_d_coo_sparse_mat, psb_dpk_ import :: psb_ipk_, psb_d_base_sparse_mat, psb_d_coo_sparse_mat, psb_dpk_
class(psb_d_base_sparse_mat), intent(inout) :: a class(psb_d_base_sparse_mat), intent(inout) :: a
class(psb_d_coo_sparse_mat), intent(in) :: b class(psb_d_coo_sparse_mat), intent(in) :: b
integer(psb_ipk_), intent(out) :: info integer(psb_ipk_), intent(out) :: info
end subroutine psb_d_base_cp_from_coo end subroutine psb_d_base_cp_from_coo
end interface end interface
@ -656,7 +657,7 @@ module psb_d_base_mat_mod
subroutine psb_d_base_mv_from_coo(a,b,info) subroutine psb_d_base_mv_from_coo(a,b,info)
import :: psb_ipk_, psb_d_base_sparse_mat, psb_d_coo_sparse_mat, psb_dpk_ import :: psb_ipk_, psb_d_base_sparse_mat, psb_d_coo_sparse_mat, psb_dpk_
class(psb_d_base_sparse_mat), intent(inout) :: a class(psb_d_base_sparse_mat), intent(inout) :: a
class(psb_d_coo_sparse_mat), intent(inout) :: b class(psb_d_coo_sparse_mat), intent(inout) :: b
integer(psb_ipk_), intent(out) :: info integer(psb_ipk_), intent(out) :: info
end subroutine psb_d_base_mv_from_coo end subroutine psb_d_base_mv_from_coo
end interface end interface
@ -1367,7 +1368,7 @@ module psb_d_base_mat_mod
import :: psb_ipk_, psb_d_coo_sparse_mat import :: psb_ipk_, psb_d_coo_sparse_mat
class(psb_d_coo_sparse_mat), intent(inout) :: a class(psb_d_coo_sparse_mat), intent(inout) :: a
class(psb_d_coo_sparse_mat), intent(in) :: b class(psb_d_coo_sparse_mat), intent(in) :: b
integer(psb_ipk_), intent(out) :: info integer(psb_ipk_), intent(out) :: info
end subroutine psb_d_cp_coo_from_coo end subroutine psb_d_cp_coo_from_coo
end interface end interface
@ -1812,6 +1813,14 @@ contains
end subroutine d_coo_set_nzeros end subroutine d_coo_set_nzeros
function d_coo_get_sort_status(a) result(res)
implicit none
integer(psb_ipk_) :: res
class(psb_d_coo_sparse_mat), intent(in) :: a
res = a%sort_status
end function d_coo_get_sort_status
subroutine d_coo_set_sort_status(ist,a) subroutine d_coo_set_sort_status(ist,a)
implicit none implicit none
integer(psb_ipk_), intent(in) :: ist integer(psb_ipk_), intent(in) :: ist

@ -186,7 +186,7 @@ module psb_d_csc_mat_mod
import :: psb_ipk_, psb_d_csc_sparse_mat, psb_d_coo_sparse_mat import :: psb_ipk_, psb_d_csc_sparse_mat, psb_d_coo_sparse_mat
class(psb_d_csc_sparse_mat), intent(inout) :: a class(psb_d_csc_sparse_mat), intent(inout) :: a
class(psb_d_coo_sparse_mat), intent(in) :: b class(psb_d_coo_sparse_mat), intent(in) :: b
integer(psb_ipk_), intent(out) :: info integer(psb_ipk_), intent(out) :: info
end subroutine psb_d_cp_csc_from_coo end subroutine psb_d_cp_csc_from_coo
end interface end interface

@ -189,7 +189,7 @@ module psb_d_csr_mat_mod
import :: psb_ipk_, psb_d_csr_sparse_mat, psb_d_coo_sparse_mat import :: psb_ipk_, psb_d_csr_sparse_mat, psb_d_coo_sparse_mat
class(psb_d_csr_sparse_mat), intent(inout) :: a class(psb_d_csr_sparse_mat), intent(inout) :: a
class(psb_d_coo_sparse_mat), intent(in) :: b class(psb_d_coo_sparse_mat), intent(in) :: b
integer(psb_ipk_), intent(out) :: info integer(psb_ipk_), intent(out) :: info
end subroutine psb_d_cp_csr_from_coo end subroutine psb_d_cp_csr_from_coo
end interface end interface

@ -133,7 +133,7 @@ module psb_s_base_mat_mod
!> Coefficient values. !> Coefficient values.
real(psb_spk_), allocatable :: val(:) real(psb_spk_), allocatable :: val(:)
integer, private :: sort_status=psb_unsorted_ integer, private :: sort_status=psb_unsorted_
contains contains
! !
@ -170,6 +170,7 @@ module psb_s_base_mat_mod
procedure, pass(a) :: set_by_rows => s_coo_set_by_rows procedure, pass(a) :: set_by_rows => s_coo_set_by_rows
procedure, pass(a) :: set_by_cols => s_coo_set_by_cols procedure, pass(a) :: set_by_cols => s_coo_set_by_cols
procedure, pass(a) :: set_sort_status => s_coo_set_sort_status procedure, pass(a) :: set_sort_status => s_coo_set_sort_status
procedure, pass(a) :: get_sort_status => s_coo_get_sort_status
! !
! This is COO specific ! This is COO specific
@ -586,7 +587,7 @@ module psb_s_base_mat_mod
subroutine psb_s_base_cp_from_coo(a,b,info) subroutine psb_s_base_cp_from_coo(a,b,info)
import :: psb_ipk_, psb_s_base_sparse_mat, psb_s_coo_sparse_mat, psb_spk_ import :: psb_ipk_, psb_s_base_sparse_mat, psb_s_coo_sparse_mat, psb_spk_
class(psb_s_base_sparse_mat), intent(inout) :: a class(psb_s_base_sparse_mat), intent(inout) :: a
class(psb_s_coo_sparse_mat), intent(in) :: b class(psb_s_coo_sparse_mat), intent(in) :: b
integer(psb_ipk_), intent(out) :: info integer(psb_ipk_), intent(out) :: info
end subroutine psb_s_base_cp_from_coo end subroutine psb_s_base_cp_from_coo
end interface end interface
@ -656,7 +657,7 @@ module psb_s_base_mat_mod
subroutine psb_s_base_mv_from_coo(a,b,info) subroutine psb_s_base_mv_from_coo(a,b,info)
import :: psb_ipk_, psb_s_base_sparse_mat, psb_s_coo_sparse_mat, psb_spk_ import :: psb_ipk_, psb_s_base_sparse_mat, psb_s_coo_sparse_mat, psb_spk_
class(psb_s_base_sparse_mat), intent(inout) :: a class(psb_s_base_sparse_mat), intent(inout) :: a
class(psb_s_coo_sparse_mat), intent(inout) :: b class(psb_s_coo_sparse_mat), intent(inout) :: b
integer(psb_ipk_), intent(out) :: info integer(psb_ipk_), intent(out) :: info
end subroutine psb_s_base_mv_from_coo end subroutine psb_s_base_mv_from_coo
end interface end interface
@ -1367,7 +1368,7 @@ module psb_s_base_mat_mod
import :: psb_ipk_, psb_s_coo_sparse_mat import :: psb_ipk_, psb_s_coo_sparse_mat
class(psb_s_coo_sparse_mat), intent(inout) :: a class(psb_s_coo_sparse_mat), intent(inout) :: a
class(psb_s_coo_sparse_mat), intent(in) :: b class(psb_s_coo_sparse_mat), intent(in) :: b
integer(psb_ipk_), intent(out) :: info integer(psb_ipk_), intent(out) :: info
end subroutine psb_s_cp_coo_from_coo end subroutine psb_s_cp_coo_from_coo
end interface end interface
@ -1812,6 +1813,14 @@ contains
end subroutine s_coo_set_nzeros end subroutine s_coo_set_nzeros
function s_coo_get_sort_status(a) result(res)
implicit none
integer(psb_ipk_) :: res
class(psb_s_coo_sparse_mat), intent(in) :: a
res = a%sort_status
end function s_coo_get_sort_status
subroutine s_coo_set_sort_status(ist,a) subroutine s_coo_set_sort_status(ist,a)
implicit none implicit none
integer(psb_ipk_), intent(in) :: ist integer(psb_ipk_), intent(in) :: ist

@ -186,7 +186,7 @@ module psb_s_csc_mat_mod
import :: psb_ipk_, psb_s_csc_sparse_mat, psb_s_coo_sparse_mat import :: psb_ipk_, psb_s_csc_sparse_mat, psb_s_coo_sparse_mat
class(psb_s_csc_sparse_mat), intent(inout) :: a class(psb_s_csc_sparse_mat), intent(inout) :: a
class(psb_s_coo_sparse_mat), intent(in) :: b class(psb_s_coo_sparse_mat), intent(in) :: b
integer(psb_ipk_), intent(out) :: info integer(psb_ipk_), intent(out) :: info
end subroutine psb_s_cp_csc_from_coo end subroutine psb_s_cp_csc_from_coo
end interface end interface

@ -189,7 +189,7 @@ module psb_s_csr_mat_mod
import :: psb_ipk_, psb_s_csr_sparse_mat, psb_s_coo_sparse_mat import :: psb_ipk_, psb_s_csr_sparse_mat, psb_s_coo_sparse_mat
class(psb_s_csr_sparse_mat), intent(inout) :: a class(psb_s_csr_sparse_mat), intent(inout) :: a
class(psb_s_coo_sparse_mat), intent(in) :: b class(psb_s_coo_sparse_mat), intent(in) :: b
integer(psb_ipk_), intent(out) :: info integer(psb_ipk_), intent(out) :: info
end subroutine psb_s_cp_csr_from_coo end subroutine psb_s_cp_csr_from_coo
end interface end interface

@ -133,7 +133,7 @@ module psb_z_base_mat_mod
!> Coefficient values. !> Coefficient values.
complex(psb_dpk_), allocatable :: val(:) complex(psb_dpk_), allocatable :: val(:)
integer, private :: sort_status=psb_unsorted_ integer, private :: sort_status=psb_unsorted_
contains contains
! !
@ -170,6 +170,7 @@ module psb_z_base_mat_mod
procedure, pass(a) :: set_by_rows => z_coo_set_by_rows procedure, pass(a) :: set_by_rows => z_coo_set_by_rows
procedure, pass(a) :: set_by_cols => z_coo_set_by_cols procedure, pass(a) :: set_by_cols => z_coo_set_by_cols
procedure, pass(a) :: set_sort_status => z_coo_set_sort_status procedure, pass(a) :: set_sort_status => z_coo_set_sort_status
procedure, pass(a) :: get_sort_status => z_coo_get_sort_status
! !
! This is COO specific ! This is COO specific
@ -586,7 +587,7 @@ module psb_z_base_mat_mod
subroutine psb_z_base_cp_from_coo(a,b,info) subroutine psb_z_base_cp_from_coo(a,b,info)
import :: psb_ipk_, psb_z_base_sparse_mat, psb_z_coo_sparse_mat, psb_dpk_ import :: psb_ipk_, psb_z_base_sparse_mat, psb_z_coo_sparse_mat, psb_dpk_
class(psb_z_base_sparse_mat), intent(inout) :: a class(psb_z_base_sparse_mat), intent(inout) :: a
class(psb_z_coo_sparse_mat), intent(in) :: b class(psb_z_coo_sparse_mat), intent(in) :: b
integer(psb_ipk_), intent(out) :: info integer(psb_ipk_), intent(out) :: info
end subroutine psb_z_base_cp_from_coo end subroutine psb_z_base_cp_from_coo
end interface end interface
@ -656,7 +657,7 @@ module psb_z_base_mat_mod
subroutine psb_z_base_mv_from_coo(a,b,info) subroutine psb_z_base_mv_from_coo(a,b,info)
import :: psb_ipk_, psb_z_base_sparse_mat, psb_z_coo_sparse_mat, psb_dpk_ import :: psb_ipk_, psb_z_base_sparse_mat, psb_z_coo_sparse_mat, psb_dpk_
class(psb_z_base_sparse_mat), intent(inout) :: a class(psb_z_base_sparse_mat), intent(inout) :: a
class(psb_z_coo_sparse_mat), intent(inout) :: b class(psb_z_coo_sparse_mat), intent(inout) :: b
integer(psb_ipk_), intent(out) :: info integer(psb_ipk_), intent(out) :: info
end subroutine psb_z_base_mv_from_coo end subroutine psb_z_base_mv_from_coo
end interface end interface
@ -1367,7 +1368,7 @@ module psb_z_base_mat_mod
import :: psb_ipk_, psb_z_coo_sparse_mat import :: psb_ipk_, psb_z_coo_sparse_mat
class(psb_z_coo_sparse_mat), intent(inout) :: a class(psb_z_coo_sparse_mat), intent(inout) :: a
class(psb_z_coo_sparse_mat), intent(in) :: b class(psb_z_coo_sparse_mat), intent(in) :: b
integer(psb_ipk_), intent(out) :: info integer(psb_ipk_), intent(out) :: info
end subroutine psb_z_cp_coo_from_coo end subroutine psb_z_cp_coo_from_coo
end interface end interface
@ -1812,6 +1813,14 @@ contains
end subroutine z_coo_set_nzeros end subroutine z_coo_set_nzeros
function z_coo_get_sort_status(a) result(res)
implicit none
integer(psb_ipk_) :: res
class(psb_z_coo_sparse_mat), intent(in) :: a
res = a%sort_status
end function z_coo_get_sort_status
subroutine z_coo_set_sort_status(ist,a) subroutine z_coo_set_sort_status(ist,a)
implicit none implicit none
integer(psb_ipk_), intent(in) :: ist integer(psb_ipk_), intent(in) :: ist

@ -186,7 +186,7 @@ module psb_z_csc_mat_mod
import :: psb_ipk_, psb_z_csc_sparse_mat, psb_z_coo_sparse_mat import :: psb_ipk_, psb_z_csc_sparse_mat, psb_z_coo_sparse_mat
class(psb_z_csc_sparse_mat), intent(inout) :: a class(psb_z_csc_sparse_mat), intent(inout) :: a
class(psb_z_coo_sparse_mat), intent(in) :: b class(psb_z_coo_sparse_mat), intent(in) :: b
integer(psb_ipk_), intent(out) :: info integer(psb_ipk_), intent(out) :: info
end subroutine psb_z_cp_csc_from_coo end subroutine psb_z_cp_csc_from_coo
end interface end interface

@ -189,7 +189,7 @@ module psb_z_csr_mat_mod
import :: psb_ipk_, psb_z_csr_sparse_mat, psb_z_coo_sparse_mat import :: psb_ipk_, psb_z_csr_sparse_mat, psb_z_coo_sparse_mat
class(psb_z_csr_sparse_mat), intent(inout) :: a class(psb_z_csr_sparse_mat), intent(inout) :: a
class(psb_z_coo_sparse_mat), intent(in) :: b class(psb_z_coo_sparse_mat), intent(in) :: b
integer(psb_ipk_), intent(out) :: info integer(psb_ipk_), intent(out) :: info
end subroutine psb_z_cp_csr_from_coo end subroutine psb_z_cp_csr_from_coo
end interface end interface

@ -113,9 +113,13 @@ subroutine psb_c_base_cp_to_fmt(a,b,info)
info = psb_success_ info = psb_success_
call psb_erractionsave(err_act) call psb_erractionsave(err_act)
call a%cp_to_coo(tmp,info) select type(b)
if (info == psb_success_) call b%mv_from_coo(tmp,info) type is (psb_c_coo_sparse_mat)
call a%cp_to_coo(b,info)
class default
call a%cp_to_coo(tmp,info)
if (info == psb_success_) call b%mv_from_coo(tmp,info)
end select
if (info /= psb_success_) then if (info /= psb_success_) then
info = psb_err_from_subroutine_ info = psb_err_from_subroutine_
call psb_errpush(info,name, a_err='to/from coo') call psb_errpush(info,name, a_err='to/from coo')
@ -152,8 +156,13 @@ subroutine psb_c_base_cp_from_fmt(a,b,info)
info = psb_success_ info = psb_success_
call psb_erractionsave(err_act) call psb_erractionsave(err_act)
call b%cp_to_coo(tmp,info) select type(b)
if (info == psb_success_) call a%mv_from_coo(tmp,info) type is (psb_c_coo_sparse_mat)
call a%cp_from_coo(b,info)
class default
call b%cp_to_coo(tmp,info)
if (info == psb_success_) call a%mv_from_coo(tmp,info)
end select
if (info /= psb_success_) then if (info /= psb_success_) then
info = psb_err_from_subroutine_ info = psb_err_from_subroutine_
@ -267,8 +276,13 @@ subroutine psb_c_base_mv_to_fmt(a,b,info)
! Default implementation ! Default implementation
! !
info = psb_success_ info = psb_success_
call a%mv_to_coo(tmp,info) select type(b)
if (info == psb_success_) call b%mv_from_coo(tmp,info) type is (psb_c_coo_sparse_mat)
call a%mv_to_coo(b,info)
class default
call a%mv_to_coo(tmp,info)
if (info == psb_success_) call b%mv_from_coo(tmp,info)
end select
return return
@ -293,9 +307,13 @@ subroutine psb_c_base_mv_from_fmt(a,b,info)
! Default implementation ! Default implementation
! !
info = psb_success_ info = psb_success_
call b%mv_to_coo(tmp,info) select type(b)
if (info == psb_success_) call a%mv_from_coo(tmp,info) type is (psb_c_coo_sparse_mat)
call a%mv_from_coo(b,info)
class default
call b%mv_to_coo(tmp,info)
if (info == psb_success_) call a%mv_from_coo(tmp,info)
end select
return return
end subroutine psb_c_base_mv_from_fmt end subroutine psb_c_base_mv_from_fmt

@ -466,7 +466,7 @@ function psb_c_coo_get_nz_row(idx,a) result(res)
res = 0 res = 0
nza = a%get_nzeros() nza = a%get_nzeros()
if (a%is_sorted()) then if (a%is_by_rows()) then
! In this case we can do a binary search. ! In this case we can do a binary search.
ip = psb_ibsrch(idx,nza,a%ia) ip = psb_ibsrch(idx,nza,a%ia)
if (ip /= -1) return if (ip /= -1) return
@ -580,7 +580,7 @@ subroutine psb_c_coo_cssm(alpha,a,x,beta,y,info,trans)
end if end if
if (beta == czero) then if (beta == czero) then
call inner_coosm(tra,ctra,a%is_lower(),a%is_unit(),a%is_sorted(),& call inner_coosm(tra,ctra,a%is_lower(),a%is_unit(),a%is_by_rows(),&
& m,nc,nnz,a%ia,a%ja,a%val,& & m,nc,nnz,a%ia,a%ja,a%val,&
& x,size(x,1,kind=psb_ipk_),y,size(y,1,kind=psb_ipk_),info) & x,size(x,1,kind=psb_ipk_),y,size(y,1,kind=psb_ipk_),info)
do i = 1, m do i = 1, m
@ -594,7 +594,7 @@ subroutine psb_c_coo_cssm(alpha,a,x,beta,y,info,trans)
goto 9999 goto 9999
end if end if
call inner_coosm(tra,ctra,a%is_lower(),a%is_unit(),a%is_sorted(),& call inner_coosm(tra,ctra,a%is_lower(),a%is_unit(),a%is_by_rows(),&
& m,nc,nnz,a%ia,a%ja,a%val,& & m,nc,nnz,a%ia,a%ja,a%val,&
& x,size(x,1,kind=psb_ipk_),tmp,size(tmp,1,kind=psb_ipk_),info) & x,size(x,1,kind=psb_ipk_),tmp,size(tmp,1,kind=psb_ipk_),info)
do i = 1, m do i = 1, m
@ -933,7 +933,7 @@ subroutine psb_c_coo_cssv(alpha,a,x,beta,y,info,trans)
end if end if
if (beta == czero) then if (beta == czero) then
call inner_coosv(tra,ctra,a%is_lower(),a%is_unit(),a%is_sorted(),& call inner_coosv(tra,ctra,a%is_lower(),a%is_unit(),a%is_by_rows(),&
& a%get_nrows(),a%get_nzeros(),a%ia,a%ja,a%val,& & a%get_nrows(),a%get_nzeros(),a%ia,a%ja,a%val,&
& x,y,info) & x,y,info)
if (info /= psb_success_) then if (info /= psb_success_) then
@ -951,7 +951,7 @@ subroutine psb_c_coo_cssv(alpha,a,x,beta,y,info,trans)
goto 9999 goto 9999
end if end if
call inner_coosv(tra,ctra,a%is_lower(),a%is_unit(),a%is_sorted(),& call inner_coosv(tra,ctra,a%is_lower(),a%is_unit(),a%is_by_rows(),&
& a%get_nrows(),a%get_nzeros(),a%ia,a%ja,a%val,& & a%get_nrows(),a%get_nzeros(),a%ia,a%ja,a%val,&
& x,tmp,info) & x,tmp,info)
if (info /= psb_success_) then if (info /= psb_success_) then
@ -1650,7 +1650,7 @@ function psb_c_coo_csnmi(a) result(res)
res = szero res = szero
nnz = a%get_nzeros() nnz = a%get_nzeros()
is_unit = a%is_unit() is_unit = a%is_unit()
if (a%is_sorted()) then if (a%is_by_rows()) then
i = 1 i = 1
j = i j = i
res = szero res = szero
@ -2067,7 +2067,7 @@ contains
nzin_ = 0 nzin_ = 0
endif endif
if (a%is_sorted()) then if (a%is_by_rows()) then
! In this case we can do a binary search. ! In this case we can do a binary search.
if (debug_level >= psb_debug_serial_)& if (debug_level >= psb_debug_serial_)&
& write(debug_unit,*) trim(name), ': srtdcoo ' & write(debug_unit,*) trim(name), ': srtdcoo '
@ -2344,7 +2344,7 @@ contains
nzin_ = 0 nzin_ = 0
endif endif
if (a%is_sorted()) then if (a%is_by_rows()) then
! In this case we can do a binary search. ! In this case we can do a binary search.
if (debug_level >= psb_debug_serial_)& if (debug_level >= psb_debug_serial_)&
& write(debug_unit,*) trim(name), ': srtdcoo ' & write(debug_unit,*) trim(name), ': srtdcoo '
@ -2884,7 +2884,7 @@ subroutine psb_c_cp_coo_to_coo(a,b,info)
call psb_erractionsave(err_act) call psb_erractionsave(err_act)
info = psb_success_ info = psb_success_
b%psb_c_base_sparse_mat = a%psb_c_base_sparse_mat b%psb_c_base_sparse_mat = a%psb_c_base_sparse_mat
call b%set_sort_status(a%get_sort_status())
nz = a%get_nzeros() nz = a%get_nzeros()
call b%set_nzeros(nz) call b%set_nzeros(nz)
call b%reallocate(nz) call b%reallocate(nz)
@ -2894,7 +2894,7 @@ subroutine psb_c_cp_coo_to_coo(a,b,info)
b%val(1:nz) = a%val(1:nz) b%val(1:nz) = a%val(1:nz)
if (.not.b%is_sorted()) call b%fix(info) if (.not.b%is_by_rows()) call b%fix(info)
if (info /= psb_success_) goto 9999 if (info /= psb_success_) goto 9999
@ -2912,7 +2912,7 @@ subroutine psb_c_cp_coo_from_coo(a,b,info)
use psb_c_base_mat_mod, psb_protect_name => psb_c_cp_coo_from_coo use psb_c_base_mat_mod, psb_protect_name => psb_c_cp_coo_from_coo
implicit none implicit none
class(psb_c_coo_sparse_mat), intent(inout) :: a class(psb_c_coo_sparse_mat), intent(inout) :: a
class(psb_c_coo_sparse_mat), intent(in) :: b class(psb_c_coo_sparse_mat), intent(in) :: b
integer(psb_ipk_), intent(out) :: info integer(psb_ipk_), intent(out) :: info
integer(psb_ipk_) :: err_act integer(psb_ipk_) :: err_act
@ -2925,7 +2925,7 @@ subroutine psb_c_cp_coo_from_coo(a,b,info)
call psb_erractionsave(err_act) call psb_erractionsave(err_act)
info = psb_success_ info = psb_success_
a%psb_c_base_sparse_mat = b%psb_c_base_sparse_mat a%psb_c_base_sparse_mat = b%psb_c_base_sparse_mat
call a%set_sort_status(b%get_sort_status())
nz = b%get_nzeros() nz = b%get_nzeros()
call a%set_nzeros(nz) call a%set_nzeros(nz)
call a%reallocate(nz) call a%reallocate(nz)
@ -2934,7 +2934,7 @@ subroutine psb_c_cp_coo_from_coo(a,b,info)
a%ja(1:nz) = b%ja(1:nz) a%ja(1:nz) = b%ja(1:nz)
a%val(1:nz) = b%val(1:nz) a%val(1:nz) = b%val(1:nz)
if (.not.a%is_sorted()) call a%fix(info) if (.not.a%is_by_rows()) call a%fix(info)
if (info /= psb_success_) goto 9999 if (info /= psb_success_) goto 9999
@ -3036,6 +3036,7 @@ subroutine psb_c_mv_coo_to_coo(a,b,info)
call psb_erractionsave(err_act) call psb_erractionsave(err_act)
info = psb_success_ info = psb_success_
b%psb_c_base_sparse_mat = a%psb_c_base_sparse_mat b%psb_c_base_sparse_mat = a%psb_c_base_sparse_mat
call b%set_sort_status(a%get_sort_status())
call b%set_nzeros(a%get_nzeros()) call b%set_nzeros(a%get_nzeros())
call move_alloc(a%ia, b%ia) call move_alloc(a%ia, b%ia)
@ -3043,7 +3044,7 @@ subroutine psb_c_mv_coo_to_coo(a,b,info)
call move_alloc(a%val, b%val) call move_alloc(a%val, b%val)
call a%free() call a%free()
if (.not.b%is_sorted()) call b%fix(info) if (.not.b%is_by_rows()) call b%fix(info)
if (info /= psb_success_) goto 9999 if (info /= psb_success_) goto 9999
@ -3077,13 +3078,14 @@ subroutine psb_c_mv_coo_from_coo(a,b,info)
call psb_erractionsave(err_act) call psb_erractionsave(err_act)
info = psb_success_ info = psb_success_
a%psb_c_base_sparse_mat = b%psb_c_base_sparse_mat a%psb_c_base_sparse_mat = b%psb_c_base_sparse_mat
call a%set_sort_status(b%get_sort_status())
call a%set_nzeros(b%get_nzeros()) call a%set_nzeros(b%get_nzeros())
call move_alloc(b%ia , a%ia ) call move_alloc(b%ia , a%ia )
call move_alloc(b%ja , a%ja ) call move_alloc(b%ja , a%ja )
call move_alloc(b%val, a%val ) call move_alloc(b%val, a%val )
call b%free() call b%free()
if (.not.a%is_sorted()) call a%fix(info) if (.not.a%is_by_rows()) call a%fix(info)
if (info /= psb_success_) goto 9999 if (info /= psb_success_) goto 9999

@ -2139,8 +2139,7 @@ subroutine psb_c_cp_csc_from_coo(a,b,info)
class(psb_c_csc_sparse_mat), intent(inout) :: a class(psb_c_csc_sparse_mat), intent(inout) :: a
class(psb_c_coo_sparse_mat), intent(in) :: b class(psb_c_coo_sparse_mat), intent(in) :: b
integer(psb_ipk_), intent(out) :: info integer(psb_ipk_), intent(out) :: info
type(psb_c_coo_sparse_mat) :: tmp type(psb_c_coo_sparse_mat) :: tmp
integer(psb_ipk_), allocatable :: itemp(:) integer(psb_ipk_), allocatable :: itemp(:)
!locals !locals

@ -2658,7 +2658,7 @@ subroutine psb_c_cp_csr_from_coo(a,b,info)
class(psb_c_csr_sparse_mat), intent(inout) :: a class(psb_c_csr_sparse_mat), intent(inout) :: a
class(psb_c_coo_sparse_mat), intent(in) :: b class(psb_c_coo_sparse_mat), intent(in) :: b
integer(psb_ipk_), intent(out) :: info integer(psb_ipk_), intent(out) :: info
type(psb_c_coo_sparse_mat) :: tmp type(psb_c_coo_sparse_mat) :: tmp
integer(psb_ipk_), allocatable :: itemp(:) integer(psb_ipk_), allocatable :: itemp(:)
@ -2673,7 +2673,7 @@ subroutine psb_c_cp_csr_from_coo(a,b,info)
debug_unit = psb_get_debug_unit() debug_unit = psb_get_debug_unit()
debug_level = psb_get_debug_level() debug_level = psb_get_debug_level()
if (.not.b%is_sorted()) then if (.not.b%is_by_rows()) then
! This is to have fix_coo called behind the scenes ! This is to have fix_coo called behind the scenes
call tmp%cp_from_coo(b,info) call tmp%cp_from_coo(b,info)
if (info /= psb_success_) return if (info /= psb_success_) return
@ -2871,7 +2871,7 @@ subroutine psb_c_mv_csr_from_coo(a,b,info)
debug_level = psb_get_debug_level() debug_level = psb_get_debug_level()
if (.not.b%is_sorted()) call b%fix(info) if (.not.b%is_by_rows()) call b%fix(info)
if (info /= psb_success_) return if (info /= psb_success_) return
nr = b%get_nrows() nr = b%get_nrows()

@ -113,9 +113,13 @@ subroutine psb_d_base_cp_to_fmt(a,b,info)
info = psb_success_ info = psb_success_
call psb_erractionsave(err_act) call psb_erractionsave(err_act)
call a%cp_to_coo(tmp,info) select type(b)
if (info == psb_success_) call b%mv_from_coo(tmp,info) type is (psb_d_coo_sparse_mat)
call a%cp_to_coo(b,info)
class default
call a%cp_to_coo(tmp,info)
if (info == psb_success_) call b%mv_from_coo(tmp,info)
end select
if (info /= psb_success_) then if (info /= psb_success_) then
info = psb_err_from_subroutine_ info = psb_err_from_subroutine_
call psb_errpush(info,name, a_err='to/from coo') call psb_errpush(info,name, a_err='to/from coo')
@ -152,8 +156,13 @@ subroutine psb_d_base_cp_from_fmt(a,b,info)
info = psb_success_ info = psb_success_
call psb_erractionsave(err_act) call psb_erractionsave(err_act)
call b%cp_to_coo(tmp,info) select type(b)
if (info == psb_success_) call a%mv_from_coo(tmp,info) type is (psb_d_coo_sparse_mat)
call a%cp_from_coo(b,info)
class default
call b%cp_to_coo(tmp,info)
if (info == psb_success_) call a%mv_from_coo(tmp,info)
end select
if (info /= psb_success_) then if (info /= psb_success_) then
info = psb_err_from_subroutine_ info = psb_err_from_subroutine_
@ -267,8 +276,13 @@ subroutine psb_d_base_mv_to_fmt(a,b,info)
! Default implementation ! Default implementation
! !
info = psb_success_ info = psb_success_
call a%mv_to_coo(tmp,info) select type(b)
if (info == psb_success_) call b%mv_from_coo(tmp,info) type is (psb_d_coo_sparse_mat)
call a%mv_to_coo(b,info)
class default
call a%mv_to_coo(tmp,info)
if (info == psb_success_) call b%mv_from_coo(tmp,info)
end select
return return
@ -293,9 +307,13 @@ subroutine psb_d_base_mv_from_fmt(a,b,info)
! Default implementation ! Default implementation
! !
info = psb_success_ info = psb_success_
call b%mv_to_coo(tmp,info) select type(b)
if (info == psb_success_) call a%mv_from_coo(tmp,info) type is (psb_d_coo_sparse_mat)
call a%mv_from_coo(b,info)
class default
call b%mv_to_coo(tmp,info)
if (info == psb_success_) call a%mv_from_coo(tmp,info)
end select
return return
end subroutine psb_d_base_mv_from_fmt end subroutine psb_d_base_mv_from_fmt

@ -466,7 +466,7 @@ function psb_d_coo_get_nz_row(idx,a) result(res)
res = 0 res = 0
nza = a%get_nzeros() nza = a%get_nzeros()
if (a%is_sorted()) then if (a%is_by_rows()) then
! In this case we can do a binary search. ! In this case we can do a binary search.
ip = psb_ibsrch(idx,nza,a%ia) ip = psb_ibsrch(idx,nza,a%ia)
if (ip /= -1) return if (ip /= -1) return
@ -580,7 +580,7 @@ subroutine psb_d_coo_cssm(alpha,a,x,beta,y,info,trans)
end if end if
if (beta == dzero) then if (beta == dzero) then
call inner_coosm(tra,ctra,a%is_lower(),a%is_unit(),a%is_sorted(),& call inner_coosm(tra,ctra,a%is_lower(),a%is_unit(),a%is_by_rows(),&
& m,nc,nnz,a%ia,a%ja,a%val,& & m,nc,nnz,a%ia,a%ja,a%val,&
& x,size(x,1,kind=psb_ipk_),y,size(y,1,kind=psb_ipk_),info) & x,size(x,1,kind=psb_ipk_),y,size(y,1,kind=psb_ipk_),info)
do i = 1, m do i = 1, m
@ -594,7 +594,7 @@ subroutine psb_d_coo_cssm(alpha,a,x,beta,y,info,trans)
goto 9999 goto 9999
end if end if
call inner_coosm(tra,ctra,a%is_lower(),a%is_unit(),a%is_sorted(),& call inner_coosm(tra,ctra,a%is_lower(),a%is_unit(),a%is_by_rows(),&
& m,nc,nnz,a%ia,a%ja,a%val,& & m,nc,nnz,a%ia,a%ja,a%val,&
& x,size(x,1,kind=psb_ipk_),tmp,size(tmp,1,kind=psb_ipk_),info) & x,size(x,1,kind=psb_ipk_),tmp,size(tmp,1,kind=psb_ipk_),info)
do i = 1, m do i = 1, m
@ -933,7 +933,7 @@ subroutine psb_d_coo_cssv(alpha,a,x,beta,y,info,trans)
end if end if
if (beta == dzero) then if (beta == dzero) then
call inner_coosv(tra,ctra,a%is_lower(),a%is_unit(),a%is_sorted(),& call inner_coosv(tra,ctra,a%is_lower(),a%is_unit(),a%is_by_rows(),&
& a%get_nrows(),a%get_nzeros(),a%ia,a%ja,a%val,& & a%get_nrows(),a%get_nzeros(),a%ia,a%ja,a%val,&
& x,y,info) & x,y,info)
if (info /= psb_success_) then if (info /= psb_success_) then
@ -951,7 +951,7 @@ subroutine psb_d_coo_cssv(alpha,a,x,beta,y,info,trans)
goto 9999 goto 9999
end if end if
call inner_coosv(tra,ctra,a%is_lower(),a%is_unit(),a%is_sorted(),& call inner_coosv(tra,ctra,a%is_lower(),a%is_unit(),a%is_by_rows(),&
& a%get_nrows(),a%get_nzeros(),a%ia,a%ja,a%val,& & a%get_nrows(),a%get_nzeros(),a%ia,a%ja,a%val,&
& x,tmp,info) & x,tmp,info)
if (info /= psb_success_) then if (info /= psb_success_) then
@ -1650,7 +1650,7 @@ function psb_d_coo_csnmi(a) result(res)
res = dzero res = dzero
nnz = a%get_nzeros() nnz = a%get_nzeros()
is_unit = a%is_unit() is_unit = a%is_unit()
if (a%is_sorted()) then if (a%is_by_rows()) then
i = 1 i = 1
j = i j = i
res = dzero res = dzero
@ -2067,7 +2067,7 @@ contains
nzin_ = 0 nzin_ = 0
endif endif
if (a%is_sorted()) then if (a%is_by_rows()) then
! In this case we can do a binary search. ! In this case we can do a binary search.
if (debug_level >= psb_debug_serial_)& if (debug_level >= psb_debug_serial_)&
& write(debug_unit,*) trim(name), ': srtdcoo ' & write(debug_unit,*) trim(name), ': srtdcoo '
@ -2344,7 +2344,7 @@ contains
nzin_ = 0 nzin_ = 0
endif endif
if (a%is_sorted()) then if (a%is_by_rows()) then
! In this case we can do a binary search. ! In this case we can do a binary search.
if (debug_level >= psb_debug_serial_)& if (debug_level >= psb_debug_serial_)&
& write(debug_unit,*) trim(name), ': srtdcoo ' & write(debug_unit,*) trim(name), ': srtdcoo '
@ -2884,7 +2884,7 @@ subroutine psb_d_cp_coo_to_coo(a,b,info)
call psb_erractionsave(err_act) call psb_erractionsave(err_act)
info = psb_success_ info = psb_success_
b%psb_d_base_sparse_mat = a%psb_d_base_sparse_mat b%psb_d_base_sparse_mat = a%psb_d_base_sparse_mat
call b%set_sort_status(a%get_sort_status())
nz = a%get_nzeros() nz = a%get_nzeros()
call b%set_nzeros(nz) call b%set_nzeros(nz)
call b%reallocate(nz) call b%reallocate(nz)
@ -2894,7 +2894,7 @@ subroutine psb_d_cp_coo_to_coo(a,b,info)
b%val(1:nz) = a%val(1:nz) b%val(1:nz) = a%val(1:nz)
if (.not.b%is_sorted()) call b%fix(info) if (.not.b%is_by_rows()) call b%fix(info)
if (info /= psb_success_) goto 9999 if (info /= psb_success_) goto 9999
@ -2912,7 +2912,7 @@ subroutine psb_d_cp_coo_from_coo(a,b,info)
use psb_d_base_mat_mod, psb_protect_name => psb_d_cp_coo_from_coo use psb_d_base_mat_mod, psb_protect_name => psb_d_cp_coo_from_coo
implicit none implicit none
class(psb_d_coo_sparse_mat), intent(inout) :: a class(psb_d_coo_sparse_mat), intent(inout) :: a
class(psb_d_coo_sparse_mat), intent(in) :: b class(psb_d_coo_sparse_mat), intent(in) :: b
integer(psb_ipk_), intent(out) :: info integer(psb_ipk_), intent(out) :: info
integer(psb_ipk_) :: err_act integer(psb_ipk_) :: err_act
@ -2925,7 +2925,7 @@ subroutine psb_d_cp_coo_from_coo(a,b,info)
call psb_erractionsave(err_act) call psb_erractionsave(err_act)
info = psb_success_ info = psb_success_
a%psb_d_base_sparse_mat = b%psb_d_base_sparse_mat a%psb_d_base_sparse_mat = b%psb_d_base_sparse_mat
call a%set_sort_status(b%get_sort_status())
nz = b%get_nzeros() nz = b%get_nzeros()
call a%set_nzeros(nz) call a%set_nzeros(nz)
call a%reallocate(nz) call a%reallocate(nz)
@ -2934,7 +2934,7 @@ subroutine psb_d_cp_coo_from_coo(a,b,info)
a%ja(1:nz) = b%ja(1:nz) a%ja(1:nz) = b%ja(1:nz)
a%val(1:nz) = b%val(1:nz) a%val(1:nz) = b%val(1:nz)
if (.not.a%is_sorted()) call a%fix(info) if (.not.a%is_by_rows()) call a%fix(info)
if (info /= psb_success_) goto 9999 if (info /= psb_success_) goto 9999
@ -3036,6 +3036,7 @@ subroutine psb_d_mv_coo_to_coo(a,b,info)
call psb_erractionsave(err_act) call psb_erractionsave(err_act)
info = psb_success_ info = psb_success_
b%psb_d_base_sparse_mat = a%psb_d_base_sparse_mat b%psb_d_base_sparse_mat = a%psb_d_base_sparse_mat
call b%set_sort_status(a%get_sort_status())
call b%set_nzeros(a%get_nzeros()) call b%set_nzeros(a%get_nzeros())
call move_alloc(a%ia, b%ia) call move_alloc(a%ia, b%ia)
@ -3043,7 +3044,7 @@ subroutine psb_d_mv_coo_to_coo(a,b,info)
call move_alloc(a%val, b%val) call move_alloc(a%val, b%val)
call a%free() call a%free()
if (.not.b%is_sorted()) call b%fix(info) if (.not.b%is_by_rows()) call b%fix(info)
if (info /= psb_success_) goto 9999 if (info /= psb_success_) goto 9999
@ -3077,13 +3078,14 @@ subroutine psb_d_mv_coo_from_coo(a,b,info)
call psb_erractionsave(err_act) call psb_erractionsave(err_act)
info = psb_success_ info = psb_success_
a%psb_d_base_sparse_mat = b%psb_d_base_sparse_mat a%psb_d_base_sparse_mat = b%psb_d_base_sparse_mat
call a%set_sort_status(b%get_sort_status())
call a%set_nzeros(b%get_nzeros()) call a%set_nzeros(b%get_nzeros())
call move_alloc(b%ia , a%ia ) call move_alloc(b%ia , a%ia )
call move_alloc(b%ja , a%ja ) call move_alloc(b%ja , a%ja )
call move_alloc(b%val, a%val ) call move_alloc(b%val, a%val )
call b%free() call b%free()
if (.not.a%is_sorted()) call a%fix(info) if (.not.a%is_by_rows()) call a%fix(info)
if (info /= psb_success_) goto 9999 if (info /= psb_success_) goto 9999

@ -2139,8 +2139,7 @@ subroutine psb_d_cp_csc_from_coo(a,b,info)
class(psb_d_csc_sparse_mat), intent(inout) :: a class(psb_d_csc_sparse_mat), intent(inout) :: a
class(psb_d_coo_sparse_mat), intent(in) :: b class(psb_d_coo_sparse_mat), intent(in) :: b
integer(psb_ipk_), intent(out) :: info integer(psb_ipk_), intent(out) :: info
type(psb_d_coo_sparse_mat) :: tmp type(psb_d_coo_sparse_mat) :: tmp
integer(psb_ipk_), allocatable :: itemp(:) integer(psb_ipk_), allocatable :: itemp(:)
!locals !locals

@ -2658,7 +2658,7 @@ subroutine psb_d_cp_csr_from_coo(a,b,info)
class(psb_d_csr_sparse_mat), intent(inout) :: a class(psb_d_csr_sparse_mat), intent(inout) :: a
class(psb_d_coo_sparse_mat), intent(in) :: b class(psb_d_coo_sparse_mat), intent(in) :: b
integer(psb_ipk_), intent(out) :: info integer(psb_ipk_), intent(out) :: info
type(psb_d_coo_sparse_mat) :: tmp type(psb_d_coo_sparse_mat) :: tmp
integer(psb_ipk_), allocatable :: itemp(:) integer(psb_ipk_), allocatable :: itemp(:)
@ -2673,7 +2673,7 @@ subroutine psb_d_cp_csr_from_coo(a,b,info)
debug_unit = psb_get_debug_unit() debug_unit = psb_get_debug_unit()
debug_level = psb_get_debug_level() debug_level = psb_get_debug_level()
if (.not.b%is_sorted()) then if (.not.b%is_by_rows()) then
! This is to have fix_coo called behind the scenes ! This is to have fix_coo called behind the scenes
call tmp%cp_from_coo(b,info) call tmp%cp_from_coo(b,info)
if (info /= psb_success_) return if (info /= psb_success_) return
@ -2871,7 +2871,7 @@ subroutine psb_d_mv_csr_from_coo(a,b,info)
debug_level = psb_get_debug_level() debug_level = psb_get_debug_level()
if (.not.b%is_sorted()) call b%fix(info) if (.not.b%is_by_rows()) call b%fix(info)
if (info /= psb_success_) return if (info /= psb_success_) return
nr = b%get_nrows() nr = b%get_nrows()

@ -113,9 +113,13 @@ subroutine psb_s_base_cp_to_fmt(a,b,info)
info = psb_success_ info = psb_success_
call psb_erractionsave(err_act) call psb_erractionsave(err_act)
call a%cp_to_coo(tmp,info) select type(b)
if (info == psb_success_) call b%mv_from_coo(tmp,info) type is (psb_s_coo_sparse_mat)
call a%cp_to_coo(b,info)
class default
call a%cp_to_coo(tmp,info)
if (info == psb_success_) call b%mv_from_coo(tmp,info)
end select
if (info /= psb_success_) then if (info /= psb_success_) then
info = psb_err_from_subroutine_ info = psb_err_from_subroutine_
call psb_errpush(info,name, a_err='to/from coo') call psb_errpush(info,name, a_err='to/from coo')
@ -152,8 +156,13 @@ subroutine psb_s_base_cp_from_fmt(a,b,info)
info = psb_success_ info = psb_success_
call psb_erractionsave(err_act) call psb_erractionsave(err_act)
call b%cp_to_coo(tmp,info) select type(b)
if (info == psb_success_) call a%mv_from_coo(tmp,info) type is (psb_s_coo_sparse_mat)
call a%cp_from_coo(b,info)
class default
call b%cp_to_coo(tmp,info)
if (info == psb_success_) call a%mv_from_coo(tmp,info)
end select
if (info /= psb_success_) then if (info /= psb_success_) then
info = psb_err_from_subroutine_ info = psb_err_from_subroutine_
@ -267,8 +276,13 @@ subroutine psb_s_base_mv_to_fmt(a,b,info)
! Default implementation ! Default implementation
! !
info = psb_success_ info = psb_success_
call a%mv_to_coo(tmp,info) select type(b)
if (info == psb_success_) call b%mv_from_coo(tmp,info) type is (psb_s_coo_sparse_mat)
call a%mv_to_coo(b,info)
class default
call a%mv_to_coo(tmp,info)
if (info == psb_success_) call b%mv_from_coo(tmp,info)
end select
return return
@ -293,9 +307,13 @@ subroutine psb_s_base_mv_from_fmt(a,b,info)
! Default implementation ! Default implementation
! !
info = psb_success_ info = psb_success_
call b%mv_to_coo(tmp,info) select type(b)
if (info == psb_success_) call a%mv_from_coo(tmp,info) type is (psb_s_coo_sparse_mat)
call a%mv_from_coo(b,info)
class default
call b%mv_to_coo(tmp,info)
if (info == psb_success_) call a%mv_from_coo(tmp,info)
end select
return return
end subroutine psb_s_base_mv_from_fmt end subroutine psb_s_base_mv_from_fmt

@ -466,7 +466,7 @@ function psb_s_coo_get_nz_row(idx,a) result(res)
res = 0 res = 0
nza = a%get_nzeros() nza = a%get_nzeros()
if (a%is_sorted()) then if (a%is_by_rows()) then
! In this case we can do a binary search. ! In this case we can do a binary search.
ip = psb_ibsrch(idx,nza,a%ia) ip = psb_ibsrch(idx,nza,a%ia)
if (ip /= -1) return if (ip /= -1) return
@ -580,7 +580,7 @@ subroutine psb_s_coo_cssm(alpha,a,x,beta,y,info,trans)
end if end if
if (beta == szero) then if (beta == szero) then
call inner_coosm(tra,ctra,a%is_lower(),a%is_unit(),a%is_sorted(),& call inner_coosm(tra,ctra,a%is_lower(),a%is_unit(),a%is_by_rows(),&
& m,nc,nnz,a%ia,a%ja,a%val,& & m,nc,nnz,a%ia,a%ja,a%val,&
& x,size(x,1,kind=psb_ipk_),y,size(y,1,kind=psb_ipk_),info) & x,size(x,1,kind=psb_ipk_),y,size(y,1,kind=psb_ipk_),info)
do i = 1, m do i = 1, m
@ -594,7 +594,7 @@ subroutine psb_s_coo_cssm(alpha,a,x,beta,y,info,trans)
goto 9999 goto 9999
end if end if
call inner_coosm(tra,ctra,a%is_lower(),a%is_unit(),a%is_sorted(),& call inner_coosm(tra,ctra,a%is_lower(),a%is_unit(),a%is_by_rows(),&
& m,nc,nnz,a%ia,a%ja,a%val,& & m,nc,nnz,a%ia,a%ja,a%val,&
& x,size(x,1,kind=psb_ipk_),tmp,size(tmp,1,kind=psb_ipk_),info) & x,size(x,1,kind=psb_ipk_),tmp,size(tmp,1,kind=psb_ipk_),info)
do i = 1, m do i = 1, m
@ -933,7 +933,7 @@ subroutine psb_s_coo_cssv(alpha,a,x,beta,y,info,trans)
end if end if
if (beta == szero) then if (beta == szero) then
call inner_coosv(tra,ctra,a%is_lower(),a%is_unit(),a%is_sorted(),& call inner_coosv(tra,ctra,a%is_lower(),a%is_unit(),a%is_by_rows(),&
& a%get_nrows(),a%get_nzeros(),a%ia,a%ja,a%val,& & a%get_nrows(),a%get_nzeros(),a%ia,a%ja,a%val,&
& x,y,info) & x,y,info)
if (info /= psb_success_) then if (info /= psb_success_) then
@ -951,7 +951,7 @@ subroutine psb_s_coo_cssv(alpha,a,x,beta,y,info,trans)
goto 9999 goto 9999
end if end if
call inner_coosv(tra,ctra,a%is_lower(),a%is_unit(),a%is_sorted(),& call inner_coosv(tra,ctra,a%is_lower(),a%is_unit(),a%is_by_rows(),&
& a%get_nrows(),a%get_nzeros(),a%ia,a%ja,a%val,& & a%get_nrows(),a%get_nzeros(),a%ia,a%ja,a%val,&
& x,tmp,info) & x,tmp,info)
if (info /= psb_success_) then if (info /= psb_success_) then
@ -1650,7 +1650,7 @@ function psb_s_coo_csnmi(a) result(res)
res = szero res = szero
nnz = a%get_nzeros() nnz = a%get_nzeros()
is_unit = a%is_unit() is_unit = a%is_unit()
if (a%is_sorted()) then if (a%is_by_rows()) then
i = 1 i = 1
j = i j = i
res = szero res = szero
@ -2067,7 +2067,7 @@ contains
nzin_ = 0 nzin_ = 0
endif endif
if (a%is_sorted()) then if (a%is_by_rows()) then
! In this case we can do a binary search. ! In this case we can do a binary search.
if (debug_level >= psb_debug_serial_)& if (debug_level >= psb_debug_serial_)&
& write(debug_unit,*) trim(name), ': srtdcoo ' & write(debug_unit,*) trim(name), ': srtdcoo '
@ -2344,7 +2344,7 @@ contains
nzin_ = 0 nzin_ = 0
endif endif
if (a%is_sorted()) then if (a%is_by_rows()) then
! In this case we can do a binary search. ! In this case we can do a binary search.
if (debug_level >= psb_debug_serial_)& if (debug_level >= psb_debug_serial_)&
& write(debug_unit,*) trim(name), ': srtdcoo ' & write(debug_unit,*) trim(name), ': srtdcoo '
@ -2884,7 +2884,7 @@ subroutine psb_s_cp_coo_to_coo(a,b,info)
call psb_erractionsave(err_act) call psb_erractionsave(err_act)
info = psb_success_ info = psb_success_
b%psb_s_base_sparse_mat = a%psb_s_base_sparse_mat b%psb_s_base_sparse_mat = a%psb_s_base_sparse_mat
call b%set_sort_status(a%get_sort_status())
nz = a%get_nzeros() nz = a%get_nzeros()
call b%set_nzeros(nz) call b%set_nzeros(nz)
call b%reallocate(nz) call b%reallocate(nz)
@ -2894,7 +2894,7 @@ subroutine psb_s_cp_coo_to_coo(a,b,info)
b%val(1:nz) = a%val(1:nz) b%val(1:nz) = a%val(1:nz)
if (.not.b%is_sorted()) call b%fix(info) if (.not.b%is_by_rows()) call b%fix(info)
if (info /= psb_success_) goto 9999 if (info /= psb_success_) goto 9999
@ -2912,7 +2912,7 @@ subroutine psb_s_cp_coo_from_coo(a,b,info)
use psb_s_base_mat_mod, psb_protect_name => psb_s_cp_coo_from_coo use psb_s_base_mat_mod, psb_protect_name => psb_s_cp_coo_from_coo
implicit none implicit none
class(psb_s_coo_sparse_mat), intent(inout) :: a class(psb_s_coo_sparse_mat), intent(inout) :: a
class(psb_s_coo_sparse_mat), intent(in) :: b class(psb_s_coo_sparse_mat), intent(in) :: b
integer(psb_ipk_), intent(out) :: info integer(psb_ipk_), intent(out) :: info
integer(psb_ipk_) :: err_act integer(psb_ipk_) :: err_act
@ -2925,7 +2925,7 @@ subroutine psb_s_cp_coo_from_coo(a,b,info)
call psb_erractionsave(err_act) call psb_erractionsave(err_act)
info = psb_success_ info = psb_success_
a%psb_s_base_sparse_mat = b%psb_s_base_sparse_mat a%psb_s_base_sparse_mat = b%psb_s_base_sparse_mat
call a%set_sort_status(b%get_sort_status())
nz = b%get_nzeros() nz = b%get_nzeros()
call a%set_nzeros(nz) call a%set_nzeros(nz)
call a%reallocate(nz) call a%reallocate(nz)
@ -2934,7 +2934,7 @@ subroutine psb_s_cp_coo_from_coo(a,b,info)
a%ja(1:nz) = b%ja(1:nz) a%ja(1:nz) = b%ja(1:nz)
a%val(1:nz) = b%val(1:nz) a%val(1:nz) = b%val(1:nz)
if (.not.a%is_sorted()) call a%fix(info) if (.not.a%is_by_rows()) call a%fix(info)
if (info /= psb_success_) goto 9999 if (info /= psb_success_) goto 9999
@ -3036,6 +3036,7 @@ subroutine psb_s_mv_coo_to_coo(a,b,info)
call psb_erractionsave(err_act) call psb_erractionsave(err_act)
info = psb_success_ info = psb_success_
b%psb_s_base_sparse_mat = a%psb_s_base_sparse_mat b%psb_s_base_sparse_mat = a%psb_s_base_sparse_mat
call b%set_sort_status(a%get_sort_status())
call b%set_nzeros(a%get_nzeros()) call b%set_nzeros(a%get_nzeros())
call move_alloc(a%ia, b%ia) call move_alloc(a%ia, b%ia)
@ -3043,7 +3044,7 @@ subroutine psb_s_mv_coo_to_coo(a,b,info)
call move_alloc(a%val, b%val) call move_alloc(a%val, b%val)
call a%free() call a%free()
if (.not.b%is_sorted()) call b%fix(info) if (.not.b%is_by_rows()) call b%fix(info)
if (info /= psb_success_) goto 9999 if (info /= psb_success_) goto 9999
@ -3077,13 +3078,14 @@ subroutine psb_s_mv_coo_from_coo(a,b,info)
call psb_erractionsave(err_act) call psb_erractionsave(err_act)
info = psb_success_ info = psb_success_
a%psb_s_base_sparse_mat = b%psb_s_base_sparse_mat a%psb_s_base_sparse_mat = b%psb_s_base_sparse_mat
call a%set_sort_status(b%get_sort_status())
call a%set_nzeros(b%get_nzeros()) call a%set_nzeros(b%get_nzeros())
call move_alloc(b%ia , a%ia ) call move_alloc(b%ia , a%ia )
call move_alloc(b%ja , a%ja ) call move_alloc(b%ja , a%ja )
call move_alloc(b%val, a%val ) call move_alloc(b%val, a%val )
call b%free() call b%free()
if (.not.a%is_sorted()) call a%fix(info) if (.not.a%is_by_rows()) call a%fix(info)
if (info /= psb_success_) goto 9999 if (info /= psb_success_) goto 9999

@ -2139,8 +2139,7 @@ subroutine psb_s_cp_csc_from_coo(a,b,info)
class(psb_s_csc_sparse_mat), intent(inout) :: a class(psb_s_csc_sparse_mat), intent(inout) :: a
class(psb_s_coo_sparse_mat), intent(in) :: b class(psb_s_coo_sparse_mat), intent(in) :: b
integer(psb_ipk_), intent(out) :: info integer(psb_ipk_), intent(out) :: info
type(psb_s_coo_sparse_mat) :: tmp type(psb_s_coo_sparse_mat) :: tmp
integer(psb_ipk_), allocatable :: itemp(:) integer(psb_ipk_), allocatable :: itemp(:)
!locals !locals

@ -2658,7 +2658,7 @@ subroutine psb_s_cp_csr_from_coo(a,b,info)
class(psb_s_csr_sparse_mat), intent(inout) :: a class(psb_s_csr_sparse_mat), intent(inout) :: a
class(psb_s_coo_sparse_mat), intent(in) :: b class(psb_s_coo_sparse_mat), intent(in) :: b
integer(psb_ipk_), intent(out) :: info integer(psb_ipk_), intent(out) :: info
type(psb_s_coo_sparse_mat) :: tmp type(psb_s_coo_sparse_mat) :: tmp
integer(psb_ipk_), allocatable :: itemp(:) integer(psb_ipk_), allocatable :: itemp(:)
@ -2673,7 +2673,7 @@ subroutine psb_s_cp_csr_from_coo(a,b,info)
debug_unit = psb_get_debug_unit() debug_unit = psb_get_debug_unit()
debug_level = psb_get_debug_level() debug_level = psb_get_debug_level()
if (.not.b%is_sorted()) then if (.not.b%is_by_rows()) then
! This is to have fix_coo called behind the scenes ! This is to have fix_coo called behind the scenes
call tmp%cp_from_coo(b,info) call tmp%cp_from_coo(b,info)
if (info /= psb_success_) return if (info /= psb_success_) return
@ -2871,7 +2871,7 @@ subroutine psb_s_mv_csr_from_coo(a,b,info)
debug_level = psb_get_debug_level() debug_level = psb_get_debug_level()
if (.not.b%is_sorted()) call b%fix(info) if (.not.b%is_by_rows()) call b%fix(info)
if (info /= psb_success_) return if (info /= psb_success_) return
nr = b%get_nrows() nr = b%get_nrows()

@ -113,9 +113,13 @@ subroutine psb_z_base_cp_to_fmt(a,b,info)
info = psb_success_ info = psb_success_
call psb_erractionsave(err_act) call psb_erractionsave(err_act)
call a%cp_to_coo(tmp,info) select type(b)
if (info == psb_success_) call b%mv_from_coo(tmp,info) type is (psb_z_coo_sparse_mat)
call a%cp_to_coo(b,info)
class default
call a%cp_to_coo(tmp,info)
if (info == psb_success_) call b%mv_from_coo(tmp,info)
end select
if (info /= psb_success_) then if (info /= psb_success_) then
info = psb_err_from_subroutine_ info = psb_err_from_subroutine_
call psb_errpush(info,name, a_err='to/from coo') call psb_errpush(info,name, a_err='to/from coo')
@ -152,8 +156,13 @@ subroutine psb_z_base_cp_from_fmt(a,b,info)
info = psb_success_ info = psb_success_
call psb_erractionsave(err_act) call psb_erractionsave(err_act)
call b%cp_to_coo(tmp,info) select type(b)
if (info == psb_success_) call a%mv_from_coo(tmp,info) type is (psb_z_coo_sparse_mat)
call a%cp_from_coo(b,info)
class default
call b%cp_to_coo(tmp,info)
if (info == psb_success_) call a%mv_from_coo(tmp,info)
end select
if (info /= psb_success_) then if (info /= psb_success_) then
info = psb_err_from_subroutine_ info = psb_err_from_subroutine_
@ -267,8 +276,13 @@ subroutine psb_z_base_mv_to_fmt(a,b,info)
! Default implementation ! Default implementation
! !
info = psb_success_ info = psb_success_
call a%mv_to_coo(tmp,info) select type(b)
if (info == psb_success_) call b%mv_from_coo(tmp,info) type is (psb_z_coo_sparse_mat)
call a%mv_to_coo(b,info)
class default
call a%mv_to_coo(tmp,info)
if (info == psb_success_) call b%mv_from_coo(tmp,info)
end select
return return
@ -293,9 +307,13 @@ subroutine psb_z_base_mv_from_fmt(a,b,info)
! Default implementation ! Default implementation
! !
info = psb_success_ info = psb_success_
call b%mv_to_coo(tmp,info) select type(b)
if (info == psb_success_) call a%mv_from_coo(tmp,info) type is (psb_z_coo_sparse_mat)
call a%mv_from_coo(b,info)
class default
call b%mv_to_coo(tmp,info)
if (info == psb_success_) call a%mv_from_coo(tmp,info)
end select
return return
end subroutine psb_z_base_mv_from_fmt end subroutine psb_z_base_mv_from_fmt

@ -466,7 +466,7 @@ function psb_z_coo_get_nz_row(idx,a) result(res)
res = 0 res = 0
nza = a%get_nzeros() nza = a%get_nzeros()
if (a%is_sorted()) then if (a%is_by_rows()) then
! In this case we can do a binary search. ! In this case we can do a binary search.
ip = psb_ibsrch(idx,nza,a%ia) ip = psb_ibsrch(idx,nza,a%ia)
if (ip /= -1) return if (ip /= -1) return
@ -580,7 +580,7 @@ subroutine psb_z_coo_cssm(alpha,a,x,beta,y,info,trans)
end if end if
if (beta == zzero) then if (beta == zzero) then
call inner_coosm(tra,ctra,a%is_lower(),a%is_unit(),a%is_sorted(),& call inner_coosm(tra,ctra,a%is_lower(),a%is_unit(),a%is_by_rows(),&
& m,nc,nnz,a%ia,a%ja,a%val,& & m,nc,nnz,a%ia,a%ja,a%val,&
& x,size(x,1,kind=psb_ipk_),y,size(y,1,kind=psb_ipk_),info) & x,size(x,1,kind=psb_ipk_),y,size(y,1,kind=psb_ipk_),info)
do i = 1, m do i = 1, m
@ -594,7 +594,7 @@ subroutine psb_z_coo_cssm(alpha,a,x,beta,y,info,trans)
goto 9999 goto 9999
end if end if
call inner_coosm(tra,ctra,a%is_lower(),a%is_unit(),a%is_sorted(),& call inner_coosm(tra,ctra,a%is_lower(),a%is_unit(),a%is_by_rows(),&
& m,nc,nnz,a%ia,a%ja,a%val,& & m,nc,nnz,a%ia,a%ja,a%val,&
& x,size(x,1,kind=psb_ipk_),tmp,size(tmp,1,kind=psb_ipk_),info) & x,size(x,1,kind=psb_ipk_),tmp,size(tmp,1,kind=psb_ipk_),info)
do i = 1, m do i = 1, m
@ -933,7 +933,7 @@ subroutine psb_z_coo_cssv(alpha,a,x,beta,y,info,trans)
end if end if
if (beta == zzero) then if (beta == zzero) then
call inner_coosv(tra,ctra,a%is_lower(),a%is_unit(),a%is_sorted(),& call inner_coosv(tra,ctra,a%is_lower(),a%is_unit(),a%is_by_rows(),&
& a%get_nrows(),a%get_nzeros(),a%ia,a%ja,a%val,& & a%get_nrows(),a%get_nzeros(),a%ia,a%ja,a%val,&
& x,y,info) & x,y,info)
if (info /= psb_success_) then if (info /= psb_success_) then
@ -951,7 +951,7 @@ subroutine psb_z_coo_cssv(alpha,a,x,beta,y,info,trans)
goto 9999 goto 9999
end if end if
call inner_coosv(tra,ctra,a%is_lower(),a%is_unit(),a%is_sorted(),& call inner_coosv(tra,ctra,a%is_lower(),a%is_unit(),a%is_by_rows(),&
& a%get_nrows(),a%get_nzeros(),a%ia,a%ja,a%val,& & a%get_nrows(),a%get_nzeros(),a%ia,a%ja,a%val,&
& x,tmp,info) & x,tmp,info)
if (info /= psb_success_) then if (info /= psb_success_) then
@ -1650,7 +1650,7 @@ function psb_z_coo_csnmi(a) result(res)
res = dzero res = dzero
nnz = a%get_nzeros() nnz = a%get_nzeros()
is_unit = a%is_unit() is_unit = a%is_unit()
if (a%is_sorted()) then if (a%is_by_rows()) then
i = 1 i = 1
j = i j = i
res = dzero res = dzero
@ -2067,7 +2067,7 @@ contains
nzin_ = 0 nzin_ = 0
endif endif
if (a%is_sorted()) then if (a%is_by_rows()) then
! In this case we can do a binary search. ! In this case we can do a binary search.
if (debug_level >= psb_debug_serial_)& if (debug_level >= psb_debug_serial_)&
& write(debug_unit,*) trim(name), ': srtdcoo ' & write(debug_unit,*) trim(name), ': srtdcoo '
@ -2344,7 +2344,7 @@ contains
nzin_ = 0 nzin_ = 0
endif endif
if (a%is_sorted()) then if (a%is_by_rows()) then
! In this case we can do a binary search. ! In this case we can do a binary search.
if (debug_level >= psb_debug_serial_)& if (debug_level >= psb_debug_serial_)&
& write(debug_unit,*) trim(name), ': srtdcoo ' & write(debug_unit,*) trim(name), ': srtdcoo '
@ -2884,7 +2884,7 @@ subroutine psb_z_cp_coo_to_coo(a,b,info)
call psb_erractionsave(err_act) call psb_erractionsave(err_act)
info = psb_success_ info = psb_success_
b%psb_z_base_sparse_mat = a%psb_z_base_sparse_mat b%psb_z_base_sparse_mat = a%psb_z_base_sparse_mat
call b%set_sort_status(a%get_sort_status())
nz = a%get_nzeros() nz = a%get_nzeros()
call b%set_nzeros(nz) call b%set_nzeros(nz)
call b%reallocate(nz) call b%reallocate(nz)
@ -2894,7 +2894,7 @@ subroutine psb_z_cp_coo_to_coo(a,b,info)
b%val(1:nz) = a%val(1:nz) b%val(1:nz) = a%val(1:nz)
if (.not.b%is_sorted()) call b%fix(info) if (.not.b%is_by_rows()) call b%fix(info)
if (info /= psb_success_) goto 9999 if (info /= psb_success_) goto 9999
@ -2912,7 +2912,7 @@ subroutine psb_z_cp_coo_from_coo(a,b,info)
use psb_z_base_mat_mod, psb_protect_name => psb_z_cp_coo_from_coo use psb_z_base_mat_mod, psb_protect_name => psb_z_cp_coo_from_coo
implicit none implicit none
class(psb_z_coo_sparse_mat), intent(inout) :: a class(psb_z_coo_sparse_mat), intent(inout) :: a
class(psb_z_coo_sparse_mat), intent(in) :: b class(psb_z_coo_sparse_mat), intent(in) :: b
integer(psb_ipk_), intent(out) :: info integer(psb_ipk_), intent(out) :: info
integer(psb_ipk_) :: err_act integer(psb_ipk_) :: err_act
@ -2925,7 +2925,7 @@ subroutine psb_z_cp_coo_from_coo(a,b,info)
call psb_erractionsave(err_act) call psb_erractionsave(err_act)
info = psb_success_ info = psb_success_
a%psb_z_base_sparse_mat = b%psb_z_base_sparse_mat a%psb_z_base_sparse_mat = b%psb_z_base_sparse_mat
call a%set_sort_status(b%get_sort_status())
nz = b%get_nzeros() nz = b%get_nzeros()
call a%set_nzeros(nz) call a%set_nzeros(nz)
call a%reallocate(nz) call a%reallocate(nz)
@ -2934,7 +2934,7 @@ subroutine psb_z_cp_coo_from_coo(a,b,info)
a%ja(1:nz) = b%ja(1:nz) a%ja(1:nz) = b%ja(1:nz)
a%val(1:nz) = b%val(1:nz) a%val(1:nz) = b%val(1:nz)
if (.not.a%is_sorted()) call a%fix(info) if (.not.a%is_by_rows()) call a%fix(info)
if (info /= psb_success_) goto 9999 if (info /= psb_success_) goto 9999
@ -3036,6 +3036,7 @@ subroutine psb_z_mv_coo_to_coo(a,b,info)
call psb_erractionsave(err_act) call psb_erractionsave(err_act)
info = psb_success_ info = psb_success_
b%psb_z_base_sparse_mat = a%psb_z_base_sparse_mat b%psb_z_base_sparse_mat = a%psb_z_base_sparse_mat
call b%set_sort_status(a%get_sort_status())
call b%set_nzeros(a%get_nzeros()) call b%set_nzeros(a%get_nzeros())
call move_alloc(a%ia, b%ia) call move_alloc(a%ia, b%ia)
@ -3043,7 +3044,7 @@ subroutine psb_z_mv_coo_to_coo(a,b,info)
call move_alloc(a%val, b%val) call move_alloc(a%val, b%val)
call a%free() call a%free()
if (.not.b%is_sorted()) call b%fix(info) if (.not.b%is_by_rows()) call b%fix(info)
if (info /= psb_success_) goto 9999 if (info /= psb_success_) goto 9999
@ -3077,13 +3078,14 @@ subroutine psb_z_mv_coo_from_coo(a,b,info)
call psb_erractionsave(err_act) call psb_erractionsave(err_act)
info = psb_success_ info = psb_success_
a%psb_z_base_sparse_mat = b%psb_z_base_sparse_mat a%psb_z_base_sparse_mat = b%psb_z_base_sparse_mat
call a%set_sort_status(b%get_sort_status())
call a%set_nzeros(b%get_nzeros()) call a%set_nzeros(b%get_nzeros())
call move_alloc(b%ia , a%ia ) call move_alloc(b%ia , a%ia )
call move_alloc(b%ja , a%ja ) call move_alloc(b%ja , a%ja )
call move_alloc(b%val, a%val ) call move_alloc(b%val, a%val )
call b%free() call b%free()
if (.not.a%is_sorted()) call a%fix(info) if (.not.a%is_by_rows()) call a%fix(info)
if (info /= psb_success_) goto 9999 if (info /= psb_success_) goto 9999

@ -2139,8 +2139,7 @@ subroutine psb_z_cp_csc_from_coo(a,b,info)
class(psb_z_csc_sparse_mat), intent(inout) :: a class(psb_z_csc_sparse_mat), intent(inout) :: a
class(psb_z_coo_sparse_mat), intent(in) :: b class(psb_z_coo_sparse_mat), intent(in) :: b
integer(psb_ipk_), intent(out) :: info integer(psb_ipk_), intent(out) :: info
type(psb_z_coo_sparse_mat) :: tmp type(psb_z_coo_sparse_mat) :: tmp
integer(psb_ipk_), allocatable :: itemp(:) integer(psb_ipk_), allocatable :: itemp(:)
!locals !locals

@ -2658,7 +2658,7 @@ subroutine psb_z_cp_csr_from_coo(a,b,info)
class(psb_z_csr_sparse_mat), intent(inout) :: a class(psb_z_csr_sparse_mat), intent(inout) :: a
class(psb_z_coo_sparse_mat), intent(in) :: b class(psb_z_coo_sparse_mat), intent(in) :: b
integer(psb_ipk_), intent(out) :: info integer(psb_ipk_), intent(out) :: info
type(psb_z_coo_sparse_mat) :: tmp type(psb_z_coo_sparse_mat) :: tmp
integer(psb_ipk_), allocatable :: itemp(:) integer(psb_ipk_), allocatable :: itemp(:)
@ -2673,7 +2673,7 @@ subroutine psb_z_cp_csr_from_coo(a,b,info)
debug_unit = psb_get_debug_unit() debug_unit = psb_get_debug_unit()
debug_level = psb_get_debug_level() debug_level = psb_get_debug_level()
if (.not.b%is_sorted()) then if (.not.b%is_by_rows()) then
! This is to have fix_coo called behind the scenes ! This is to have fix_coo called behind the scenes
call tmp%cp_from_coo(b,info) call tmp%cp_from_coo(b,info)
if (info /= psb_success_) return if (info /= psb_success_) return
@ -2871,7 +2871,7 @@ subroutine psb_z_mv_csr_from_coo(a,b,info)
debug_level = psb_get_debug_level() debug_level = psb_get_debug_level()
if (.not.b%is_sorted()) call b%fix(info) if (.not.b%is_by_rows()) call b%fix(info)
if (info /= psb_success_) return if (info /= psb_success_) return
nr = b%get_nrows() nr = b%get_nrows()

Loading…
Cancel
Save