New GELP for EPK data.

new-context
Salvatore Filippone 4 years ago
parent 1a61bd04d4
commit 997020ba81

@ -34,22 +34,38 @@ module psi_c_serial_mod
interface psb_gelp interface psb_gelp
! 2-D version ! 2-D version
subroutine psb_cgelp(trans,iperm,x,info) subroutine psb_m_cgelp(trans,iperm,x,info)
import :: psb_ipk_, psb_spk_ import :: psb_ipk_, psb_mpk_, psb_spk_
implicit none implicit none
complex(psb_spk_), intent(inout) :: x(:,:) complex(psb_spk_), intent(inout) :: x(:,:)
integer(psb_ipk_), intent(in) :: iperm(:) integer(psb_mpk_), intent(in) :: iperm(:)
integer(psb_ipk_), intent(out) :: info integer(psb_ipk_), intent(out) :: info
character, intent(in) :: trans character, intent(in) :: trans
end subroutine psb_cgelp end subroutine psb_m_cgelp
subroutine psb_cgelpv(trans,iperm,x,info) subroutine psb_m_cgelpv(trans,iperm,x,info)
import :: psb_ipk_, psb_spk_ import :: psb_ipk_, psb_mpk_,psb_spk_
implicit none
complex(psb_spk_), intent(inout) :: x(:)
integer(psb_mpk_), intent(in) :: iperm(:)
integer(psb_ipk_), intent(out) :: info
character, intent(in) :: trans
end subroutine psb_m_cgelpv
subroutine psb_e_cgelp(trans,iperm,x,info)
import :: psb_ipk_, psb_epk_, psb_spk_
implicit none
complex(psb_spk_), intent(inout) :: x(:,:)
integer(psb_epk_), intent(in) :: iperm(:)
integer(psb_ipk_), intent(out) :: info
character, intent(in) :: trans
end subroutine psb_e_cgelp
subroutine psb_e_cgelpv(trans,iperm,x,info)
import :: psb_ipk_, psb_epk_, psb_spk_
implicit none implicit none
complex(psb_spk_), intent(inout) :: x(:) complex(psb_spk_), intent(inout) :: x(:)
integer(psb_ipk_), intent(in) :: iperm(:) integer(psb_epk_), intent(in) :: iperm(:)
integer(psb_ipk_), intent(out) :: info integer(psb_ipk_), intent(out) :: info
character, intent(in) :: trans character, intent(in) :: trans
end subroutine psb_cgelpv end subroutine psb_e_cgelpv
end interface psb_gelp end interface psb_gelp
interface psb_geaxpby interface psb_geaxpby

@ -34,22 +34,38 @@ module psi_d_serial_mod
interface psb_gelp interface psb_gelp
! 2-D version ! 2-D version
subroutine psb_dgelp(trans,iperm,x,info) subroutine psb_m_dgelp(trans,iperm,x,info)
import :: psb_ipk_, psb_dpk_ import :: psb_ipk_, psb_mpk_, psb_dpk_
implicit none implicit none
real(psb_dpk_), intent(inout) :: x(:,:) real(psb_dpk_), intent(inout) :: x(:,:)
integer(psb_ipk_), intent(in) :: iperm(:) integer(psb_mpk_), intent(in) :: iperm(:)
integer(psb_ipk_), intent(out) :: info integer(psb_ipk_), intent(out) :: info
character, intent(in) :: trans character, intent(in) :: trans
end subroutine psb_dgelp end subroutine psb_m_dgelp
subroutine psb_dgelpv(trans,iperm,x,info) subroutine psb_m_dgelpv(trans,iperm,x,info)
import :: psb_ipk_, psb_dpk_ import :: psb_ipk_, psb_mpk_,psb_dpk_
implicit none
real(psb_dpk_), intent(inout) :: x(:)
integer(psb_mpk_), intent(in) :: iperm(:)
integer(psb_ipk_), intent(out) :: info
character, intent(in) :: trans
end subroutine psb_m_dgelpv
subroutine psb_e_dgelp(trans,iperm,x,info)
import :: psb_ipk_, psb_epk_, psb_dpk_
implicit none
real(psb_dpk_), intent(inout) :: x(:,:)
integer(psb_epk_), intent(in) :: iperm(:)
integer(psb_ipk_), intent(out) :: info
character, intent(in) :: trans
end subroutine psb_e_dgelp
subroutine psb_e_dgelpv(trans,iperm,x,info)
import :: psb_ipk_, psb_epk_, psb_dpk_
implicit none implicit none
real(psb_dpk_), intent(inout) :: x(:) real(psb_dpk_), intent(inout) :: x(:)
integer(psb_ipk_), intent(in) :: iperm(:) integer(psb_epk_), intent(in) :: iperm(:)
integer(psb_ipk_), intent(out) :: info integer(psb_ipk_), intent(out) :: info
character, intent(in) :: trans character, intent(in) :: trans
end subroutine psb_dgelpv end subroutine psb_e_dgelpv
end interface psb_gelp end interface psb_gelp
interface psb_geaxpby interface psb_geaxpby

@ -34,22 +34,38 @@ module psi_e_serial_mod
interface psb_gelp interface psb_gelp
! 2-D version ! 2-D version
subroutine psb_egelp(trans,iperm,x,info) subroutine psb_m_egelp(trans,iperm,x,info)
import :: psb_ipk_, psb_lpk_,psb_mpk_, psb_epk_ import :: psb_ipk_, psb_lpk_,psb_mpk_, psb_epk_
implicit none implicit none
integer(psb_epk_), intent(inout) :: x(:,:) integer(psb_epk_), intent(inout) :: x(:,:)
integer(psb_ipk_), intent(in) :: iperm(:) integer(psb_mpk_), intent(in) :: iperm(:)
integer(psb_ipk_), intent(out) :: info integer(psb_ipk_), intent(out) :: info
character, intent(in) :: trans character, intent(in) :: trans
end subroutine psb_egelp end subroutine psb_m_egelp
subroutine psb_egelpv(trans,iperm,x,info) subroutine psb_m_egelpv(trans,iperm,x,info)
import :: psb_ipk_, psb_lpk_,psb_mpk_, psb_epk_ import :: psb_ipk_, psb_lpk_,psb_mpk_, psb_epk_
implicit none implicit none
integer(psb_epk_), intent(inout) :: x(:) integer(psb_epk_), intent(inout) :: x(:)
integer(psb_ipk_), intent(in) :: iperm(:) integer(psb_mpk_), intent(in) :: iperm(:)
integer(psb_ipk_), intent(out) :: info integer(psb_ipk_), intent(out) :: info
character, intent(in) :: trans character, intent(in) :: trans
end subroutine psb_egelpv end subroutine psb_m_egelpv
subroutine psb_e_egelp(trans,iperm,x,info)
import :: psb_ipk_, psb_lpk_,psb_mpk_, psb_epk_
implicit none
integer(psb_epk_), intent(inout) :: x(:,:)
integer(psb_epk_), intent(in) :: iperm(:)
integer(psb_ipk_), intent(out) :: info
character, intent(in) :: trans
end subroutine psb_e_egelp
subroutine psb_e_egelpv(trans,iperm,x,info)
import :: psb_ipk_, psb_lpk_,psb_mpk_, psb_epk_
implicit none
integer(psb_epk_), intent(inout) :: x(:)
integer(psb_epk_), intent(in) :: iperm(:)
integer(psb_ipk_), intent(out) :: info
character, intent(in) :: trans
end subroutine psb_e_egelpv
end interface psb_gelp end interface psb_gelp
interface psb_geaxpby interface psb_geaxpby

