SSCAL, DSCAL, CSSCAL, CSCAL, ZDSCAL, or ZSCAL Subroutine

Purpose

Scales a vector by a constant.

Library

BLAS Library (libblas.a)

FORTRAN Syntax

SUBROUTINE SSCAL(N,A,X,INCX)
INTEGER  INCX, N
REAL  A
REAL  X(*)

SUBROUTINE DSCAL(N,A,X,INCX)
INTEGER INCX,N
DOUBLE PRECISION A
DOUBLE PRECISION X(*)
SUBROUTINE CSSCAL(N,A,X,INCX)
INTEGER INCX,N
REAL A
COMPLEX X(*)
SUBROUTINE CSCAL
INTEGER INCX,N
COMPLEX A
COMPLEX X(*)
SUBROUTINE ZDSCAL
INTEGER INCX,N
DOUBLE PRECISION A
COMPLEX*16 X(*)
SUBROUTINE ZSCAL(
INTEGER INCX,N
COMPLEX*16 A
COMPLEX*16 X(*)

Description

The SSCAL, DSCAL, CSSCAL, CSCAL, ZDSCAL, or ZSCAL subroutine scales a vector by a constant:

X := X * A

Parameters

Item Description
N On entry, N specifies the number of elements in X and Y; unchanged on exit.
A Scaling constant; unchanged on exit.
X Vector of dimension at least (1 + (N-1) * abs(INCX) ); on exit, contains the scaled vector.
INCX On entry, INCX specifies the increment for the elements of X; INCX must be greater than 0; unchanged on exit.

Error Codes

For values of N <= 0, the subroutines return immediately.