# ?scal

Computes a vector by a scalar product.

## Syntax

FORTRAN 77:

call sscal(n, a, x, incx )

call dscal(n, a, x, incx )

call cscal(n, a, x, incx )

call zscal(n, a, x, incx )

call csscal(n, a, x, incx )

call zdscal(n, a, x, incx )

Fortran 95:

call scal(x, a)

## Description

The ?scal routines perform a vector-vector operation defined as
`x = a*x`

where:

a is a scalar, x is an n-element vector.

## Input Parameters

n

  INTEGER. Specifies the number of elements in vector x.

a

  REAL for sscal and csscal

  DOUBLE PRECISION for dscal and zdscal

  COMPLEX for cscal

  DOUBLE COMPLEX for zscal

  Specifies the scalar a.

x

  REAL for sscal

  DOUBLE PRECISION for dscal

  COMPLEX for cscal and csscal

  DOUBLE COMPLEX for zscal and zdscal

  Array, DIMENSION at least `(1 + (n -1)*abs(incx))`.

incx

  INTEGER. Specifies the increment for the elements of x.

## Output Parameters

x

  Updated vector `x`.

## Fortran 95 Interface Notes

Routines in Fortran 95 interface have fewer arguments in the calling sequence than their FORTRAN 77 counterparts. For general conventions applied to skip redundant or reconstructible arguments, see Fortran 95 Interface Conventions.

Specific details for the routine scal interface are the following:

x

  Holds the vector of length(n).

Parent topic: BLAS Level 1 Routines