@ -34,22 +34,38 @@ module psi_i2_serial_mod
interface psb_gelp interface psb_gelp
! 2-D version ! 2-D version
subroutine psb_i2gelp(trans,iperm,x,info) subroutine psb_m_i2gelp(trans,iperm,x,info)
import :: psb_ipk_, psb_lpk_,psb_mpk_, psb_epk_ import :: psb_ipk_, psb_lpk_,psb_mpk_, psb_epk_
implicit none implicit none
integer(psb_i2pk_), intent(inout) :: x(:,:) integer(psb_i2pk_), intent(inout) :: x(:,:)
integer(psb_ipk_), intent(in) :: iperm(:) integer(psb_mpk_), intent(in) :: iperm(:)
integer(psb_ipk_), intent(out) :: info integer(psb_ipk_), intent(out) :: info
character, intent(in) :: trans character, intent(in) :: trans
end subroutine psb_i2gelp end subroutine psb_m_i2gelp
subroutine psb_i2gelpv(trans,iperm,x,info) subroutine psb_m_i2gelpv(trans,iperm,x,info)
import :: psb_ipk_, psb_lpk_,psb_mpk_, psb_epk_ import :: psb_ipk_, psb_lpk_,psb_mpk_, psb_epk_
implicit none implicit none
integer(psb_i2pk_), intent(inout) :: x(:) integer(psb_i2pk_), intent(inout) :: x(:)
integer(psb_ipk_), intent(in) :: iperm(:) integer(psb_mpk_), intent(in) :: iperm(:)
integer(psb_ipk_), intent(out) :: info integer(psb_ipk_), intent(out) :: info
character, intent(in) :: trans character, intent(in) :: trans
end subroutine psb_i2gelpv end subroutine psb_m_i2gelpv
subroutine psb_e_i2gelp(trans,iperm,x,info)
import :: psb_ipk_, psb_lpk_,psb_mpk_, psb_epk_
implicit none
integer(psb_i2pk_), intent(inout) :: x(:,:)
integer(psb_epk_), intent(in) :: iperm(:)
integer(psb_ipk_), intent(out) :: info
character, intent(in) :: trans
end subroutine psb_e_i2gelp
subroutine psb_e_i2gelpv(trans,iperm,x,info)
import :: psb_ipk_, psb_lpk_,psb_mpk_, psb_epk_
implicit none
integer(psb_i2pk_), intent(inout) :: x(:)
integer(psb_epk_), intent(in) :: iperm(:)
integer(psb_ipk_), intent(out) :: info
character, intent(in) :: trans
end subroutine psb_e_i2gelpv
end interface psb_gelp end interface psb_gelp
interface psb_geaxpby interface psb_geaxpby

@ -34,22 +34,38 @@ module psi_m_serial_mod
interface psb_gelp interface psb_gelp
! 2-D version ! 2-D version
subroutine psb_mgelp(trans,iperm,x,info) subroutine psb_m_mgelp(trans,iperm,x,info)
import :: psb_ipk_, psb_lpk_,psb_mpk_, psb_epk_ import :: psb_ipk_, psb_lpk_,psb_mpk_, psb_epk_
implicit none implicit none
integer(psb_mpk_), intent(inout) :: x(:,:) integer(psb_mpk_), intent(inout) :: x(:,:)
integer(psb_ipk_), intent(in) :: iperm(:) integer(psb_mpk_), intent(in) :: iperm(:)
integer(psb_ipk_), intent(out) :: info integer(psb_ipk_), intent(out) :: info
character, intent(in) :: trans character, intent(in) :: trans
end subroutine psb_mgelp end subroutine psb_m_mgelp
subroutine psb_mgelpv(trans,iperm,x,info) subroutine psb_m_mgelpv(trans,iperm,x,info)
import :: psb_ipk_, psb_lpk_,psb_mpk_, psb_epk_ import :: psb_ipk_, psb_lpk_,psb_mpk_, psb_epk_
implicit none implicit none
integer(psb_mpk_), intent(inout) :: x(:) integer(psb_mpk_), intent(inout) :: x(:)
integer(psb_ipk_), intent(in) :: iperm(:) integer(psb_mpk_), intent(in) :: iperm(:)
integer(psb_ipk_), intent(out) :: info integer(psb_ipk_), intent(out) :: info
character, intent(in) :: trans character, intent(in) :: trans
end subroutine psb_mgelpv end subroutine psb_m_mgelpv
subroutine psb_e_mgelp(trans,iperm,x,info)
import :: psb_ipk_, psb_lpk_,psb_mpk_, psb_epk_
implicit none
integer(psb_mpk_), intent(inout) :: x(:,:)
integer(psb_epk_), intent(in) :: iperm(:)
integer(psb_ipk_), intent(out) :: info
character, intent(in) :: trans
end subroutine psb_e_mgelp
subroutine psb_e_mgelpv(trans,iperm,x,info)
import :: psb_ipk_, psb_lpk_,psb_mpk_, psb_epk_
implicit none
integer(psb_mpk_), intent(inout) :: x(:)
integer(psb_epk_), intent(in) :: iperm(:)
integer(psb_ipk_), intent(out) :: info
character, intent(in) :: trans
end subroutine psb_e_mgelpv
end interface psb_gelp end interface psb_gelp
interface psb_geaxpby interface psb_geaxpby

@ -34,22 +34,38 @@ module psi_s_serial_mod
interface psb_gelp interface psb_gelp
! 2-D version ! 2-D version
subroutine psb_sgelp(trans,iperm,x,info) subroutine psb_m_sgelp(trans,iperm,x,info)
import :: psb_ipk_, psb_spk_ import :: psb_ipk_, psb_mpk_, psb_spk_
implicit none implicit none
real(psb_spk_), intent(inout) :: x(:,:) real(psb_spk_), intent(inout) :: x(:,:)
integer(psb_ipk_), intent(in) :: iperm(:) integer(psb_mpk_), intent(in) :: iperm(:)
integer(psb_ipk_), intent(out) :: info integer(psb_ipk_), intent(out) :: info
character, intent(in) :: trans character, intent(in) :: trans
end subroutine psb_sgelp end subroutine psb_m_sgelp
subroutine psb_sgelpv(trans,iperm,x,info) subroutine psb_m_sgelpv(trans,iperm,x,info)
import :: psb_ipk_, psb_spk_ import :: psb_ipk_, psb_mpk_,psb_spk_
implicit none
real(psb_spk_), intent(inout) :: x(:)
integer(psb_mpk_), intent(in) :: iperm(:)
integer(psb_ipk_), intent(out) :: info
character, intent(in) :: trans
end subroutine psb_m_sgelpv
subroutine psb_e_sgelp(trans,iperm,x,info)
import :: psb_ipk_, psb_epk_, psb_spk_
implicit none
real(psb_spk_), intent(inout) :: x(:,:)
integer(psb_epk_), intent(in) :: iperm(:)
integer(psb_ipk_), intent(out) :: info
character, intent(in) :: trans
end subroutine psb_e_sgelp
subroutine psb_e_sgelpv(trans,iperm,x,info)
import :: psb_ipk_, psb_epk_, psb_spk_
implicit none implicit none
real(psb_spk_), intent(inout) :: x(:) real(psb_spk_), intent(inout) :: x(:)
integer(psb_ipk_), intent(in) :: iperm(:) integer(psb_epk_), intent(in) :: iperm(:)
integer(psb_ipk_), intent(out) :: info integer(psb_ipk_), intent(out) :: info
character, intent(in) :: trans character, intent(in) :: trans
end subroutine psb_sgelpv end subroutine psb_e_sgelpv
end interface psb_gelp end interface psb_gelp
interface psb_geaxpby interface psb_geaxpby

