base/modules/psb_base_linmap_mod.f90
 base/modules/psb_c_linmap_mod.f90
 base/modules/psb_d_linmap_mod.f90
 base/modules/psb_s_linmap_mod.f90
 base/modules/psb_z_linmap_mod.f90

Defined and fixed clone method.
psblas3-final
Salvatore Filippone 12 years ago
parent 081222feeb
commit a50ce17bcb

@ -52,6 +52,7 @@ module psb_base_linmap_mod
procedure, pass(map) :: get_kind => base_get_kind procedure, pass(map) :: get_kind => base_get_kind
procedure, pass(map) :: set_kind => base_set_kind procedure, pass(map) :: set_kind => base_set_kind
procedure, pass(map) :: free => base_free procedure, pass(map) :: free => base_free
procedure, pass(map) :: clone => base_clone
end type psb_base_linmap_type end type psb_base_linmap_type
@ -60,7 +61,7 @@ module psb_base_linmap_mod
end interface end interface
private :: base_map_sizeof, base_is_ok, base_is_asb,& private :: base_map_sizeof, base_is_ok, base_is_asb,&
& base_get_kind, base_set_kind, base_free & base_get_kind, base_set_kind, base_free, base_clone
contains contains
@ -155,6 +156,26 @@ contains
end subroutine psb_base_linmap_transfer end subroutine psb_base_linmap_transfer
subroutine base_clone(map,mapout,info)
use psb_desc_mod
implicit none
class(psb_base_linmap_type), intent(inout) :: map
class(psb_base_linmap_type), intent(out) :: mapout
integer(psb_ipk_) :: info
mapout%kind = map%kind
call psb_safe_ab_copy(map%iaggr,mapout%iaggr,info)
call psb_safe_ab_copy(map%naggr,mapout%naggr,info)
mapout%p_desc_X => map%p_desc_X
mapout%p_desc_Y => map%p_desc_Y
call map%desc_X%clone(mapout%desc_X,info)
call map%desc_Y%clone(mapout%desc_Y,info)
end subroutine base_clone
subroutine base_free(map,info) subroutine base_free(map,info)
implicit none implicit none
class(psb_base_linmap_type) :: map class(psb_base_linmap_type) :: map

@ -46,10 +46,10 @@ module psb_c_linmap_mod
type, extends(psb_base_linmap_type) :: psb_clinmap_type type, extends(psb_base_linmap_type) :: psb_clinmap_type
type(psb_cspmat_type) :: map_X2Y, map_Y2X type(psb_cspmat_type) :: map_X2Y, map_Y2X
contains contains
procedure, pass(map) :: sizeof => c_map_sizeof procedure, pass(map) :: sizeof => c_map_sizeof
procedure, pass(map) :: is_asb => c_is_asb procedure, pass(map) :: is_asb => c_is_asb
procedure, pass(map) :: free => c_free procedure, pass(map) :: free => c_free
procedure, pass(mapin) :: clone => c_clone procedure, pass(map) :: clone => c_clone
end type psb_clinmap_type end type psb_clinmap_type
@ -214,16 +214,17 @@ contains
end subroutine c_free end subroutine c_free
subroutine c_clone(mapin,mapout) subroutine c_clone(map,mapout,info)
use psb_desc_mod use psb_desc_mod
implicit none implicit none
class(psb_clinmap_type), intent(inout) :: mapin class(psb_clinmap_type), intent(inout) :: map
class(psb_clinmap_type), intent(out) :: mapout class(psb_clinmap_type), intent(out) :: mapout
integer(psb_ipk_) :: info integer(psb_ipk_) :: info
! Base clone! ! Base clone!
call mapin%map_X2Y%clone(mapout%map_X2Y,info) call map%psb_base_linmap_type%clone(mapout%psb_base_linmap_type,info)
call mapin%map_Y2X%clone(mapout%map_Y2X,info) call map%map_X2Y%clone(mapout%map_X2Y,info)
call map%map_Y2X%clone(mapout%map_Y2X,info)
end subroutine c_clone end subroutine c_clone

