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

◆ pzerrdotc()

subroutine pzerrdotc ( 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 3280 of file pzblas1tst.f.

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