From c0bbff11bd8f4a2b1f13b6b2be4b769fd4fcefc2 Mon Sep 17 00:00:00 2001 From: Salvatore Filippone Date: Tue, 21 Feb 2012 14:37:11 +0000 Subject: [PATCH] psblas3: base/modules/psb_d_mat_mod.f90 base/modules/psb_serial_mod.f90 Added minreal in psb_Serial_mod for use in aggrmat. --- base/modules/psb_d_mat_mod.f90 | 2 +- base/modules/psb_serial_mod.f90 | 28 ++++++++++++++++++++++++++++ 2 files changed, 29 insertions(+), 1 deletion(-) diff --git a/base/modules/psb_d_mat_mod.f90 b/base/modules/psb_d_mat_mod.f90 index b2ac7bb4..b6276558 100644 --- a/base/modules/psb_d_mat_mod.f90 +++ b/base/modules/psb_d_mat_mod.f90 @@ -44,7 +44,7 @@ ! the functionalities to have the encapsulated class change its ! type dynamically, and to extract/input an inner object. ! -! A sparse matric has a state corresponding to its progression +! A sparse matrix has a state corresponding to its progression ! through the application life. ! In particular, computational methods can only be invoked when ! the matrix is in the ASSEMBLED state, whereas the other states are diff --git a/base/modules/psb_serial_mod.f90 b/base/modules/psb_serial_mod.f90 index cec82b12..2d7776c4 100644 --- a/base/modules/psb_serial_mod.f90 +++ b/base/modules/psb_serial_mod.f90 @@ -44,6 +44,10 @@ module psb_serial_mod module procedure psb_snrm1, psb_dnrm1, psb_cnrm1, psb_znrm1 end interface psb_nrm1 + interface psb_minreal + module procedure psb_sminreal, psb_dminreal, psb_cminreal, psb_zminreal + end interface psb_minreal + interface psb_amax function psb_samax_s(n, x) result(val) import :: psb_ipk_, psb_spk_, psb_dpk_ @@ -561,6 +565,30 @@ contains res = abs( real( x ) ) + abs( aimag( x ) ) end function psb_znrm1 + elemental function psb_sminreal(x) result(res) + real(psb_spk_), intent(in) :: x + real(psb_spk_) :: res + res = ( x ) + end function psb_sminreal + + elemental function psb_dminreal(x) result(res) + real(psb_dpk_), intent(in) :: x + real(psb_dpk_) :: res + res = ( x ) + end function psb_dminreal + + elemental function psb_cminreal(x) result(res) + complex(psb_spk_), intent(in) :: x + real(psb_spk_) :: res + res = min( real( x ) , aimag( x ) ) + end function psb_cminreal + + elemental function psb_zminreal(x) result(res) + complex(psb_dpk_), intent(in) :: x + real(psb_dpk_) :: res + res = min( real( x ) , aimag( x ) ) + end function psb_zminreal + subroutine crot( n, cx, incx, cy, incy, c, s ) !