# ?laqsy

Scales a symmetric/Hermitian matrix, using scaling factors computed by ?poequ.

## Syntax

call slaqsy( uplo, n, a, lda, s, scond, amax, equed )

call dlaqsy( uplo, n, a, lda, s, scond, amax, equed )

call claqsy( uplo, n, a, lda, s, scond, amax, equed )

call zlaqsy( uplo, n, a, lda, s, scond, amax, equed )

## Description

The routine equilibrates a symmetric matrix A using the scaling factors in the vector s.

## Input Parameters

uplo

  CHARACTER*1.

  Specifies whether the upper or lower triangular part of the symmetric matrix A is stored.

  If `uplo = 'U'`: upper triangular.

  If `uplo = 'L'`: lower triangular.

n

  INTEGER. The order of the matrix A.

  `n ≥ 0`.

a

  REAL for slaqsy

  DOUBLE PRECISION for dlaqsy

  COMPLEX for claqsy

  COMPLEX*16 for zlaqsy

  Array, DIMENSION (lda,n). On entry, the symmetric matrix A.

  If `uplo = 'U'`, the leading n-by-n upper triangular part of a contains the upper triangular part of the matrix A, and the strictly lower triangular part of a is not referenced.

  If `uplo = 'L'`, the leading n-by-n lower triangular part of a contains the lower triangular part of the matrix A, and the strictly upper triangular part of a is not referenced.

lda

  INTEGER. The leading dimension of the array a.

  `lda ≥ max(n,1)`.

s

  REAL for slaqsy/claqsy

  DOUBLE PRECISION for dlaqsy/zlaqsy

  Array, DIMENSION (n). The scale factors for A.

scond

  REAL for slaqsy/claqsy

  DOUBLE PRECISION for dlaqsy/zlaqsy

  Ratio of the smallest s(i) to the largest s(i).

amax

  REAL for slaqsy/claqsy

  DOUBLE PRECISION for dlaqsy/zlaqsy

  Absolute value of largest matrix entry.

## Output Parameters

a

  On exit, if `equed = 'Y'`, the equilibrated matrix: `diag(s)*A*diag(s)`.

equed

  CHARACTER*1.

  Specifies whether or not equilibration was done.

  If `equed = 'N'`: No equilibration.

  If `equed = 'Y'`: Equilibration was done, i.e., A has been replaced by `diag(s)*A*diag(s)`.

## Application Notes

The routine uses internal parameters thresh, large, and small, which have the following meaning. thresh is a threshold value used to decide if scaling should be based on the ratio of the scaling factors. If `scond < thresh`, scaling is done. large and small are threshold values used to decide if scaling should be done based on the absolute size of the largest matrix element. If `amax > large` or `amax < small`, scaling is done.

Parent topic: Auxiliary Routines