F16EAF (BLAS_DDOT) (PDF version)
F16 Chapter Contents
F16 Chapter Introduction
NAG Library Manual

NAG Library Routine Document

F16EAF (BLAS_DDOT)

Note:  before using this routine, please read the Users' Note for your implementation to check the interpretation of bold italicised terms and other implementation-dependent details.

 Contents

    1  Purpose
    7  Accuracy

1  Purpose

F16EAF (BLAS_DDOT) updates a scalar by a scaled dot product of two real vectors.

2  Specification

SUBROUTINE F16EAF ( CONJ, N, ALPHA, X, INCX, BETA, Y, INCY, R)
INTEGER  CONJ, N, INCX, INCY
REAL (KIND=nag_wp)  ALPHA, X(1+(N-1)*ABS(INCX)), BETA, Y(1+(N-1)*ABS(INCY)), R
The routine may be called by its BLAST name blas_ddot.

3  Description

F16EAF (BLAS_DDOT) performs the operation
r βr+ αxTy  
where x and y are n-element real vectors, and r, α and β real scalars. If n is less than zero, or, if β is equal to one and either α or n is equal to zero, this routine returns immediately.

4  References

Basic Linear Algebra Subprograms Technical (BLAST) Forum (2001) Basic Linear Algebra Subprograms Technical (BLAST) Forum Standard University of Tennessee, Knoxville, Tennessee http://www.netlib.org/blas/blast-forum/blas-report.pdf

5  Parameters

1:     CONJ – INTEGERInput
On entry: CONJ is not referenced and need not be set. The presence of this parameter in the BLAST standard is for consistency with the interface of the complex variant of this routine.
2:     N – INTEGERInput
On entry: n, the number of elements in x and y.
3:     ALPHA – REAL (KIND=nag_wp)Input
On entry: the scalar α.
4:     X1+N-1×INCX – REAL (KIND=nag_wp) arrayInput
On entry: the n-element vector x.
If INCX>0, xi must be stored in Xi-1×INCX+1, for i=1,2,,N.
If INCX<0, xi must be stored in XN-i×INCX+1, for i=1,2,,N.
Intermediate elements of X are not referenced. If α=0.0 or N=0, X is not referenced.
5:     INCX – INTEGERInput
On entry: the increment in the subscripts of X between successive elements of x.
Constraint: INCX0.
6:     BETA – REAL (KIND=nag_wp)Input
On entry: the scalar β.
7:     Y1+N-1×INCY – REAL (KIND=nag_wp) arrayInput
On entry: the n-element vector y.
If INCY>0, yi must be stored in Yi-1×INCY+1, for i=1,2,,N.
If INCY<0, yi must be stored in YN-i×INCY+1, for i=1,2,,N.
Intermediate elements of Y are not referenced. If α=0.0 or N=0, Y is not referenced.
8:     INCY – INTEGERInput
On entry: the increment in the subscripts of Y between successive elements of y.
Constraint: INCY0.
9:     R – REAL (KIND=nag_wp)Input/Output
On entry: the initial value, r, to be updated. If β=0.0, R need not be set on entry.
On exit: the value r, scaled by β and updated by the scaled dot product of x and y.

6  Error Indicators and Warnings

If INCX=0 or INCY=0, an error message is printed and program execution is terminated.

7  Accuracy

The dot product xTy  is computed using the BLAS routine DDOT.
The BLAS standard requires accurate implementations which avoid unnecessary over/underflow (see Section 2.7 of Basic Linear Algebra Subprograms Technical (BLAST) Forum (2001)).

8  Parallelism and Performance

Not applicable.

9  Further Comments

None.

10  Example

This example computes the scaled sum of two dot products, r= α1 xTy+ α2 uTv , where
α1=0.3 ,  x= 1,2,3,4,5 ,  y= -5,-4,3,2,1 ,  α2 = -7.0 ,  u=v= 0.4,0.3,0.2,0.1 .  
y and v are stored in reverse order, and u is stored in reverse order in every other element of a real array.

10.1  Program Text

Program Text (f16eafe.f90)

10.2  Program Data

Program Data (f16eafe.d)

10.3  Program Results

Program Results (f16eafe.r)


F16EAF (BLAS_DDOT) (PDF version)
F16 Chapter Contents
F16 Chapter Introduction
NAG Library Manual

© The Numerical Algorithms Group Ltd, Oxford, UK. 2015