@ -46,10 +46,10 @@ module psb_d_linmap_mod
type, extends(psb_base_linmap_type) :: psb_dlinmap_type type, extends(psb_base_linmap_type) :: psb_dlinmap_type
type(psb_dspmat_type) :: map_X2Y, map_Y2X type(psb_dspmat_type) :: map_X2Y, map_Y2X
contains contains
procedure, pass(map) :: sizeof => d_map_sizeof procedure, pass(map) :: sizeof => d_map_sizeof
procedure, pass(map) :: is_asb => d_is_asb procedure, pass(map) :: is_asb => d_is_asb
procedure, pass(map) :: free => d_free procedure, pass(map) :: free => d_free
procedure, pass(mapin) :: clone => d_clone procedure, pass(map) :: clone => d_clone
end type psb_dlinmap_type end type psb_dlinmap_type
@ -214,16 +214,17 @@ contains
end subroutine d_free end subroutine d_free
subroutine d_clone(mapin,mapout) subroutine d_clone(map,mapout,info)
use psb_desc_mod use psb_desc_mod
implicit none implicit none
class(psb_dlinmap_type), intent(inout) :: mapin class(psb_dlinmap_type), intent(inout) :: map
class(psb_dlinmap_type), intent(out) :: mapout class(psb_dlinmap_type), intent(out) :: mapout
integer(psb_ipk_) :: info integer(psb_ipk_) :: info
! Base clone! ! Base clone!
call mapin%map_X2Y%clone(mapout%map_X2Y,info) call map%psb_base_linmap_type%clone(mapout%psb_base_linmap_type,info)
call mapin%map_Y2X%clone(mapout%map_Y2X,info) call map%map_X2Y%clone(mapout%map_X2Y,info)
call map%map_Y2X%clone(mapout%map_Y2X,info)
end subroutine d_clone end subroutine d_clone

@ -46,10 +46,10 @@ module psb_s_linmap_mod
type, extends(psb_base_linmap_type) :: psb_slinmap_type type, extends(psb_base_linmap_type) :: psb_slinmap_type
type(psb_sspmat_type) :: map_X2Y, map_Y2X type(psb_sspmat_type) :: map_X2Y, map_Y2X
contains contains
procedure, pass(map) :: sizeof => s_map_sizeof procedure, pass(map) :: sizeof => s_map_sizeof
procedure, pass(map) :: is_asb => s_is_asb procedure, pass(map) :: is_asb => s_is_asb
procedure, pass(map) :: free => s_free procedure, pass(map) :: free => s_free
procedure, pass(mapin) :: clone => s_clone procedure, pass(map) :: clone => s_clone
end type psb_slinmap_type end type psb_slinmap_type
@ -214,16 +214,17 @@ contains
end subroutine s_free end subroutine s_free
subroutine s_clone(mapin,mapout) subroutine s_clone(map,mapout,info)
use psb_desc_mod use psb_desc_mod
implicit none implicit none
class(psb_slinmap_type), intent(inout) :: mapin class(psb_slinmap_type), intent(inout) :: map
class(psb_slinmap_type), intent(out) :: mapout class(psb_slinmap_type), intent(out) :: mapout
integer(psb_ipk_) :: info integer(psb_ipk_) :: info
! Base clone! ! Base clone!
call mapin%map_X2Y%clone(mapout%map_X2Y,info) call map%psb_base_linmap_type%clone(mapout%psb_base_linmap_type,info)
call mapin%map_Y2X%clone(mapout%map_Y2X,info) call map%map_X2Y%clone(mapout%map_X2Y,info)
call map%map_Y2X%clone(mapout%map_Y2X,info)
end subroutine s_clone end subroutine s_clone

@ -46,10 +46,10 @@ module psb_z_linmap_mod
type, extends(psb_base_linmap_type) :: psb_zlinmap_type type, extends(psb_base_linmap_type) :: psb_zlinmap_type
type(psb_zspmat_type) :: map_X2Y, map_Y2X type(psb_zspmat_type) :: map_X2Y, map_Y2X
contains contains
procedure, pass(map) :: sizeof => z_map_sizeof procedure, pass(map) :: sizeof => z_map_sizeof
procedure, pass(map) :: is_asb => z_is_asb procedure, pass(map) :: is_asb => z_is_asb
procedure, pass(map) :: free => z_free procedure, pass(map) :: free => z_free
procedure, pass(mapin) :: clone => z_clone procedure, pass(map) :: clone => z_clone
end type psb_zlinmap_type end type psb_zlinmap_type
@ -214,16 +214,17 @@ contains
end subroutine z_free end subroutine z_free
subroutine z_clone(mapin,mapout) subroutine z_clone(map,mapout,info)
use psb_desc_mod use psb_desc_mod
implicit none implicit none
class(psb_zlinmap_type), intent(inout) :: mapin class(psb_zlinmap_type), intent(inout) :: map
class(psb_zlinmap_type), intent(out) :: mapout class(psb_zlinmap_type), intent(out) :: mapout
integer(psb_ipk_) :: info integer(psb_ipk_) :: info
! Base clone! ! Base clone!
call mapin%map_X2Y%clone(mapout%map_X2Y,info) call map%psb_base_linmap_type%clone(mapout%psb_base_linmap_type,info)
call mapin%map_Y2X%clone(mapout%map_Y2X,info) call map%map_X2Y%clone(mapout%map_X2Y,info)
call map%map_Y2X%clone(mapout%map_Y2X,info)
end subroutine z_clone end subroutine z_clone

Loading…
Cancel
Save