@ -34,22 +34,38 @@ module psi_z_serial_mod
interface psb_gelp interface psb_gelp
! 2-D version ! 2-D version
subroutine psb_zgelp(trans,iperm,x,info) subroutine psb_m_zgelp(trans,iperm,x,info)
import :: psb_ipk_, psb_dpk_ import :: psb_ipk_, psb_mpk_, psb_dpk_
implicit none implicit none
complex(psb_dpk_), intent(inout) :: x(:,:) complex(psb_dpk_), intent(inout) :: x(:,:)
integer(psb_ipk_), intent(in) :: iperm(:) integer(psb_mpk_), intent(in) :: iperm(:)
integer(psb_ipk_), intent(out) :: info integer(psb_ipk_), intent(out) :: info
character, intent(in) :: trans character, intent(in) :: trans
end subroutine psb_zgelp end subroutine psb_m_zgelp
subroutine psb_zgelpv(trans,iperm,x,info) subroutine psb_m_zgelpv(trans,iperm,x,info)
import :: psb_ipk_, psb_dpk_ import :: psb_ipk_, psb_mpk_,psb_dpk_
implicit none
complex(psb_dpk_), intent(inout) :: x(:)
integer(psb_mpk_), intent(in) :: iperm(:)
integer(psb_ipk_), intent(out) :: info
character, intent(in) :: trans
end subroutine psb_m_zgelpv
subroutine psb_e_zgelp(trans,iperm,x,info)
import :: psb_ipk_, psb_epk_, psb_dpk_
implicit none
complex(psb_dpk_), intent(inout) :: x(:,:)
integer(psb_epk_), intent(in) :: iperm(:)
integer(psb_ipk_), intent(out) :: info
character, intent(in) :: trans
end subroutine psb_e_zgelp
subroutine psb_e_zgelpv(trans,iperm,x,info)
import :: psb_ipk_, psb_epk_, psb_dpk_
implicit none implicit none
complex(psb_dpk_), intent(inout) :: x(:) complex(psb_dpk_), intent(inout) :: x(:)
integer(psb_ipk_), intent(in) :: iperm(:) integer(psb_epk_), intent(in) :: iperm(:)
integer(psb_ipk_), intent(out) :: info integer(psb_ipk_), intent(out) :: info
character, intent(in) :: trans character, intent(in) :: trans
end subroutine psb_zgelpv end subroutine psb_e_zgelpv
end interface psb_gelp end interface psb_gelp
interface psb_geaxpby interface psb_geaxpby

