LAPACK  3.8.0
LAPACK: Linear Algebra PACKage

◆ caxpy()

subroutine caxpy ( integer  N,
complex  CA,
complex, dimension(*)  CX,
integer  INCX,
complex, dimension(*)  CY,
integer  INCY 
)

CAXPY

Purpose:
    CAXPY constant times a vector plus a vector.
Parameters
[in]N
          N is INTEGER
         number of elements in input vector(s)
[in]CA
          CA is COMPLEX
           On entry, CA specifies the scalar alpha.
[in]CX
          CX is COMPLEX array, dimension ( 1 + ( N - 1 )*abs( INCX ) )
[in]INCX
          INCX is INTEGER
         storage spacing between elements of CX
[in,out]CY
          CY is COMPLEX array, dimension ( 1 + ( N - 1 )*abs( INCY ) )
[in]INCY
          INCY is INTEGER
         storage spacing between elements of CY
Author
Univ. of Tennessee
Univ. of California Berkeley
Univ. of Colorado Denver
NAG Ltd.
Date
November 2017
Further Details:
     jack dongarra, linpack, 3/11/78.
     modified 12/3/93, array(1) declarations changed to array(*)

Definition at line 90 of file caxpy.f.

90 *
91 * -- Reference BLAS level1 routine (version 3.8.0) --
92 * -- Reference BLAS is a software package provided by Univ. of Tennessee, --
93 * -- Univ. of California Berkeley, Univ. of Colorado Denver and NAG Ltd..--
94 * November 2017
95 *
96 * .. Scalar Arguments ..
97  COMPLEX ca
98  INTEGER incx,incy,n
99 * ..
100 * .. Array Arguments ..
101  COMPLEX cx(*),cy(*)
102 * ..
103 *
104 * =====================================================================
105 *
106 * .. Local Scalars ..
107  INTEGER i,ix,iy
108 * ..
109 * .. External Functions ..
110  REAL scabs1
111  EXTERNAL scabs1
112 * ..
113  IF (n.LE.0) RETURN
114  IF (scabs1(ca).EQ.0.0e+0) RETURN
115  IF (incx.EQ.1 .AND. incy.EQ.1) THEN
116 *
117 * code for both increments equal to 1
118 *
119  DO i = 1,n
120  cy(i) = cy(i) + ca*cx(i)
121  END DO
122  ELSE
123 *
124 * code for unequal increments or equal increments
125 * not equal to 1
126 *
127  ix = 1
128  iy = 1
129  IF (incx.LT.0) ix = (-n+1)*incx + 1
130  IF (incy.LT.0) iy = (-n+1)*incy + 1
131  DO i = 1,n
132  cy(iy) = cy(iy) + ca*cx(ix)
133  ix = ix + incx
134  iy = iy + incy
135  END DO
136  END IF
137 *
138  RETURN
real function scabs1(Z)
SCABS1
Definition: scabs1.f:48