# ?poequ

Computes row and column scaling factors intended to equilibrate a symmetric (Hermitian) positive definite matrix and reduce its condition number.

## Syntax

FORTRAN 77:

call spoequ( n, a, lda, s, scond, amax, info )

call dpoequ( n, a, lda, s, scond, amax, info )

call cpoequ( n, a, lda, s, scond, amax, info )

call zpoequ( n, a, lda, s, scond, amax, info )

Fortran 95:

call poequ( a, s [,scond] [,amax] [,info] )

## Description

This routine computes row and column scalings intended to equilibrate a symmetric (Hermitian) positive-definite matrix A and reduce its condition number (with respect to the two-norm). The output array s returns scale factors computed as

These factors are chosen so that the scaled matrix B with elements `bij=s(i)*aij*s(j)` has diagonal elements equal to 1.

This choice of s puts the condition number of B within a factor n of the smallest possible condition number over all possible diagonal scalings.

See ?laqsy auxiliary function that uses scaling factors computed by ?poequ.

## Input Parameters

n

  INTEGER. The order of the matrix A; `n ≥ 0`.

a

  REAL for spoequ

  DOUBLE PRECISION for dpoequ

  COMPLEX for cpoequ

  DOUBLE COMPLEX for zpoequ.

  Array: DIMENSION `(lda,*)`.

  Contains the n-by-n symmetric or Hermitian positive definite matrix A whose scaling factors are to be computed. Only diagonal elements of A are referenced.

  The second dimension of a must be at least `max(1,n)`.

lda

  INTEGER. The leading dimension of a; `lda ≥ max(1, m)`.

## Output Parameters

s

  REAL for single precision flavors

  DOUBLE PRECISION for double precision flavors.

  Array, DIMENSION (n).

  If `info = 0`, the array s contains the scale factors for A.

scond

  REAL for single precision flavors

  DOUBLE PRECISION for double precision flavors.

  If `info = 0`, scond contains the ratio of the smallest `s(i)` to the largest `s(i)`.

amax

  REAL for single precision flavors

  DOUBLE PRECISION for double precision flavors.

  Absolute value of the largest element of the matrix A.

info

  INTEGER.

  If `info = 0`, the execution is successful.

  If `info = -i`, the i-th parameter had an illegal value.

  If `info = i`, the i-th diagonal element of A is nonpositive.

## 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 poequ interface are as follows:

a

  Holds the matrix A of size (`n,n`).

s

  Holds the vector of length (n).

## Application Notes

If `scond ≥ 0.1` and amax is neither too large nor too small, it is not worth scaling by s.

If amax is very close to overflow or very close to underflow, the matrix A should be scaled.

Parent topic: Routines for Matrix Equilibration