 |
OpenVMS VAX RTL Mathematics (MTH$) Manual
where:
y
|
=
|
array specified in
y
|
i
|
=
|
element of the vector y
|
incy
|
=
|
increment argument for the array
y specified in
incy
|
If incy is less than 0, then y is referenced backward
in array y; that is, (y[i]) is is referenced in:
where:
y
|
=
|
array specified in
y
|
n
|
=
|
number of vector elements specified in
n
|
i
|
=
|
element of the vector y
|
incy
|
=
|
increment argument for the array
y specified in
incy
|
Description
BLAS1$VxAXPY multiplies a vector x by a scalar, adds to a vector y ,
and stores the result in the vector y . This is expressed as follows:
where a is a scalar number and x and y are real or
complex single-precision or double-precision (D and G)
n-element vectors. The vectors can be rows or columns of a
matrix. Both forward and backward indexing are permitted. Vectors x and
y contain n elements that are accessed from arrays
x and y by stepping
incx and incy elements at a time.
The routine name determines the data type you should specify for
arguments a, x, and
y. Specify the same data type for each of these
arguments.
The algorithm does not provide a special case for incx
= 0. Therefore, specifying 0 for incx has the effect
of adding the constant a*x[1] to all elements of the vector y using
vector operations.
Example
|
C
C To compute y=y+2.0*x using SAXPY:
C
INTEGER N,INCX,INCY
REAL X(20), Y(20),A
INCX = 1
INCY = 1
A = 2.0
N = 20
CALL BLAS1$VSAXPY(N,A,X,INCX,Y,INCY)
|
BLAS1$VxCOPY
The Copy a Vector routine copies n elements of the vector x to
the vector y .
Format
BLAS1$VSCOPY n ,x ,incx ,y ,incy
BLAS1$VDCOPY n ,x ,incx ,y ,incy
BLAS1$VCCOPY n ,x ,incx ,y ,incy
BLAS1$VZCOPY n ,x ,incx ,y ,incy
Use BLAS1$VSCOPY for single-precision real operations. Use
BLAS1$VDCOPY for double-precision real (D or G) operations. Use
BLAS1$VCCOPY for single-precision complex operations. Use
BLAS1$VZCOPY for double-precision complex (D or G) operations.
RETURNS
None.
Arguments
n
OpenVMS usage: |
longword_signed |
type: |
longword integer (signed) |
access: |
read only |
mechanism: |
by reference |
Number of elements in vector x to be copied. The n
argument is the address of a signed longword integer containing the
number of elements in vector x . If n is less than or
equal to 0, then y is unchanged.
x
OpenVMS usage: |
floating_point or complex_number |
type: |
F_floating, D_floating, G_floating real or F_floating,
D_floating, G_floating complex |
access: |
read only |
mechanism: |
by reference, array reference |
Array containing the elements to be accessed. All elements of array
x are accessed only if the increment argument of
x, called incx, is 1. The
x argument is the address of a floating-point or
floating-point complex number that is this array. This argument is an
array of length at least:
where:
n
|
=
|
number of vector elements specified in
n
|
incx
|
=
|
increment argument for the array
x specified in
incx
|
Specify the data type as follows:
Routine |
Data Type for x |
BLAS1$VSCOPY
|
F-floating real
|
BLAS1$VDCOPY
|
D-floating or G-floating real
|
BLAS1$VCCOPY
|
F-floating complex
|
BLAS1$VZCOPY
|
D-floating or G-floating complex
|
incx
OpenVMS usage: |
longword_signed |
type: |
longword integer (signed) |
access: |
read only |
mechanism: |
by reference |
Increment argument for the array x. The
incx argument is the address of a signed longword
integer containing the increment argument. If incx is
greater than or equal to 0, then x is referenced forward in array
x; that is, x[i] is referenced in:
where:
x
|
=
|
array specified in
x
|
i
|
=
|
element of the vector x
|
incx
|
=
|
increment argument for the array
x specified in
incx
|
If incx is less than 0, then x is referenced backward
in array x; that is, x[i] is referenced in:
where:
x
|
=
|
array specified in
x
|
n
|
=
|
number of vector elements specified in
n
|
i
|
=
|
element of the vector x
|
incx
|
=
|
increment argument for the array
x specified in
incx
|
y
OpenVMS usage: |
floating_point or complex_number |
type: |
F_floating, D_floating, G_floating real or F_floating,
D_floating, G_floating complex |
access: |
write only |
mechanism: |
by reference, array reference |
Array that receives the copied elements. All elements of array
y receive the copied elements only if the increment
argument of y, called incy, is 1. The
y argument is the address of a floating-point or
floating-point complex number that is this array. This argument is an
array of length at least:
where:
n
|
=
|
number of vector elements specified in
n
|
incy
|
=
|
increment argument for the array
y specified in
incy
|
Specify the data type as follows:
Routine |
Data Type for y |
BLAS1$VSCOPY
|
F-floating real
|
BLAS1$VDCOPY
|
D-floating or G-floating real
|
BLAS1$VCCOPY
|
F-floating complex
|
BLAS1$VZCOPY
|
D-floating or G-floating complex
|
If n is less than or equal to 0, then
y is unchanged. If incx is equal to
0, then each y[i] is set to x[1] . If incy is equal to
0, then y[i] is set to the last referenced element of x . If any
element of x shares a memory location with an element of y , the
results are unpredictable. (See the Description section for a special
case that does not cause unpredictable results when the same memory
location is shared by input and output.)
incy
OpenVMS usage: |
longword_signed |
type: |
longword integer (signed) |
access: |
read only |
mechanism: |
by reference |
Increment argument for the array y. The
incy argument is the address of a signed longword
integer containing the increment argument. If incy is
greater than or equal to 0, then y is referenced forward in array
y; that is, y[i] is referenced in:
where:
y
|
=
|
array specified in
y
|
i
|
=
|
element of the vector y
|
If incy is less than 0, then y is referenced backward
in array y; that is, y[i] is referenced in:
where:
y
|
=
|
array specified in
y
|
n
|
=
|
number of vector elements specified in
n
|
i
|
=
|
element of the vector y
|
incy
|
=
|
increment argument for the array
y specified in
incy
|
Description
BLAS1$VSCOPY, BLAS1$VDCOPY, BLAS1$VCCOPY, and BLAS1$VZCOPY copy
n elements of the vector x to the vector y . Vector x contains
n elements that are accessed from array
x by stepping incx elements at a
time. Both x and y are real or complex single-precision or
double-precision (D and G) n-element vectors. The vectors can
be rows or columns of a matrix. Both forward and backward indexing are
permitted.
If you specify 0 for incx, BLAS1$VxCOPY initializes
all elements of y to a constant.
If you specify --incx for incy, the
vector x is stored in reverse order in y . In this case, the call
format is as follows:
CALL BLAS1$VxCOPY (N,X,INCX,Y,-INCX)
|
It is possible to move the contents of a vector up or down within
itself and not cause unpredictable results even though the same memory
location is shared between input and output. To do this when i
is greater than j, call the routine BLAS1$VxCOPY with incx =
incy > 0 as follows:
CALL BLAS1$VxCOPY (N,X(I),INCX,X(J),INCX)
|
The preceding call to BLAS1$VxCOPY moves:
If i is less than j, specify a negative value for
incx and incy in the call to
BLAS1$VxCOPY, as follows. The parts that do not overlap are unchanged.
CALL BLAS1$VxCOPY (N,X(I),-INCX,X(J),-INCX)
|
Note
BLAS1$VxCOPY does not perform floating operations on the input data.
Therefore, floating reserved operands are not detected by BLAS1$VxCOPY.
|
Example
|
C
C To copy a vector x to a vector y using BLAS1$VSCOPY:
C
INTEGER N,INCX,INCY
REAL X(20),Y(20)
INCX = 1
INCY = 1
N = 20
CALL BLAS1$VSCOPY(N,X,INCX,Y,INCY)
C
C To move the contents of X(1),X(3),X(5),...,X(2N-1)
C to X(3),X(5),...,X(2N+1) and leave x unchanged:
C
CALL BLAS1$VSCOPY(N,X,-2,X(3),-2))
C
C To move the contents of X(2),X(3),...,X(100) to
C X(1),X(2),...,X(99)and leave x(100) unchanged:
C
CALL BLAS1$VSCOPY(99,X(2),1,X,1))
C
C To move the contents of X(1),X(2),X(3),...,X(N) to
C Y(N),Y(N-1),...,Y
C
CALL BLAS1$VSCOPY(N,X,1,Y,-1))
|
BLAS1$VxDOTx
The Obtain the Inner Product of Two Vectors routine returns the dot
product of two n-element vectors, x and y .
Format
BLAS1$VSDOT n ,x ,incx ,y ,incy
BLAS1$VDDOT n ,x ,incx ,y ,incy
BLAS1$VGDOT n ,x ,incx ,y ,incy
BLAS1$VCDOTU n ,x ,incx ,y ,incy
BLAS1$VCDOTC n ,x ,incx ,y ,incy
BLAS1$VZDOTU n ,x ,incx ,y ,incy
BLAS1$VWDOTU n ,x ,incx ,y ,incy
BLAS1$VZDOTC n ,x ,incx ,y ,incy
BLAS1$VWDOTC n ,x ,incx ,y ,incy
Use BLAS1$VSDOT to obtain the inner product of two single-precision
real vectors. Use BLAS1$VDDOT to obtain the inner product of two
double-precision (D-floating) real vectors. Use BLAS1$VGDOT to obtain
the inner product of two double-precision (G-floating) real vectors.
Use BLAS1$VCDOTU to obtain the inner product of two single-precision
complex vectors (unconjugated). Use BLAS1$VCDOTC to obtain the inner
product of two single-precision complex vectors (conjugated). Use
BLAS1$VZDOTU to obtain the inner product of two double-precision
(D-floating) complex vectors (unconjugated). Use BLAS1$VWDOTU to obtain
the inner product of two double-precision (G-floating) complex vectors
(unconjugated). Use BLAS1$VZDOTC to obtain the inner product of two
double-precision (D-floating) complex vectors (conjugated). Use
BLAS1$VWDOTC to obtain the inner product of two double-precision
(G-floating) complex vectors (conjugated).
RETURNS
OpenVMS usage: |
floating_point or complex_number |
type: |
F_floating, D_floating, G_floating real or F_floating,
D_floating, G_floating complex |
access: |
write only |
mechanism: |
by value |
The function value, called dotpr, is the dot product
of two n-element vectors, x and y . Specify the same data type
for dotpr and the argument x.
Arguments
n
OpenVMS usage: |
longword_signed |
type: |
longword integer (signed) |
access: |
read only |
mechanism: |
by reference |
Number of elements in vector x . The n argument is the
address of a signed longword integer containing the number of elements.
If you specify a value for n that is less than or
equal to 0, then the value of dotpr is 0.0.
x
OpenVMS usage: |
floating_point or complex_number |
type: |
F_floating, D_floating, G_floating real or F_floating,
D_floating, G_floating complex |
access: |
read only |
mechanism: |
by reference, array reference |
Array containing the elements to be accessed. All elements of array
x are accessed only if the increment argument of
x, called incx, is 1. The
x argument is the address of a floating-point or
floating-point complex number that is this array. This argument is an
array of length at least:
where:
n
|
=
|
number of vector elements specified in
n
|
incx
|
=
|
increment argument for the array
x specified in
incx
|
Specify the data type as follows:
Routine |
Data Type for x |
BLAS1$VSDOT
|
F-floating real
|
BLAS1$VDDOT
|
D-floating real
|
BLAS1$VGDOT
|
G-floating real
|
BLAS1$VCDOTU and BLAS1$VCDOTC
|
F-floating complex
|
BLAS1$VZDOTU and BLAS1$VZDOTC
|
D-floating complex
|
BLAS1$VWDOTU and BLAS1$VWDOTC
|
G-floating complex
|
incx
OpenVMS usage: |
longword_signed |
type: |
longword integer (signed) |
access: |
read only |
mechanism: |
by reference |
Increment argument for the array x. The
incx argument is the address of a signed longword
integer containing the increment argument. If incx is
greater than 0, then x is referenced forward in array
x; that is, x[i] is referenced in:
where:
x
|
=
|
array specified in
x
|
i
|
=
|
element of the vector x
|
incx
|
=
|
increment argument for the array
x specified in
incx
|
If incx is less than 0, then x is referenced backward
in array x; that is, x[i] is referenced in:
where:
x
|
=
|
array specified in
x
|
n
|
=
|
number of vector elements specified in
n
|
i
|
=
|
element of the vector x
|
incx
|
=
|
increment argument for the array
x specified in
incx
|
y
OpenVMS usage: |
floating_point or complex_number |
type: |
F_floating, D_floating, G_floating real or F_floating,
D_floating, G_floating complex |
access: |
read only |
mechanism: |
by reference, array reference |
Array containing the elements to be accessed. All elements of array
y are accessed only if the increment argument of
y, called incy, is 1. The
y argument is the address of a floating-point or
floating-point complex number that is this array. This argument is an
array of length at least:
where:
n
|
=
|
number of vector elements specified in
n
|
incy
|
=
|
increment argument for the array
y specified in
incy
|
Specify the data type as follows:
Routine |
Data Type for y |
BLAS1$VSDOT
|
F-floating real
|
BLAS1$VDDOT
|
D-floating real
|
BLAS1$VGDOT
|
G-floating real
|
BLAS1$VCDOTU and BLAS1$VCDOTC
|
F-floating complex
|
BLAS1$VZDOTU and BLAS1$VZDOTC
|
D-floating complex
|
BLAS1$VWDOTU and BLAS1$VWDOTC
|
G-floating complex
|
incy
OpenVMS usage: |
longword_signed |
type: |
longword integer (signed) |
access: |
read only |
mechanism: |
by reference |
Increment argument for the array y. The
incy argument is the address of a signed longword
integer containing the increment argument. If incy is
greater than or equal to 0, then y is referenced forward in array
y; that is, y[i] is referenced in:
where:
y
|
=
|
array specified in
y
|
i
|
=
|
element of the vector y
|
incy
|
=
|
increment argument for the array
y specified in
incy
|
If incy is less than 0, then y is referenced backward
in array y; that is, y[i] is referenced in:
where:
y
|
=
|
array specified in
y
|
n
|
=
|
number of vector elements specified in
n
|
i
|
=
|
element of the vector y
|
incy
|
=
|
increment argument for the array
y specified in
incy
|
Description
The unconjugated versions of this routine, BLAS1$VSDOT, BLAS1$VDDOT,
BLAS1$VGDOT, BLAS1$VCDOTU, BLAS1$VZDOTU, and BLAS1$VWDOTU return the
dot product of two n-element vectors, x and y , expressed as
follows:
|