@ -40,14 +40,14 @@
! iperm - integer. ! iperm - integer.
! x - real, dimension(:,:). ! x - real, dimension(:,:).
! info - integer. Return code. ! info - integer. Return code.
subroutine psb_cgelp(trans,iperm,x,info) subroutine psb_m_cgelp(trans,iperm,x,info)
use psb_serial_mod, psb_protect_name => psb_cgelp use psb_serial_mod, psb_protect_name => psb_m_cgelp
use psb_const_mod use psb_const_mod
use psb_error_mod use psb_error_mod
implicit none implicit none
complex(psb_spk_), intent(inout) :: x(:,:) complex(psb_spk_), intent(inout) :: x(:,:)
integer(psb_ipk_), intent(in) :: iperm(:) integer(psb_mpk_), intent(in) :: iperm(:)
integer(psb_ipk_), intent(out) :: info integer(psb_ipk_), intent(out) :: info
character, intent(in) :: trans character, intent(in) :: trans
@ -57,8 +57,7 @@ subroutine psb_cgelp(trans,iperm,x,info)
integer(psb_ipk_), allocatable :: itemp(:) integer(psb_ipk_), allocatable :: itemp(:)
complex(psb_spk_),parameter :: one=1 complex(psb_spk_),parameter :: one=1
integer(psb_ipk_) :: debug_level, debug_unit integer(psb_ipk_) :: debug_level, debug_unit
character(len=20) :: name
character(len=20) :: name, ch_err
name = 'psb_cgelp' name = 'psb_cgelp'
if(psb_get_errstatus() /= 0) return if(psb_get_errstatus() /= 0) return
@ -108,8 +107,7 @@ subroutine psb_cgelp(trans,iperm,x,info)
end do end do
case default case default
info=psb_err_from_subroutine_ info=psb_err_from_subroutine_
ch_err='dgelp' call psb_errpush(info,name,a_err='cgelp')
call psb_errpush(info,name,a_err=ch_err)
end select end select
deallocate(temp,itemp) deallocate(temp,itemp)
@ -121,7 +119,7 @@ subroutine psb_cgelp(trans,iperm,x,info)
return return
end subroutine psb_cgelp end subroutine psb_m_cgelp
@ -166,14 +164,14 @@ end subroutine psb_cgelp
! iperm - integer. ! iperm - integer.
! x - real, dimension(:). ! x - real, dimension(:).
! info - integer. Return code. ! info - integer. Return code.
subroutine psb_cgelpv(trans,iperm,x,info) subroutine psb_m_cgelpv(trans,iperm,x,info)
use psb_serial_mod, psb_protect_name => psb_cgelpv use psb_serial_mod, psb_protect_name => psb_m_cgelpv
use psb_const_mod use psb_const_mod
use psb_error_mod use psb_error_mod
implicit none implicit none
complex(psb_spk_), intent(inout) :: x(:) complex(psb_spk_), intent(inout) :: x(:)
integer(psb_ipk_), intent(in) :: iperm(:) integer(psb_mpk_), intent(in) :: iperm(:)
integer(psb_ipk_), intent(out) :: info integer(psb_ipk_), intent(out) :: info
character, intent(in) :: trans character, intent(in) :: trans
@ -183,8 +181,7 @@ subroutine psb_cgelpv(trans,iperm,x,info)
integer(psb_ipk_), allocatable :: itemp(:) integer(psb_ipk_), allocatable :: itemp(:)
complex(psb_spk_),parameter :: one=1 complex(psb_spk_),parameter :: one=1
integer(psb_ipk_) :: debug_level, debug_unit integer(psb_ipk_) :: debug_level, debug_unit
character(len=20) :: name
character(len=20) :: name, ch_err
name = 'psb_cgelpv' name = 'psb_cgelpv'
if(psb_get_errstatus() /= 0) return if(psb_get_errstatus() /= 0) return
@ -229,8 +226,208 @@ subroutine psb_cgelpv(trans,iperm,x,info)
end do end do
case default case default
info=psb_err_from_subroutine_ info=psb_err_from_subroutine_
ch_err='dgelp' call psb_errpush(info,name,a_err='cgelp')
call psb_errpush(info,name,a_err=ch_err) end select
deallocate(temp,itemp)
call psb_erractionrestore(err_act)
return
9999 call psb_error_handler(err_act)
return
end subroutine psb_m_cgelpv
subroutine psb_e_cgelp(trans,iperm,x,info)
use psb_serial_mod, psb_protect_name => psb_e_cgelp
use psb_const_mod
use psb_error_mod
implicit none
complex(psb_spk_), intent(inout) :: x(:,:)
integer(psb_epk_), intent(in) :: iperm(:)
integer(psb_ipk_), intent(out) :: info
character, intent(in) :: trans
! local variables
complex(psb_spk_),allocatable :: temp(:)
integer(psb_ipk_) :: int_err(5), err_act
integer(psb_epk_) :: i1sz, i2sz, i, j
integer(psb_epk_), allocatable :: itemp(:)
complex(psb_spk_),parameter :: one=1
integer(psb_ipk_) :: debug_level, debug_unit
character(len=20) :: name
name = 'psb_cgelp'
if(psb_get_errstatus() /= 0) return
info=psb_success_
call psb_erractionsave(err_act)
debug_unit = psb_get_debug_unit()
debug_level = psb_get_debug_level()
i1sz = size(x,dim=1)
i2sz = size(x,dim=2)
if (debug_level >= psb_debug_serial_)&
& write(debug_unit,*) trim(name),': size',i1sz,i2sz
allocate(temp(i1sz),itemp(size(iperm)),stat=info)
if (info /= psb_success_) then
info=2040
call psb_errpush(info,name)
goto 9999
end if
itemp(:) = iperm(:)
if (.not.psb_isaperm(i1sz,itemp)) then
info=psb_err_iarg_invalid_value_
int_err(1) = 1
call psb_errpush(info,name,i_err=int_err)
goto 9999
endif
select case( psb_toupper(trans))
case('N')
do j=1,i2sz
do i=1,i1sz
temp(i) = x(itemp(i),j)
end do
do i=1,i1sz
x(i,j) = temp(i)
end do
end do
case('T')
do j=1,i2sz
do i=1,i1sz
temp(itemp(i)) = x(i,j)
end do
do i=1,i1sz
x(i,j) = temp(i)
end do
end do
case default
info=psb_err_from_subroutine_
call psb_errpush(info,name,a_err='cgelp')
end select
deallocate(temp,itemp)
call psb_erractionrestore(err_act)
return
9999 call psb_error_handler(err_act)
return
end subroutine psb_e_cgelp
!!$
!!$ Parallel Sparse BLAS version 3.5
!!$ (C) Copyright 2006-2018
!!$ Salvatore Filippone University of Rome Tor Vergata
!!$ Alfredo Buttari University of Rome Tor Vergata
!!$
!!$ Redistribution and use in source and binary forms, with or without
!!$ modification, are permitted provided that the following conditions
!!$ are met:
!!$ 1. Redistributions of source code must retain the above copyright
!!$ notice, this list of conditions and the following disclaimer.
!!$ 2. Redistributions in binary form must reproduce the above copyright
!!$ notice, this list of conditions, and the following disclaimer in the
!!$ documentation and/or other materials provided with the distribution.
!!$ 3. The name of the PSBLAS group or the names of its contributors may
!!$ not be used to endorse or promote products derived from this
!!$ software without specific written permission.
!!$
!!$ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
!!$ ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
!!$ TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
!!$ PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE PSBLAS GROUP OR ITS CONTRIBUTORS
!!$ BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
!!$ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
!!$ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
!!$ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
!!$ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
!!$ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
!!$ POSSIBILITY OF SUCH DAMAGE.
!!$
!!$
!
!
! Subroutine: psb_cgelpv
! Apply a left permutation to a dense matrix
!
! Arguments:
! trans - character.
! iperm - integer.
! x - real, dimension(:).
! info - integer. Return code.
subroutine psb_e_cgelpv(trans,iperm,x,info)
use psb_serial_mod, psb_protect_name => psb_e_cgelpv
use psb_const_mod
use psb_error_mod
implicit none
complex(psb_spk_), intent(inout) :: x(:)
integer(psb_epk_), intent(in) :: iperm(:)
integer(psb_ipk_), intent(out) :: info
character, intent(in) :: trans
! local variables
integer(psb_ipk_) :: int_err(5), err_act
complex(psb_spk_),allocatable :: temp(:)
integer(psb_epk_) :: i1sz, i
integer(psb_epk_), allocatable :: itemp(:)
integer(psb_ipk_) :: debug_level, debug_unit
character(len=20) :: name
name = 'psb_cgelp'
if(psb_get_errstatus() /= 0) return
info=psb_success_
call psb_erractionsave(err_act)
debug_unit = psb_get_debug_unit()
debug_level = psb_get_debug_level()
i1sz = min(size(x),size(iperm))
if (debug_level >= psb_debug_serial_)&
& write(debug_unit,*) trim(name),': size',i1sz
allocate(temp(i1sz),itemp(size(iperm)),stat=info)
if (info /= psb_success_) then
info=2040
call psb_errpush(info,name)
goto 9999
end if
itemp(:) = iperm(:)
if (.not.psb_isaperm(i1sz,itemp)) then
info=psb_err_iarg_invalid_value_
int_err(1) = 1
call psb_errpush(info,name,i_err=int_err)
goto 9999
endif
select case( psb_toupper(trans))
case('N')
do i=1,i1sz
temp(i) = x(itemp(i))
end do
do i=1,i1sz
x(i) = temp(i)
end do
case('T')
do i=1,i1sz
temp(itemp(i)) = x(i)
end do
do i=1,i1sz
x(i) = temp(i)
end do
case default
info=psb_err_from_subroutine_
call psb_errpush(info,name,a_err='cgelp')
end select end select
deallocate(temp,itemp) deallocate(temp,itemp)
@ -242,5 +439,5 @@ subroutine psb_cgelpv(trans,iperm,x,info)
return return
end subroutine psb_cgelpv end subroutine psb_e_cgelpv

@ -40,14 +40,14 @@
! iperm - integer. ! iperm - integer.
! x - real, dimension(:,:). ! x - real, dimension(:,:).
! info - integer. Return code. ! info - integer. Return code.
subroutine psb_dgelp(trans,iperm,x,info) subroutine psb_m_dgelp(trans,iperm,x,info)
use psb_serial_mod, psb_protect_name => psb_dgelp use psb_serial_mod, psb_protect_name => psb_m_dgelp
use psb_const_mod use psb_const_mod
use psb_error_mod use psb_error_mod
implicit none implicit none
real(psb_dpk_), intent(inout) :: x(:,:) real(psb_dpk_), intent(inout) :: x(:,:)
integer(psb_ipk_), intent(in) :: iperm(:) integer(psb_mpk_), intent(in) :: iperm(:)
integer(psb_ipk_), intent(out) :: info integer(psb_ipk_), intent(out) :: info
character, intent(in) :: trans character, intent(in) :: trans
@ -57,8 +57,7 @@ subroutine psb_dgelp(trans,iperm,x,info)
integer(psb_ipk_), allocatable :: itemp(:) integer(psb_ipk_), allocatable :: itemp(:)
real(psb_dpk_),parameter :: one=1 real(psb_dpk_),parameter :: one=1
integer(psb_ipk_) :: debug_level, debug_unit integer(psb_ipk_) :: debug_level, debug_unit
character(len=20) :: name
character(len=20) :: name, ch_err
name = 'psb_dgelp' name = 'psb_dgelp'
if(psb_get_errstatus() /= 0) return if(psb_get_errstatus() /= 0) return
@ -108,8 +107,7 @@ subroutine psb_dgelp(trans,iperm,x,info)
end do end do
case default case default
info=psb_err_from_subroutine_ info=psb_err_from_subroutine_
ch_err='dgelp' call psb_errpush(info,name,a_err='dgelp')
call psb_errpush(info,name,a_err=ch_err)
end select end select
deallocate(temp,itemp) deallocate(temp,itemp)
@ -121,7 +119,7 @@ subroutine psb_dgelp(trans,iperm,x,info)
return return
end subroutine psb_dgelp end subroutine psb_m_dgelp
@ -166,14 +164,14 @@ end subroutine psb_dgelp
! iperm - integer. ! iperm - integer.
! x - real, dimension(:). ! x - real, dimension(:).
! info - integer. Return code. ! info - integer. Return code.
subroutine psb_dgelpv(trans,iperm,x,info) subroutine psb_m_dgelpv(trans,iperm,x,info)
use psb_serial_mod, psb_protect_name => psb_dgelpv use psb_serial_mod, psb_protect_name => psb_m_dgelpv
use psb_const_mod use psb_const_mod
use psb_error_mod use psb_error_mod
implicit none implicit none
real(psb_dpk_), intent(inout) :: x(:) real(psb_dpk_), intent(inout) :: x(:)
integer(psb_ipk_), intent(in) :: iperm(:) integer(psb_mpk_), intent(in) :: iperm(:)
integer(psb_ipk_), intent(out) :: info integer(psb_ipk_), intent(out) :: info
character, intent(in) :: trans character, intent(in) :: trans
@ -183,8 +181,7 @@ subroutine psb_dgelpv(trans,iperm,x,info)
integer(psb_ipk_), allocatable :: itemp(:) integer(psb_ipk_), allocatable :: itemp(:)
real(psb_dpk_),parameter :: one=1 real(psb_dpk_),parameter :: one=1
integer(psb_ipk_) :: debug_level, debug_unit integer(psb_ipk_) :: debug_level, debug_unit
character(len=20) :: name
character(len=20) :: name, ch_err
name = 'psb_dgelpv' name = 'psb_dgelpv'
if(psb_get_errstatus() /= 0) return if(psb_get_errstatus() /= 0) return
@ -229,8 +226,208 @@ subroutine psb_dgelpv(trans,iperm,x,info)
end do end do
case default case default
info=psb_err_from_subroutine_ info=psb_err_from_subroutine_
ch_err='dgelp' call psb_errpush(info,name,a_err='dgelp')
call psb_errpush(info,name,a_err=ch_err) end select
deallocate(temp,itemp)
call psb_erractionrestore(err_act)
return
9999 call psb_error_handler(err_act)
return
end subroutine psb_m_dgelpv
subroutine psb_e_dgelp(trans,iperm,x,info)
use psb_serial_mod, psb_protect_name => psb_e_dgelp
use psb_const_mod
use psb_error_mod
implicit none
real(psb_dpk_), intent(inout) :: x(:,:)
integer(psb_epk_), intent(in) :: iperm(:)
integer(psb_ipk_), intent(out) :: info
character, intent(in) :: trans
! local variables
real(psb_dpk_),allocatable :: temp(:)
integer(psb_ipk_) :: int_err(5), err_act
integer(psb_epk_) :: i1sz, i2sz, i, j
integer(psb_epk_), allocatable :: itemp(:)
real(psb_dpk_),parameter :: one=1
integer(psb_ipk_) :: debug_level, debug_unit
character(len=20) :: name
name = 'psb_dgelp'
if(psb_get_errstatus() /= 0) return
info=psb_success_
call psb_erractionsave(err_act)
debug_unit = psb_get_debug_unit()
debug_level = psb_get_debug_level()
i1sz = size(x,dim=1)
i2sz = size(x,dim=2)
if (debug_level >= psb_debug_serial_)&
& write(debug_unit,*) trim(name),': size',i1sz,i2sz
allocate(temp(i1sz),itemp(size(iperm)),stat=info)
if (info /= psb_success_) then
info=2040
call psb_errpush(info,name)
goto 9999
end if
itemp(:) = iperm(:)
if (.not.psb_isaperm(i1sz,itemp)) then
info=psb_err_iarg_invalid_value_
int_err(1) = 1
call psb_errpush(info,name,i_err=int_err)
goto 9999
endif
select case( psb_toupper(trans))
case('N')
do j=1,i2sz
do i=1,i1sz
temp(i) = x(itemp(i),j)
end do
do i=1,i1sz
x(i,j) = temp(i)
end do
end do
case('T')
do j=1,i2sz
do i=1,i1sz
temp(itemp(i)) = x(i,j)
end do
do i=1,i1sz
x(i,j) = temp(i)
end do
end do
case default
info=psb_err_from_subroutine_
call psb_errpush(info,name,a_err='dgelp')
end select
deallocate(temp,itemp)
call psb_erractionrestore(err_act)
return
9999 call psb_error_handler(err_act)
return
end subroutine psb_e_dgelp
!!$
!!$ Parallel Sparse BLAS version 3.5
!!$ (C) Copyright 2006-2018
!!$ Salvatore Filippone University of Rome Tor Vergata
!!$ Alfredo Buttari University of Rome Tor Vergata
!!$
!!$ Redistribution and use in source and binary forms, with or without
!!$ modification, are permitted provided that the following conditions
!!$ are met:
!!$ 1. Redistributions of source code must retain the above copyright
!!$ notice, this list of conditions and the following disclaimer.
!!$ 2. Redistributions in binary form must reproduce the above copyright
!!$ notice, this list of conditions, and the following disclaimer in the
!!$ documentation and/or other materials provided with the distribution.
!!$ 3. The name of the PSBLAS group or the names of its contributors may
!!$ not be used to endorse or promote products derived from this
!!$ software without specific written permission.
!!$
!!$ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
!!$ ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
!!$ TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
!!$ PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE PSBLAS GROUP OR ITS CONTRIBUTORS
!!$ BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
!!$ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
!!$ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
!!$ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
!!$ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
!!$ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
!!$ POSSIBILITY OF SUCH DAMAGE.
!!$
!!$
!
!
! Subroutine: psb_dgelpv
! Apply a left permutation to a dense matrix
!
! Arguments:
! trans - character.
! iperm - integer.
! x - real, dimension(:).
! info - integer. Return code.
subroutine psb_e_dgelpv(trans,iperm,x,info)
use psb_serial_mod, psb_protect_name => psb_e_dgelpv
use psb_const_mod
use psb_error_mod
implicit none
real(psb_dpk_), intent(inout) :: x(:)
integer(psb_epk_), intent(in) :: iperm(:)
integer(psb_ipk_), intent(out) :: info
character, intent(in) :: trans
! local variables
integer(psb_ipk_) :: int_err(5), err_act
real(psb_dpk_),allocatable :: temp(:)
integer(psb_epk_) :: i1sz, i
integer(psb_epk_), allocatable :: itemp(:)
integer(psb_ipk_) :: debug_level, debug_unit
character(len=20) :: name
name = 'psb_dgelp'
if(psb_get_errstatus() /= 0) return
info=psb_success_
call psb_erractionsave(err_act)
debug_unit = psb_get_debug_unit()
debug_level = psb_get_debug_level()
i1sz = min(size(x),size(iperm))
if (debug_level >= psb_debug_serial_)&
& write(debug_unit,*) trim(name),': size',i1sz
allocate(temp(i1sz),itemp(size(iperm)),stat=info)
if (info /= psb_success_) then
info=2040
call psb_errpush(info,name)
goto 9999
end if
itemp(:) = iperm(:)
if (.not.psb_isaperm(i1sz,itemp)) then
info=psb_err_iarg_invalid_value_
int_err(1) = 1
call psb_errpush(info,name,i_err=int_err)
goto 9999
endif
select case( psb_toupper(trans))
case('N')
do i=1,i1sz
temp(i) = x(itemp(i))
end do
do i=1,i1sz
x(i) = temp(i)
end do
case('T')
do i=1,i1sz
temp(itemp(i)) = x(i)
end do
do i=1,i1sz
x(i) = temp(i)
end do
case default
info=psb_err_from_subroutine_
call psb_errpush(info,name,a_err='dgelp')
end select end select
deallocate(temp,itemp) deallocate(temp,itemp)
@ -242,5 +439,5 @@ subroutine psb_dgelpv(trans,iperm,x,info)
return return
end subroutine psb_dgelpv end subroutine psb_e_dgelpv

