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

◆ pzerrdotu()

subroutine pzerrdotu ( double precision  errbnd,
integer  n,
complex*16  sclr,
complex*16, dimension( * )  x,
integer  incx,
complex*16, dimension( * )  y,
integer  incy,
double precision  prec 
)

Definition at line 3136 of file pzblas1tst.f.

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