|
|
@ -195,7 +195,8 @@ contains
|
|
|
|
function psb_amd_order(n,ap,ai,p)&
|
|
|
|
function psb_amd_order(n,ap,ai,p)&
|
|
|
|
& result(res) bind(c,name='psb_amd_order')
|
|
|
|
& result(res) bind(c,name='psb_amd_order')
|
|
|
|
use iso_c_binding
|
|
|
|
use iso_c_binding
|
|
|
|
integer(c_int) :: res, n
|
|
|
|
integer(c_int) :: res
|
|
|
|
|
|
|
|
integer(c_int), value :: n
|
|
|
|
integer(c_int) :: ap(*), ai(*), p(*)
|
|
|
|
integer(c_int) :: ap(*), ai(*), p(*)
|
|
|
|
end function psb_amd_order
|
|
|
|
end function psb_amd_order
|
|
|
|
end interface
|
|
|
|
end interface
|
|
|
@ -207,7 +208,7 @@ contains
|
|
|
|
|
|
|
|
|
|
|
|
integer :: err_act
|
|
|
|
integer :: err_act
|
|
|
|
character(len=20) :: name
|
|
|
|
character(len=20) :: name
|
|
|
|
integer :: i, j, k, ideg, nr, ibw, ipf, idpth
|
|
|
|
integer :: i, j, k, ideg, nr, ibw, ipf, idpth, nz
|
|
|
|
|
|
|
|
|
|
|
|
info = psb_success_
|
|
|
|
info = psb_success_
|
|
|
|
name = 'mat_renum_amd'
|
|
|
|
name = 'mat_renum_amd'
|
|
|
@ -217,23 +218,31 @@ contains
|
|
|
|
|
|
|
|
|
|
|
|
info = psb_success_
|
|
|
|
info = psb_success_
|
|
|
|
nr = a%get_nrows()
|
|
|
|
nr = a%get_nrows()
|
|
|
|
allocate(perm(nr))
|
|
|
|
nz = a%get_nzeros()
|
|
|
|
|
|
|
|
allocate(perm(nr),stat=info)
|
|
|
|
|
|
|
|
if (info /= 0) then
|
|
|
|
|
|
|
|
info = psb_err_alloc_dealloc_
|
|
|
|
|
|
|
|
call psb_errpush(info,name)
|
|
|
|
|
|
|
|
goto 9999
|
|
|
|
|
|
|
|
end if
|
|
|
|
|
|
|
|
|
|
|
|
call a%mold(aa)
|
|
|
|
|
|
|
|
call a%mv_to(aa)
|
|
|
|
allocate(aa, mold=a%a)
|
|
|
|
call aa%mv_to_fmt(acsc,info)
|
|
|
|
call a%mv_to(acsc)
|
|
|
|
|
|
|
|
|
|
|
|
acsc%ia(:) = acsc%ia(:) - 1
|
|
|
|
acsc%ia(:) = acsc%ia(:) - 1
|
|
|
|
acsc%icp(:) = acsc%icp(:) - 1
|
|
|
|
acsc%icp(:) = acsc%icp(:) - 1
|
|
|
|
|
|
|
|
|
|
|
|
info = psb_amd_order(nr,acsc%icp,acsc%ia,perm)
|
|
|
|
info = psb_amd_order(nr,acsc%icp,acsc%ia,perm)
|
|
|
|
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)
|
|
|
|
call psb_errpush(info,name,a_err='psb_amd_order')
|
|
|
|
goto 9999
|
|
|
|
goto 9999
|
|
|
|
end if
|
|
|
|
end if
|
|
|
|
|
|
|
|
|
|
|
|
perm(:) = perm(:) + 1
|
|
|
|
perm(:) = perm(:) + 1
|
|
|
|
acsc%ia(:) = acsc%ia(:) - 1
|
|
|
|
acsc%ia(:) = acsc%ia(:) + 1
|
|
|
|
acsc%icp(:) = acsc%icp(:) - 1
|
|
|
|
acsc%icp(:) = acsc%icp(:) + 1
|
|
|
|
|
|
|
|
|
|
|
|
call acsc%mv_to_coo(acoo,info)
|
|
|
|
call acsc%mv_to_coo(acoo,info)
|
|
|
|
do i=1, acoo%get_nzeros()
|
|
|
|
do i=1, acoo%get_nzeros()
|
|
|
|