@ -40,14 +40,14 @@
! iperm - integer. ! iperm - integer.
! x - real, dimension(:,:). ! x - real, dimension(:,:).
! info - integer. Return code. ! info - integer. Return code.
subroutine psb_sgelp(trans,iperm,x,info) subroutine psb_m_sgelp(trans,iperm,x,info)
use psb_serial_mod, psb_protect_name => psb_sgelp use psb_serial_mod, psb_protect_name => psb_m_sgelp
use psb_const_mod use psb_const_mod
use psb_error_mod use psb_error_mod
implicit none implicit none
real(psb_spk_), intent(inout) :: x(:,:) real(psb_spk_), intent(inout) :: x(:,:)
integer(psb_ipk_), intent(in) :: iperm(:) integer(psb_mpk_), intent(in) :: iperm(:)
integer(psb_ipk_), intent(out) :: info integer(psb_ipk_), intent(out) :: info
character, intent(in) :: trans character, intent(in) :: trans
@ -57,8 +57,7 @@ subroutine psb_sgelp(trans,iperm,x,info)
integer(psb_ipk_), allocatable :: itemp(:) integer(psb_ipk_), allocatable :: itemp(:)
real(psb_spk_),parameter :: one=1 real(psb_spk_),parameter :: one=1
integer(psb_ipk_) :: debug_level, debug_unit integer(psb_ipk_) :: debug_level, debug_unit
character(len=20) :: name
character(len=20) :: name, ch_err
name = 'psb_sgelp' name = 'psb_sgelp'
if(psb_get_errstatus() /= 0) return if(psb_get_errstatus() /= 0) return
@ -108,8 +107,7 @@ subroutine psb_sgelp(trans,iperm,x,info)
end do end do
case default case default
info=psb_err_from_subroutine_ info=psb_err_from_subroutine_
ch_err='dgelp' call psb_errpush(info,name,a_err='sgelp')
call psb_errpush(info,name,a_err=ch_err)
end select end select
deallocate(temp,itemp) deallocate(temp,itemp)
@ -121,7 +119,7 @@ subroutine psb_sgelp(trans,iperm,x,info)
return return
end subroutine psb_sgelp end subroutine psb_m_sgelp
@ -166,14 +164,14 @@ end subroutine psb_sgelp
! iperm - integer. ! iperm - integer.
! x - real, dimension(:). ! x - real, dimension(:).
! info - integer. Return code. ! info - integer. Return code.
subroutine psb_sgelpv(trans,iperm,x,info) subroutine psb_m_sgelpv(trans,iperm,x,info)
use psb_serial_mod, psb_protect_name => psb_sgelpv use psb_serial_mod, psb_protect_name => psb_m_sgelpv
use psb_const_mod use psb_const_mod
use psb_error_mod use psb_error_mod
implicit none implicit none
real(psb_spk_), intent(inout) :: x(:) real(psb_spk_), intent(inout) :: x(:)
integer(psb_ipk_), intent(in) :: iperm(:) integer(psb_mpk_), intent(in) :: iperm(:)
integer(psb_ipk_), intent(out) :: info integer(psb_ipk_), intent(out) :: info
character, intent(in) :: trans character, intent(in) :: trans
@ -183,8 +181,7 @@ subroutine psb_sgelpv(trans,iperm,x,info)
integer(psb_ipk_), allocatable :: itemp(:) integer(psb_ipk_), allocatable :: itemp(:)
real(psb_spk_),parameter :: one=1 real(psb_spk_),parameter :: one=1
integer(psb_ipk_) :: debug_level, debug_unit integer(psb_ipk_) :: debug_level, debug_unit
character(len=20) :: name
character(len=20) :: name, ch_err
name = 'psb_sgelpv' name = 'psb_sgelpv'
if(psb_get_errstatus() /= 0) return if(psb_get_errstatus() /= 0) return
@ -229,8 +226,208 @@ subroutine psb_sgelpv(trans,iperm,x,info)
end do end do
case default case default
info=psb_err_from_subroutine_ info=psb_err_from_subroutine_
ch_err='dgelp' call psb_errpush(info,name,a_err='sgelp')
call psb_errpush(info,name,a_err=ch_err) end select
deallocate(temp,itemp)
call psb_erractionrestore(err_act)
return
9999 call psb_error_handler(err_act)
return
end subroutine psb_m_sgelpv
subroutine psb_e_sgelp(trans,iperm,x,info)
use psb_serial_mod, psb_protect_name => psb_e_sgelp
use psb_const_mod
use psb_error_mod
implicit none
real(psb_spk_), intent(inout) :: x(:,:)
integer(psb_epk_), intent(in) :: iperm(:)
integer(psb_ipk_), intent(out) :: info
character, intent(in) :: trans
! local variables
real(psb_spk_),allocatable :: temp(:)
integer(psb_ipk_) :: int_err(5), err_act
integer(psb_epk_) :: i1sz, i2sz, i, j
integer(psb_epk_), allocatable :: itemp(:)
real(psb_spk_),parameter :: one=1
integer(psb_ipk_) :: debug_level, debug_unit
character(len=20) :: name
name = 'psb_sgelp'
if(psb_get_errstatus() /= 0) return
info=psb_success_
call psb_erractionsave(err_act)
debug_unit = psb_get_debug_unit()
debug_level = psb_get_debug_level()
i1sz = size(x,dim=1)
i2sz = size(x,dim=2)
if (debug_level >= psb_debug_serial_)&
& write(debug_unit,*) trim(name),': size',i1sz,i2sz
allocate(temp(i1sz),itemp(size(iperm)),stat=info)
if (info /= psb_success_) then
info=2040
call psb_errpush(info,name)
goto 9999
end if
itemp(:) = iperm(:)
if (.not.psb_isaperm(i1sz,itemp)) then
info=psb_err_iarg_invalid_value_
int_err(1) = 1
call psb_errpush(info,name,i_err=int_err)
goto 9999
endif
select case( psb_toupper(trans))
case('N')
do j=1,i2sz
do i=1,i1sz
temp(i) = x(itemp(i),j)
end do
do i=1,i1sz
x(i,j) = temp(i)
end do
end do
case('T')
do j=1,i2sz
do i=1,i1sz
temp(itemp(i)) = x(i,j)
end do
do i=1,i1sz
x(i,j) = temp(i)
end do
end do
case default
info=psb_err_from_subroutine_
call psb_errpush(info,name,a_err='sgelp')
end select
deallocate(temp,itemp)
call psb_erractionrestore(err_act)
return
9999 call psb_error_handler(err_act)
return
end subroutine psb_e_sgelp
!!$
!!$ Parallel Sparse BLAS version 3.5
!!$ (C) Copyright 2006-2018
!!$ Salvatore Filippone University of Rome Tor Vergata
!!$ Alfredo Buttari University of Rome Tor Vergata
!!$
!!$ Redistribution and use in source and binary forms, with or without
!!$ modification, are permitted provided that the following conditions
!!$ are met:
!!$ 1. Redistributions of source code must retain the above copyright
!!$ notice, this list of conditions and the following disclaimer.
!!$ 2. Redistributions in binary form must reproduce the above copyright
!!$ notice, this list of conditions, and the following disclaimer in the
!!$ documentation and/or other materials provided with the distribution.
!!$ 3. The name of the PSBLAS group or the names of its contributors may
!!$ not be used to endorse or promote products derived from this
!!$ software without specific written permission.
!!$
!!$ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
!!$ ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
!!$ TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
!!$ PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE PSBLAS GROUP OR ITS CONTRIBUTORS
!!$ BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
!!$ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
!!$ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
!!$ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
!!$ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
!!$ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
!!$ POSSIBILITY OF SUCH DAMAGE.
!!$
!!$
!
!
! Subroutine: psb_sgelpv
! Apply a left permutation to a dense matrix
!
! Arguments:
! trans - character.
! iperm - integer.
! x - real, dimension(:).
! info - integer. Return code.
subroutine psb_e_sgelpv(trans,iperm,x,info)
use psb_serial_mod, psb_protect_name => psb_e_sgelpv
use psb_const_mod
use psb_error_mod
implicit none
real(psb_spk_), intent(inout) :: x(:)
integer(psb_epk_), intent(in) :: iperm(:)
integer(psb_ipk_), intent(out) :: info
character, intent(in) :: trans
! local variables
integer(psb_ipk_) :: int_err(5), err_act
real(psb_spk_),allocatable :: temp(:)
integer(psb_epk_) :: i1sz, i
integer(psb_epk_), allocatable :: itemp(:)
integer(psb_ipk_) :: debug_level, debug_unit
character(len=20) :: name
name = 'psb_sgelp'
if(psb_get_errstatus() /= 0) return
info=psb_success_
call psb_erractionsave(err_act)
debug_unit = psb_get_debug_unit()
debug_level = psb_get_debug_level()
i1sz = min(size(x),size(iperm))
if (debug_level >= psb_debug_serial_)&
& write(debug_unit,*) trim(name),': size',i1sz
allocate(temp(i1sz),itemp(size(iperm)),stat=info)
if (info /= psb_success_) then
info=2040
call psb_errpush(info,name)
goto 9999
end if
itemp(:) = iperm(:)
if (.not.psb_isaperm(i1sz,itemp)) then
info=psb_err_iarg_invalid_value_
int_err(1) = 1
call psb_errpush(info,name,i_err=int_err)
goto 9999
endif
select case( psb_toupper(trans))
case('N')
do i=1,i1sz
temp(i) = x(itemp(i))
end do
do i=1,i1sz
x(i) = temp(i)
end do
case('T')
do i=1,i1sz
temp(itemp(i)) = x(i)
end do
do i=1,i1sz
x(i) = temp(i)
end do
case default
info=psb_err_from_subroutine_
call psb_errpush(info,name,a_err='sgelp')
end select end select
deallocate(temp,itemp) deallocate(temp,itemp)
@ -242,5 +439,5 @@ subroutine psb_sgelpv(trans,iperm,x,info)
return return
end subroutine psb_sgelpv end subroutine psb_e_sgelpv

