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

◆ pcerrdotu()

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

Definition at line 3137 of file pcblas1tst.f.

3138*
3139* -- PBLAS test routine (version 2.0) --
3140* University of Tennessee, Knoxville, Oak Ridge National Laboratory,
3141* and University of California, Berkeley.
3142* April 1, 1998
3143*
3144* .. Scalar Arguments ..
3145 INTEGER INCX, INCY, N
3146 REAL ERRBND, PREC
3147 COMPLEX SCLR
3148* ..
3149* .. Array Arguments ..
3150 COMPLEX X( * ), Y( * )
3151* ..
3152*
3153* Purpose
3154* =======
3155*
3156* PCERRDOTU serially computes the dot product X**T * Y and returns a
3157* scaled relative acceptable error bound on the result.
3158*
3159* Notes
3160* =====
3161*
3162* If dot1 = SCLR and dot2 are two different computed results, and dot1
3163* is being assumed to be correct, we require
3164*
3165* abs( dot1 - dot2 ) <= ERRBND = ERRFACT * abs( dot1 ),
3166*
3167* where ERRFACT is computed as the maximum of the positive and negative
3168* partial sums multiplied by a constant proportional to the machine
3169* precision.
3170*
3171* Arguments
3172* =========
3173*
3174* ERRBND (global output) REAL
3175* On exit, ERRBND specifies the scaled relative acceptable er-
3176* ror bound.
3177*
3178* N (global input) INTEGER
3179* On entry, N specifies the length of the vector operands.
3180*
3181* SCLR (global output) COMPLEX
3182* On exit, SCLR specifies the dot product of the two vectors
3183* X and Y.
3184*
3185* X (global input) COMPLEX array
3186* On entry, X is an array of dimension at least
3187* ( 1 + ( n - 1 )*abs( INCX ) ). Before entry, the incremen-
3188* ted array X must contain the vector x.
3189*
3190* INCX (global input) INTEGER.
3191* On entry, INCX specifies the increment for the elements of X.
3192* INCX must not be zero.
3193*
3194* Y (global input) COMPLEX array
3195* On entry, Y is an array of dimension at least
3196* ( 1 + ( n - 1 )*abs( INCY ) ). Before entry, the incremen-
3197* ted array Y must contain the vector y.
3198*
3199* INCY (global input) INTEGER.
3200* On entry, INCY specifies the increment for the elements of Y.
3201* INCY must not be zero.
3202*
3203* PREC (global input) REAL
3204* On entry, PREC specifies the machine precision.
3205*
3206* -- Written on April 1, 1998 by
3207* Antoine Petitet, University of Tennessee, Knoxville 37996, USA.
3208*
3209* =====================================================================
3210*
3211* .. Parameters ..
3212 REAL ONE, TWO, ZERO
3213 parameter( one = 1.0e+0, two = 2.0e+0,
3214 $ zero = 0.0e+0 )
3215* ..
3216* .. Local Scalars ..
3217 INTEGER I, IX, IY
3218 REAL ADDBND, FACT, SUMINEG, SUMIPOS, SUMRNEG,
3219 $ SUMRPOS, TMP
3220* ..
3221* .. Intrinsic Functions ..
3222 INTRINSIC abs, aimag, max, real
3223* ..
3224* .. Executable Statements ..
3225*
3226 ix = 1
3227 iy = 1
3228 sclr = zero
3229 sumipos = zero
3230 sumineg = zero
3231 sumrpos = zero
3232 sumrneg = zero
3233 fact = two * ( one + prec )
3234 addbnd = two * two * two * prec
3235*
3236 DO 10 i = 1, n
3237*
3238 sclr = sclr + x( ix ) * y( iy )
3239*
3240 tmp = real( x( ix ) ) * real( y( iy ) )
3241 IF( tmp.GE.zero ) THEN
3242 sumrpos = sumrpos + tmp * fact
3243 ELSE
3244 sumrneg = sumrneg - tmp * fact
3245 END IF
3246*
3247 tmp = - aimag( x( ix ) ) * aimag( y( iy ) )
3248 IF( tmp.GE.zero ) THEN
3249 sumrpos = sumrpos + tmp * fact
3250 ELSE
3251 sumrneg = sumrneg - tmp * fact
3252 END IF
3253*
3254 tmp = aimag( x( ix ) ) * real( y( iy ) )
3255 IF( tmp.GE.zero ) THEN
3256 sumipos = sumipos + tmp * fact
3257 ELSE
3258 sumineg = sumineg - tmp * fact
3259 END IF
3260*
3261 tmp = real( x( ix ) ) * aimag( y( iy ) )
3262 IF( tmp.GE.zero ) THEN
3263 sumipos = sumipos + tmp * fact
3264 ELSE
3265 sumineg = sumineg - tmp * fact
3266 END IF
3267*
3268 ix = ix + incx
3269 iy = iy + incy
3270*
3271 10 CONTINUE
3272*
3273 errbnd = addbnd * max( max( sumrpos, sumrneg ),
3274 $ max( sumipos, sumineg ) )
3275*
3276 RETURN
3277*
3278* End of PCERRDOTU
3279*
#define max(A, B)
Definition pcgemr.c:180
Here is the caller graph for this function: