LAPACK 3.12.1
LAPACK: Linear Algebra PACKage
Loading...
Searching...
No Matches

◆ 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.
Further Details:
!>
!>     jack dongarra, linpack, 3/11/78.
!>     modified 12/3/93, array(1) declarations changed to array(*)
!> 

Definition at line 87 of file caxpy.f.

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