@ -40,14 +40,14 @@
! iperm - integer. ! iperm - integer.
! x - real, dimension(:,:). ! x - real, dimension(:,:).
! info - integer. Return code. ! info - integer. Return code.
subroutine psb_zgelp(trans,iperm,x,info) subroutine psb_m_zgelp(trans,iperm,x,info)
use psb_serial_mod, psb_protect_name => psb_zgelp use psb_serial_mod, psb_protect_name => psb_m_zgelp
use psb_const_mod use psb_const_mod
use psb_error_mod use psb_error_mod
implicit none implicit none
complex(psb_dpk_), intent(inout) :: x(:,:) complex(psb_dpk_), intent(inout) :: x(:,:)
integer(psb_ipk_), intent(in) :: iperm(:) integer(psb_mpk_), intent(in) :: iperm(:)
integer(psb_ipk_), intent(out) :: info integer(psb_ipk_), intent(out) :: info
character, intent(in) :: trans character, intent(in) :: trans
@ -57,8 +57,7 @@ subroutine psb_zgelp(trans,iperm,x,info)
integer(psb_ipk_), allocatable :: itemp(:) integer(psb_ipk_), allocatable :: itemp(:)
complex(psb_dpk_),parameter :: one=1 complex(psb_dpk_),parameter :: one=1
integer(psb_ipk_) :: debug_level, debug_unit integer(psb_ipk_) :: debug_level, debug_unit
character(len=20) :: name
character(len=20) :: name, ch_err
name = 'psb_zgelp' name = 'psb_zgelp'
if(psb_get_errstatus() /= 0) return if(psb_get_errstatus() /= 0) return
@ -108,8 +107,7 @@ subroutine psb_zgelp(trans,iperm,x,info)
end do end do
case default case default
info=psb_err_from_subroutine_ info=psb_err_from_subroutine_
ch_err='dgelp' call psb_errpush(info,name,a_err='zgelp')
call psb_errpush(info,name,a_err=ch_err)
end select end select
deallocate(temp,itemp) deallocate(temp,itemp)
@ -121,7 +119,7 @@ subroutine psb_zgelp(trans,iperm,x,info)
return return
end subroutine psb_zgelp end subroutine psb_m_zgelp
@ -166,14 +164,14 @@ end subroutine psb_zgelp
! iperm - integer. ! iperm - integer.
! x - real, dimension(:). ! x - real, dimension(:).
! info - integer. Return code. ! info - integer. Return code.
subroutine psb_zgelpv(trans,iperm,x,info) subroutine psb_m_zgelpv(trans,iperm,x,info)
use psb_serial_mod, psb_protect_name => psb_zgelpv use psb_serial_mod, psb_protect_name => psb_m_zgelpv
use psb_const_mod use psb_const_mod
use psb_error_mod use psb_error_mod
implicit none implicit none
complex(psb_dpk_), intent(inout) :: x(:) complex(psb_dpk_), intent(inout) :: x(:)
integer(psb_ipk_), intent(in) :: iperm(:) integer(psb_mpk_), intent(in) :: iperm(:)
integer(psb_ipk_), intent(out) :: info integer(psb_ipk_), intent(out) :: info
character, intent(in) :: trans character, intent(in) :: trans
@ -183,8 +181,7 @@ subroutine psb_zgelpv(trans,iperm,x,info)
integer(psb_ipk_), allocatable :: itemp(:) integer(psb_ipk_), allocatable :: itemp(:)
complex(psb_dpk_),parameter :: one=1 complex(psb_dpk_),parameter :: one=1
integer(psb_ipk_) :: debug_level, debug_unit integer(psb_ipk_) :: debug_level, debug_unit
character(len=20) :: name
character(len=20) :: name, ch_err
name = 'psb_zgelpv' name = 'psb_zgelpv'
if(psb_get_errstatus() /= 0) return if(psb_get_errstatus() /= 0) return
@ -229,8 +226,208 @@ subroutine psb_zgelpv(trans,iperm,x,info)
end do end do
case default case default
info=psb_err_from_subroutine_ info=psb_err_from_subroutine_
ch_err='dgelp' call psb_errpush(info,name,a_err='zgelp')
call psb_errpush(info,name,a_err=ch_err) end select
deallocate(temp,itemp)
call psb_erractionrestore(err_act)
return
9999 call psb_error_handler(err_act)
return
end subroutine psb_m_zgelpv
subroutine psb_e_zgelp(trans,iperm,x,info)
use psb_serial_mod, psb_protect_name => psb_e_zgelp
use psb_const_mod
use psb_error_mod
implicit none
complex(psb_dpk_), intent(inout) :: x(:,:)
integer(psb_epk_), intent(in) :: iperm(:)
integer(psb_ipk_), intent(out) :: info
character, intent(in) :: trans
! local variables
complex(psb_dpk_),allocatable :: temp(:)
integer(psb_ipk_) :: int_err(5), err_act
integer(psb_epk_) :: i1sz, i2sz, i, j
integer(psb_epk_), allocatable :: itemp(:)
complex(psb_dpk_),parameter :: one=1
integer(psb_ipk_) :: debug_level, debug_unit
character(len=20) :: name
name = 'psb_zgelp'
if(psb_get_errstatus() /= 0) return
info=psb_success_
call psb_erractionsave(err_act)
debug_unit = psb_get_debug_unit()
debug_level = psb_get_debug_level()
i1sz = size(x,dim=1)
i2sz = size(x,dim=2)
if (debug_level >= psb_debug_serial_)&
& write(debug_unit,*) trim(name),': size',i1sz,i2sz
allocate(temp(i1sz),itemp(size(iperm)),stat=info)
if (info /= psb_success_) then
info=2040
call psb_errpush(info,name)
goto 9999
end if
itemp(:) = iperm(:)
if (.not.psb_isaperm(i1sz,itemp)) then
info=psb_err_iarg_invalid_value_
int_err(1) = 1
call psb_errpush(info,name,i_err=int_err)
goto 9999
endif
select case( psb_toupper(trans))
case('N')
do j=1,i2sz
do i=1,i1sz
temp(i) = x(itemp(i),j)
end do
do i=1,i1sz
x(i,j) = temp(i)
end do
end do
case('T')
do j=1,i2sz
do i=1,i1sz
temp(itemp(i)) = x(i,j)
end do
do i=1,i1sz
x(i,j) = temp(i)
end do
end do
case default
info=psb_err_from_subroutine_
call psb_errpush(info,name,a_err='zgelp')
end select
deallocate(temp,itemp)
call psb_erractionrestore(err_act)
return
9999 call psb_error_handler(err_act)
return
end subroutine psb_e_zgelp
!!$
!!$ Parallel Sparse BLAS version 3.5
!!$ (C) Copyright 2006-2018
!!$ Salvatore Filippone University of Rome Tor Vergata
!!$ Alfredo Buttari University of Rome Tor Vergata
!!$
!!$ Redistribution and use in source and binary forms, with or without
!!$ modification, are permitted provided that the following conditions
!!$ are met:
!!$ 1. Redistributions of source code must retain the above copyright
!!$ notice, this list of conditions and the following disclaimer.
!!$ 2. Redistributions in binary form must reproduce the above copyright
!!$ notice, this list of conditions, and the following disclaimer in the
!!$ documentation and/or other materials provided with the distribution.
!!$ 3. The name of the PSBLAS group or the names of its contributors may
!!$ not be used to endorse or promote products derived from this
!!$ software without specific written permission.
!!$
!!$ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
!!$ ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
!!$ TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
!!$ PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE PSBLAS GROUP OR ITS CONTRIBUTORS
!!$ BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
!!$ CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
!!$ SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
!!$ INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
!!$ CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
!!$ ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
!!$ POSSIBILITY OF SUCH DAMAGE.
!!$
!!$
!
!
! Subroutine: psb_zgelpv
! Apply a left permutation to a dense matrix
!
! Arguments:
! trans - character.
! iperm - integer.
! x - real, dimension(:).
! info - integer. Return code.
subroutine psb_e_zgelpv(trans,iperm,x,info)
use psb_serial_mod, psb_protect_name => psb_e_zgelpv
use psb_const_mod
use psb_error_mod
implicit none
complex(psb_dpk_), intent(inout) :: x(:)
integer(psb_epk_), intent(in) :: iperm(:)
integer(psb_ipk_), intent(out) :: info
character, intent(in) :: trans
! local variables
integer(psb_ipk_) :: int_err(5), err_act
complex(psb_dpk_),allocatable :: temp(:)
integer(psb_epk_) :: i1sz, i
integer(psb_epk_), allocatable :: itemp(:)
integer(psb_ipk_) :: debug_level, debug_unit
character(len=20) :: name
name = 'psb_zgelp'
if(psb_get_errstatus() /= 0) return
info=psb_success_
call psb_erractionsave(err_act)
debug_unit = psb_get_debug_unit()
debug_level = psb_get_debug_level()
i1sz = min(size(x),size(iperm))
if (debug_level >= psb_debug_serial_)&
& write(debug_unit,*) trim(name),': size',i1sz
allocate(temp(i1sz),itemp(size(iperm)),stat=info)
if (info /= psb_success_) then
info=2040
call psb_errpush(info,name)
goto 9999
end if
itemp(:) = iperm(:)
if (.not.psb_isaperm(i1sz,itemp)) then
info=psb_err_iarg_invalid_value_
int_err(1) = 1
call psb_errpush(info,name,i_err=int_err)
goto 9999
endif
select case( psb_toupper(trans))
case('N')
do i=1,i1sz
temp(i) = x(itemp(i))
end do
do i=1,i1sz
x(i) = temp(i)
end do
case('T')
do i=1,i1sz
temp(itemp(i)) = x(i)
end do
do i=1,i1sz
x(i) = temp(i)
end do
case default
info=psb_err_from_subroutine_
call psb_errpush(info,name,a_err='zgelp')
end select end select
deallocate(temp,itemp) deallocate(temp,itemp)
@ -242,5 +439,5 @@ subroutine psb_zgelpv(trans,iperm,x,info)
return return
end subroutine psb_zgelpv end subroutine psb_e_zgelpv

Loading…
Cancel
Save