v?Add

Performs element by element addition of vector a and vector b.

Syntax

FORTRAN:

call vsadd( n, a, b, y )

call vmsadd( n, a, b, y, mode )

call vdadd( n, a, b, y )

call vmdadd( n, a, b, y, mode )

call vcadd( n, a, b, y )

call vmcadd( n, a, b, y, mode )

call vzadd( n, a, b, y )

call vmzadd( n, a, b, y, mode )

C:

vsAdd( n, a, b, y );

vmsAdd( n, a, b, y, mode );

vdAdd( n, a, b, y );

vmdAdd( n, a, b, y, mode );

vcAdd( n, a, b, y );

vmcAdd( n, a, b, y, mode );

vzAdd( n, a, b, y );

vmzAdd( n, a, b, y, mode );

Include Files

Input Parameters

Name

Type

Description

n

FORTRAN 77: INTEGER

Fortran 90: INTEGER, INTENT(IN)

C: const int

Specifies the number of elements to be calculated.

a, b

FORTRAN 77: REAL for vsadd, vmsadd

DOUBLE PRECISION for vdadd, vmdadd

COMPLEX for vcadd, vmcadd

DOUBLE COMPLEX for vzadd, vmzadd

Fortran 90: REAL, INTENT(IN) for vsadd, vmsadd

DOUBLE PRECISION, INTENT(IN) for vdadd, vmdadd

COMPLEX, INTENT(IN) for vcadd, vmcadd

DOUBLE COMPLEX, INTENT(IN) for vzadd, vmzadd

C: const float* for vsAdd, vmsadd

const double* for vdAdd, vmdadd

const MKL_Complex8* for vcAdd, vmcadd

const MKL_Complex16* for vzAdd, vmzadd

FORTRAN: Arrays that specify the input vectors a and b.

C: Pointers to arrays that contain the input vectors a and b.

mode

FORTRAN 77: INTEGER*8

Fortran 90: INTEGER(KIND=8), INTENT(IN)

C: const MKL_INT64

Overrides global VML mode setting for this function call. See vmlSetMode for possible values and their description.

Output Parameters

Name

Type

Description

y

FORTRAN 77: REAL for vsadd, vmsadd

DOUBLE PRECISION for vdadd, vmdadd

COMPLEX, for vcadd, vmcadd

DOUBLE COMPLEX for vzadd, vmzadd

Fortran 90: REAL, INTENT(OUT) for vsadd, vmsadd

DOUBLE PRECISION, INTENT(OUT) for vdadd, vmdadd

COMPLEX, INTENT(OUT) for vcadd, vmcadd

DOUBLE COMPLEX, INTENT(OUT) for vzadd, vmzadd

C: float* for vsAdd, vmsadd

double* for vdAdd, vmdadd

MKL_Complex8* for vcAdd, vmcadd

MKL_Complex16* for vzAdd, vmzadd

FORTRAN: Array that specifies the output vector y.

C: Pointer to an array that contains the output vector y.

Description

The v?Add function performs element by element addition of vector a and vector b.

Special values for Real Function v?Add(x)
Argument 1 Argument 2 Result Exception
+0 +0 +0  
+0 -0 +0  
-0 +0 +0  
-0 -0 -0  
+ + +  
+ - QNAN INVALID
- + QNAN INVALID
- - -  
SNAN any value QNAN INVALID
any value SNAN QNAN INVALID
QNAN non-SNAN QNAN  
non-SNAN QNAN QNAN  

Specifications for special values of the complex functions are defined according to the following formula

Add(x1+i*y1,x2+i*y2) = (x1+x2) + i*(y1+y2)

Overflow in a complex function occurs (supported in the HA/LA accuracy modes only) when x1, x2, y1, y2 are finite numbers, but the real or imaginary part of the exact result is so large that it does not fit the target precision. In this case, the function returns in that part of the result, raises the OVERFLOW exception, and sets the VML Error Status to VML_STATUS_OVERFLOW.


Submit feedback on this help topic