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

◆ pcerrdotc()

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

Definition at line 3281 of file pcblas1tst.f.

3282*
3283* -- PBLAS test routine (version 2.0) --
3284* University of Tennessee, Knoxville, Oak Ridge National Laboratory,
3285* and University of California, Berkeley.
3286* April 1, 1998
3287*
3288* .. Scalar Arguments ..
3289 INTEGER INCX, INCY, N
3290 REAL ERRBND, PREC
3291 COMPLEX SCLR
3292* ..
3293* .. Array Arguments ..
3294 COMPLEX X( * ), Y( * )
3295* ..
3296*
3297* Purpose
3298* =======
3299*
3300* PCERRDOTC serially computes the dot product X**H * Y and returns a
3301* scaled relative acceptable error bound on the result.
3302*
3303* Notes
3304* =====
3305*
3306* If dot1 = SCLR and dot2 are two different computed results, and dot1
3307* is being assumed to be correct, we require
3308*
3309* abs( dot1 - dot2 ) <= ERRBND = ERRFACT * abs( dot1 ),
3310*
3311* where ERRFACT is computed as the maximum of the positive and negative
3312* partial sums multiplied by a constant proportional to the machine
3313* precision.
3314*
3315* Arguments
3316* =========
3317*
3318* ERRBND (global output) REAL
3319* On exit, ERRBND specifies the scaled relative acceptable er-
3320* ror bound.
3321*
3322* N (global input) INTEGER
3323* On entry, N specifies the length of the vector operands.
3324*
3325* SCLR (global output) COMPLEX
3326* On exit, SCLR specifies the dot product of the two vectors
3327* X and Y.
3328*
3329* X (global input) COMPLEX array
3330* On entry, X is an array of dimension at least
3331* ( 1 + ( n - 1 )*abs( INCX ) ). Before entry, the incremen-
3332* ted array X must contain the vector x.
3333*
3334* INCX (global input) INTEGER.
3335* On entry, INCX specifies the increment for the elements of X.
3336* INCX must not be zero.
3337*
3338* Y (global input) COMPLEX array
3339* On entry, Y is an array of dimension at least
3340* ( 1 + ( n - 1 )*abs( INCY ) ). Before entry, the incremen-
3341* ted array Y must contain the vector y.
3342*
3343* INCY (global input) INTEGER.
3344* On entry, INCY specifies the increment for the elements of Y.
3345* INCY must not be zero.
3346*
3347* PREC (global input) REAL
3348* On entry, PREC specifies the machine precision.
3349*
3350* -- Written on April 1, 1998 by
3351* Antoine Petitet, University of Tennessee, Knoxville 37996, USA.
3352*
3353* =====================================================================
3354*
3355* .. Parameters ..
3356 REAL ONE, TWO, ZERO
3357 parameter( one = 1.0e+0, two = 2.0e+0,
3358 $ zero = 0.0e+0 )
3359* ..
3360* .. Local Scalars ..
3361 INTEGER I, IX, IY
3362 REAL ADDBND, FACT, SUMINEG, SUMIPOS, SUMRNEG,
3363 $ SUMRPOS, TMP
3364* ..
3365* .. Intrinsic Functions ..
3366 INTRINSIC abs, aimag, conjg, max, real
3367* ..
3368* .. Executable Statements ..
3369*
3370 ix = 1
3371 iy = 1
3372 sclr = zero
3373 sumipos = zero
3374 sumineg = zero
3375 sumrpos = zero
3376 sumrneg = zero
3377 fact = two * ( one + prec )
3378 addbnd = two * two * two * prec
3379*
3380 DO 10 i = 1, n
3381*
3382 sclr = sclr + conjg( x( ix ) ) * y( iy )
3383*
3384 tmp = real( x( ix ) ) * real( y( iy ) )
3385 IF( tmp.GE.zero ) THEN
3386 sumrpos = sumrpos + tmp * fact
3387 ELSE
3388 sumrneg = sumrneg - tmp * fact
3389 END IF
3390*
3391 tmp = aimag( x( ix ) ) * aimag( y( iy ) )
3392 IF( tmp.GE.zero ) THEN
3393 sumrpos = sumrpos + tmp * fact
3394 ELSE
3395 sumrneg = sumrneg - tmp * fact
3396 END IF
3397*
3398 tmp = - aimag( x( ix ) ) * real( y( iy ) )
3399 IF( tmp.GE.zero ) THEN
3400 sumipos = sumipos + tmp * fact
3401 ELSE
3402 sumineg = sumineg - tmp * fact
3403 END IF
3404*
3405 tmp = real( x( ix ) ) * aimag( y( iy ) )
3406 IF( tmp.GE.zero ) THEN
3407 sumipos = sumipos + tmp * fact
3408 ELSE
3409 sumineg = sumineg - tmp * fact
3410 END IF
3411*
3412 ix = ix + incx
3413 iy = iy + incy
3414*
3415 10 CONTINUE
3416*
3417 errbnd = addbnd * max( max( sumrpos, sumrneg ),
3418 $ max( sumipos, sumineg ) )
3419*
3420 RETURN
3421*
3422* End of PCERRDOTC
3423*
#define max(A, B)
Definition pcgemr.c:180
Here is the caller graph for this function: