|
|
@ -304,7 +304,7 @@ subroutine psb_c_csc_csmv(alpha,a,x,beta,y,info,trans)
|
|
|
|
|
|
|
|
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
|
|
|
|
|
|
|
if (a%is_triangle().and.a%is_unit()) then
|
|
|
|
if (a%is_unit()) then
|
|
|
|
do i=1, min(m,n)
|
|
|
|
do i=1, min(m,n)
|
|
|
|
y(i) = y(i) + alpha*x(i)
|
|
|
|
y(i) = y(i) + alpha*x(i)
|
|
|
|
end do
|
|
|
|
end do
|
|
|
@ -590,7 +590,7 @@ subroutine psb_c_csc_csmm(alpha,a,x,beta,y,info,trans)
|
|
|
|
|
|
|
|
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
|
|
|
|
|
|
|
if (a%is_triangle().and.a%is_unit()) then
|
|
|
|
if (a%is_unit()) then
|
|
|
|
do i=1, min(m,n)
|
|
|
|
do i=1, min(m,n)
|
|
|
|
y(i,:) = y(i,:) + alpha*x(i,:)
|
|
|
|
y(i,:) = y(i,:) + alpha*x(i,:)
|
|
|
|
end do
|
|
|
|
end do
|
|
|
@ -1081,7 +1081,12 @@ function psb_c_csc_maxval(a) result(res)
|
|
|
|
logical, parameter :: debug=.false.
|
|
|
|
logical, parameter :: debug=.false.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (a%is_unit()) then
|
|
|
|
|
|
|
|
res = sone
|
|
|
|
|
|
|
|
else
|
|
|
|
res = szero
|
|
|
|
res = szero
|
|
|
|
|
|
|
|
end if
|
|
|
|
|
|
|
|
|
|
|
|
nnz = a%get_nzeros()
|
|
|
|
nnz = a%get_nzeros()
|
|
|
|
if (allocated(a%val)) then
|
|
|
|
if (allocated(a%val)) then
|
|
|
|
nnz = min(nnz,size(a%val))
|
|
|
|
nnz = min(nnz,size(a%val))
|
|
|
@ -1112,7 +1117,11 @@ function psb_c_csc_csnmi(a) result(res)
|
|
|
|
if (info /= psb_success_) then
|
|
|
|
if (info /= psb_success_) then
|
|
|
|
return
|
|
|
|
return
|
|
|
|
end if
|
|
|
|
end if
|
|
|
|
acc(:) = szero
|
|
|
|
if (a%is_unit()) then
|
|
|
|
|
|
|
|
acc = sone
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
acc = szero
|
|
|
|
|
|
|
|
end if
|
|
|
|
do i=1, nc
|
|
|
|
do i=1, nc
|
|
|
|
do j=a%icp(i),a%icp(i+1)-1
|
|
|
|
do j=a%icp(i),a%icp(i+1)-1
|
|
|
|
acc(a%ia(j)) = acc(a%ia(j)) + abs(a%val(j))
|
|
|
|
acc(a%ia(j)) = acc(a%ia(j)) + abs(a%val(j))
|
|
|
@ -1149,7 +1158,11 @@ function psb_c_csc_csnm1(a) result(res)
|
|
|
|
m = a%get_nrows()
|
|
|
|
m = a%get_nrows()
|
|
|
|
n = a%get_ncols()
|
|
|
|
n = a%get_ncols()
|
|
|
|
do j=1, n
|
|
|
|
do j=1, n
|
|
|
|
|
|
|
|
if (a%is_unit()) then
|
|
|
|
|
|
|
|
acc = sone
|
|
|
|
|
|
|
|
else
|
|
|
|
acc = szero
|
|
|
|
acc = szero
|
|
|
|
|
|
|
|
end if
|
|
|
|
do k=a%icp(j),a%icp(j+1)-1
|
|
|
|
do k=a%icp(j),a%icp(j+1)-1
|
|
|
|
acc = acc + abs(a%val(k))
|
|
|
|
acc = acc + abs(a%val(k))
|
|
|
|
end do
|
|
|
|
end do
|
|
|
@ -1187,19 +1200,17 @@ subroutine psb_c_csc_colsum(d,a)
|
|
|
|
end if
|
|
|
|
end if
|
|
|
|
|
|
|
|
|
|
|
|
do i = 1, a%get_ncols()
|
|
|
|
do i = 1, a%get_ncols()
|
|
|
|
|
|
|
|
if (a%is_unit()) then
|
|
|
|
|
|
|
|
d(i) = cone
|
|
|
|
|
|
|
|
else
|
|
|
|
d(i) = czero
|
|
|
|
d(i) = czero
|
|
|
|
|
|
|
|
end if
|
|
|
|
|
|
|
|
|
|
|
|
do j=a%icp(i),a%icp(i+1)-1
|
|
|
|
do j=a%icp(i),a%icp(i+1)-1
|
|
|
|
d(i) = d(i) + (a%val(j))
|
|
|
|
d(i) = d(i) + (a%val(j))
|
|
|
|
end do
|
|
|
|
end do
|
|
|
|
end do
|
|
|
|
end do
|
|
|
|
|
|
|
|
|
|
|
|
if (a%is_triangle().and.a%is_unit()) then
|
|
|
|
|
|
|
|
do i=1, a%get_ncols()
|
|
|
|
|
|
|
|
d(i) = d(i) + cone
|
|
|
|
|
|
|
|
end do
|
|
|
|
|
|
|
|
end if
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return
|
|
|
|
|
|
|
|
call psb_erractionrestore(err_act)
|
|
|
|
call psb_erractionrestore(err_act)
|
|
|
|
return
|
|
|
|
return
|
|
|
|
|
|
|
|
|
|
|
@ -1242,13 +1253,18 @@ subroutine psb_c_csc_aclsum(d,a)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
do i = 1, a%get_ncols()
|
|
|
|
do i = 1, a%get_ncols()
|
|
|
|
|
|
|
|
if (a%is_unit()) then
|
|
|
|
|
|
|
|
d(i) = sone
|
|
|
|
|
|
|
|
else
|
|
|
|
d(i) = szero
|
|
|
|
d(i) = szero
|
|
|
|
|
|
|
|
end if
|
|
|
|
|
|
|
|
|
|
|
|
do j=a%icp(i),a%icp(i+1)-1
|
|
|
|
do j=a%icp(i),a%icp(i+1)-1
|
|
|
|
d(i) = d(i) + abs(a%val(j))
|
|
|
|
d(i) = d(i) + abs(a%val(j))
|
|
|
|
end do
|
|
|
|
end do
|
|
|
|
end do
|
|
|
|
end do
|
|
|
|
|
|
|
|
|
|
|
|
if (a%is_triangle().and.a%is_unit()) then
|
|
|
|
if (a%is_unit()) then
|
|
|
|
do i=1, a%get_ncols()
|
|
|
|
do i=1, a%get_ncols()
|
|
|
|
d(i) = d(i) + sone
|
|
|
|
d(i) = d(i) + sone
|
|
|
|
end do
|
|
|
|
end do
|
|
|
@ -1295,7 +1311,11 @@ subroutine psb_c_csc_rowsum(d,a)
|
|
|
|
goto 9999
|
|
|
|
goto 9999
|
|
|
|
end if
|
|
|
|
end if
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (a%is_unit()) then
|
|
|
|
|
|
|
|
d = cone
|
|
|
|
|
|
|
|
else
|
|
|
|
d = czero
|
|
|
|
d = czero
|
|
|
|
|
|
|
|
end if
|
|
|
|
|
|
|
|
|
|
|
|
do i=1, m
|
|
|
|
do i=1, m
|
|
|
|
do j=a%icp(i),a%icp(i+1)-1
|
|
|
|
do j=a%icp(i),a%icp(i+1)-1
|
|
|
@ -1304,13 +1324,6 @@ subroutine psb_c_csc_rowsum(d,a)
|
|
|
|
end do
|
|
|
|
end do
|
|
|
|
end do
|
|
|
|
end do
|
|
|
|
|
|
|
|
|
|
|
|
if (a%is_triangle().and.a%is_unit()) then
|
|
|
|
|
|
|
|
do i=1, a%get_nrows()
|
|
|
|
|
|
|
|
d(i) = d(i) + cone
|
|
|
|
|
|
|
|
end do
|
|
|
|
|
|
|
|
end if
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return
|
|
|
|
|
|
|
|
call psb_erractionrestore(err_act)
|
|
|
|
call psb_erractionrestore(err_act)
|
|
|
|
return
|
|
|
|
return
|
|
|
|
|
|
|
|
|
|
|
@ -1352,7 +1365,12 @@ subroutine psb_c_csc_arwsum(d,a)
|
|
|
|
goto 9999
|
|
|
|
goto 9999
|
|
|
|
end if
|
|
|
|
end if
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (a%is_unit()) then
|
|
|
|
|
|
|
|
d = sone
|
|
|
|
|
|
|
|
else
|
|
|
|
d = szero
|
|
|
|
d = szero
|
|
|
|
|
|
|
|
end if
|
|
|
|
|
|
|
|
|
|
|
|
do i=1, m
|
|
|
|
do i=1, m
|
|
|
|
do j=a%icp(i),a%icp(i+1)-1
|
|
|
|
do j=a%icp(i),a%icp(i+1)-1
|
|
|
|
k = a%ia(j)
|
|
|
|
k = a%ia(j)
|
|
|
@ -1360,13 +1378,6 @@ subroutine psb_c_csc_arwsum(d,a)
|
|
|
|
end do
|
|
|
|
end do
|
|
|
|
end do
|
|
|
|
end do
|
|
|
|
|
|
|
|
|
|
|
|
if (a%is_triangle().and.a%is_unit()) then
|
|
|
|
|
|
|
|
do i=1, a%get_nrows()
|
|
|
|
|
|
|
|
d(i) = d(i) + sone
|
|
|
|
|
|
|
|
end do
|
|
|
|
|
|
|
|
end if
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return
|
|
|
|
|
|
|
|
call psb_erractionrestore(err_act)
|
|
|
|
call psb_erractionrestore(err_act)
|
|
|
|
return
|
|
|
|
return
|
|
|
|
|
|
|
|
|
|
|
@ -1408,7 +1419,7 @@ subroutine psb_c_csc_get_diag(a,d,info)
|
|
|
|
end if
|
|
|
|
end if
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (a%is_triangle().and.a%is_unit()) then
|
|
|
|
if (a%is_unit()) then
|
|
|
|
d(1:mnm) = cone
|
|
|
|
d(1:mnm) = cone
|
|
|
|
else
|
|
|
|
else
|
|
|
|
do i=1, mnm
|
|
|
|
do i=1, mnm
|
|
|
@ -1450,6 +1461,7 @@ subroutine psb_c_csc_scal(d,a,info,side)
|
|
|
|
character, intent(in), optional :: side
|
|
|
|
character, intent(in), optional :: side
|
|
|
|
|
|
|
|
|
|
|
|
integer(psb_ipk_) :: err_act,mnm, i, j, n
|
|
|
|
integer(psb_ipk_) :: err_act,mnm, i, j, n
|
|
|
|
|
|
|
|
type(psb_c_coo_sparse_mat) :: tmp
|
|
|
|
integer(psb_ipk_) :: ierr(5)
|
|
|
|
integer(psb_ipk_) :: ierr(5)
|
|
|
|
character(len=20) :: name='scal'
|
|
|
|
character(len=20) :: name='scal'
|
|
|
|
character :: side_
|
|
|
|
character :: side_
|
|
|
@ -1464,6 +1476,10 @@ subroutine psb_c_csc_scal(d,a,info,side)
|
|
|
|
side_ = psb_toupper(side)
|
|
|
|
side_ = psb_toupper(side)
|
|
|
|
end if
|
|
|
|
end if
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (a%is_unit()) then
|
|
|
|
|
|
|
|
call a%add_unit_diag()
|
|
|
|
|
|
|
|
end if
|
|
|
|
|
|
|
|
|
|
|
|
left = (side_ == 'L')
|
|
|
|
left = (side_ == 'L')
|
|
|
|
|
|
|
|
|
|
|
|
if (left) then
|
|
|
|
if (left) then
|
|
|
@ -1524,6 +1540,9 @@ subroutine psb_c_csc_scals(d,a,info)
|
|
|
|
info = psb_success_
|
|
|
|
info = psb_success_
|
|
|
|
call psb_erractionsave(err_act)
|
|
|
|
call psb_erractionsave(err_act)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (a%is_unit()) then
|
|
|
|
|
|
|
|
call a%add_unit_diag()
|
|
|
|
|
|
|
|
end if
|
|
|
|
|
|
|
|
|
|
|
|
do i=1,a%get_nzeros()
|
|
|
|
do i=1,a%get_nzeros()
|
|
|
|
a%val(i) = a%val(i) * d
|
|
|
|
a%val(i) = a%val(i) * d
|
|
|
|