|
|
|
@ -131,6 +131,8 @@ module psb_c_base_mat_mod
|
|
|
|
|
!> Coefficient values.
|
|
|
|
|
complex(psb_spk_), allocatable :: val(:)
|
|
|
|
|
|
|
|
|
|
integer, private :: sort_status=psb_unsorted_
|
|
|
|
|
|
|
|
|
|
contains
|
|
|
|
|
!
|
|
|
|
|
! Data management methods.
|
|
|
|
@ -160,6 +162,13 @@ module psb_c_base_mat_mod
|
|
|
|
|
procedure, pass(a) :: print => psb_c_coo_print
|
|
|
|
|
procedure, pass(a) :: free => c_coo_free
|
|
|
|
|
procedure, pass(a) :: mold => psb_c_coo_mold
|
|
|
|
|
procedure, pass(a) :: is_sorted => c_coo_is_sorted
|
|
|
|
|
procedure, pass(a) :: is_by_rows => c_coo_is_by_rows
|
|
|
|
|
procedure, pass(a) :: is_by_cols => c_coo_is_by_cols
|
|
|
|
|
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_sort_status => c_coo_set_sort_status
|
|
|
|
|
|
|
|
|
|
!
|
|
|
|
|
! This is COO specific
|
|
|
|
|
!
|
|
|
|
@ -1292,7 +1301,7 @@ module psb_c_base_mat_mod
|
|
|
|
|
!! \param val(:) Coefficients
|
|
|
|
|
!! \param nzout Number of entries after sorting/duplicate handling
|
|
|
|
|
!! \param info return code
|
|
|
|
|
!! \param idir [0] Sort in: row major order (0) or col major order (1)
|
|
|
|
|
!! \param idir [psb_row_major_] Sort in row major order or col major order
|
|
|
|
|
!!
|
|
|
|
|
!
|
|
|
|
|
interface
|
|
|
|
@ -1311,7 +1320,7 @@ module psb_c_base_mat_mod
|
|
|
|
|
!! \memberof psb_c_coo_sparse_mat
|
|
|
|
|
!! \brief Make sure the entries are sorted and duplicates are handled.
|
|
|
|
|
!! \param info return code
|
|
|
|
|
!! \param idir [0] Sort in: row major order (0) or col major order (1)
|
|
|
|
|
!! \param idir [psb_row_major_] Sort in row major order or col major order
|
|
|
|
|
!!
|
|
|
|
|
!
|
|
|
|
|
interface
|
|
|
|
@ -1742,6 +1751,29 @@ contains
|
|
|
|
|
res = a%nnz
|
|
|
|
|
end function c_coo_get_nzeros
|
|
|
|
|
|
|
|
|
|
function c_coo_is_by_rows(a) result(res)
|
|
|
|
|
implicit none
|
|
|
|
|
class(psb_c_coo_sparse_mat), intent(in) :: a
|
|
|
|
|
logical :: res
|
|
|
|
|
res = (a%sort_status == psb_row_major_)
|
|
|
|
|
end function c_coo_is_by_rows
|
|
|
|
|
|
|
|
|
|
function c_coo_is_by_cols(a) result(res)
|
|
|
|
|
implicit none
|
|
|
|
|
class(psb_c_coo_sparse_mat), intent(in) :: a
|
|
|
|
|
logical :: res
|
|
|
|
|
res = (a%sort_status == psb_col_major_)
|
|
|
|
|
end function c_coo_is_by_cols
|
|
|
|
|
|
|
|
|
|
function c_coo_is_sorted(a) result(res)
|
|
|
|
|
implicit none
|
|
|
|
|
class(psb_c_coo_sparse_mat), intent(in) :: a
|
|
|
|
|
logical :: res
|
|
|
|
|
res = (a%sort_status == psb_row_major_) &
|
|
|
|
|
& .or.(a%sort_status == psb_col_major_)
|
|
|
|
|
end function c_coo_is_sorted
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
! == ==================================
|
|
|
|
|
!
|
|
|
|
@ -1765,6 +1797,34 @@ contains
|
|
|
|
|
|
|
|
|
|
end subroutine c_coo_set_nzeros
|
|
|
|
|
|
|
|
|
|
subroutine c_coo_set_sort_status(ist,a)
|
|
|
|
|
implicit none
|
|
|
|
|
integer(psb_ipk_), intent(in) :: ist
|
|
|
|
|
class(psb_c_coo_sparse_mat), intent(inout) :: a
|
|
|
|
|
|
|
|
|
|
a%sort_status = ist
|
|
|
|
|
call a%set_sorted((a%sort_status == psb_row_major_) &
|
|
|
|
|
& .or.(a%sort_status == psb_col_major_))
|
|
|
|
|
end subroutine c_coo_set_sort_status
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
subroutine c_coo_set_by_rows(a)
|
|
|
|
|
implicit none
|
|
|
|
|
class(psb_c_coo_sparse_mat), intent(inout) :: a
|
|
|
|
|
|
|
|
|
|
a%sort_status = psb_row_major_
|
|
|
|
|
call a%set_sorted()
|
|
|
|
|
end subroutine c_coo_set_by_rows
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
subroutine c_coo_set_by_cols(a)
|
|
|
|
|
implicit none
|
|
|
|
|
class(psb_c_coo_sparse_mat), intent(inout) :: a
|
|
|
|
|
|
|
|
|
|
a%sort_status = psb_col_major_
|
|
|
|
|
call a%set_sorted()
|
|
|
|
|
end subroutine c_coo_set_by_cols
|
|
|
|
|
|
|
|
|
|
! == ==================================
|
|
|
|
|
!
|
|
|
|
|
!
|
|
|
|
|