SCALAPACK 2.2.2
LAPACK: Linear Algebra PACKage
Loading...
Searching...
No Matches

◆ pserrdot()

subroutine pserrdot ( real  errbnd,
integer  n,
real  sclr,
real, dimension( * )  x,
integer  incx,
real, dimension( * )  y,
integer  incy,
real  prec 
)

Definition at line 2932 of file psblas1tst.f.

2933*
2934* -- PBLAS test routine (version 2.0) --
2935* University of Tennessee, Knoxville, Oak Ridge National Laboratory,
2936* and University of California, Berkeley.
2937* April 1, 1998
2938*
2939* .. Scalar Arguments ..
2940 INTEGER INCX, INCY, N
2941 REAL ERRBND, PREC, SCLR
2942* ..
2943* .. Array Arguments ..
2944 REAL X( * ), Y( * )
2945* ..
2946*
2947* Purpose
2948* =======
2949*
2950* PSERRDOT serially computes the dot product X**T * Y and returns a
2951* scaled relative acceptable error bound on the result.
2952*
2953* Notes
2954* =====
2955*
2956* If dot1 = SCLR and dot2 are two different computed results, and dot1
2957* is being assumed to be correct, we require
2958*
2959* abs( dot1 - dot2 ) <= ERRBND = ERRFACT * abs( dot1 ),
2960*
2961* where ERRFACT is computed as the maximum of the positive and negative
2962* partial sums multiplied by a constant proportional to the machine
2963* precision.
2964*
2965* Arguments
2966* =========
2967*
2968* ERRBND (global output) REAL
2969* On exit, ERRBND specifies the scaled relative acceptable er-
2970* ror bound.
2971*
2972* N (global input) INTEGER
2973* On entry, N specifies the length of the vector operands.
2974*
2975* SCLR (global output) REAL
2976* On exit, SCLR specifies the dot product of the two vectors
2977* X and Y.
2978*
2979* X (global input) REAL array
2980* On entry, X is an array of dimension at least
2981* ( 1 + ( n - 1 )*abs( INCX ) ). Before entry, the incremen-
2982* ted array X must contain the vector x.
2983*
2984* INCX (global input) INTEGER.
2985* On entry, INCX specifies the increment for the elements of X.
2986* INCX must not be zero.
2987*
2988* Y (global input) REAL array
2989* On entry, Y is an array of dimension at least
2990* ( 1 + ( n - 1 )*abs( INCY ) ). Before entry, the incremen-
2991* ted array Y must contain the vector y.
2992*
2993* INCY (global input) INTEGER.
2994* On entry, INCY specifies the increment for the elements of Y.
2995* INCY must not be zero.
2996*
2997* PREC (global input) REAL
2998* On entry, PREC specifies the machine precision.
2999*
3000* -- Written on April 1, 1998 by
3001* Antoine Petitet, University of Tennessee, Knoxville 37996, USA.
3002*
3003* =====================================================================
3004*
3005* .. Parameters ..
3006 REAL ONE, TWO, ZERO
3007 parameter( one = 1.0e+0, two = 2.0e+0,
3008 $ zero = 0.0e+0 )
3009* ..
3010* .. Local Scalars ..
3011 INTEGER I, IX, IY
3012 REAL ADDBND, FACT, SUMNEG, SUMPOS, TMP
3013* ..
3014* .. Intrinsic Functions ..
3015 INTRINSIC abs, max
3016* ..
3017* .. Executable Statements ..
3018*
3019 ix = 1
3020 iy = 1
3021 sclr = zero
3022 sumpos = zero
3023 sumneg = zero
3024 fact = two * ( one + prec )
3025 addbnd = two * two * two * prec
3026*
3027 DO 10 i = 1, n
3028 tmp = x( ix ) * y( iy )
3029 sclr = sclr + tmp
3030 IF( tmp.GE.zero ) THEN
3031 sumpos = sumpos + tmp * fact
3032 ELSE
3033 sumneg = sumneg - tmp * fact
3034 END IF
3035 ix = ix + incx
3036 iy = iy + incy
3037 10 CONTINUE
3038*
3039 errbnd = addbnd * max( sumpos, sumneg )
3040*
3041 RETURN
3042*
3043* End of PSERRDOT
3044*
#define max(A, B)
Definition pcgemr.c:180
Here is the caller graph for this function: