ggbal#

Functions

void sggbal(
    const char*          job,
    const INT            n,
          f32*  restrict A,
    const INT            lda,
          f32*  restrict B,
    const INT            ldb,
          INT*           ilo,
          INT*           ihi,
          f32*  restrict lscale,
          f32*  restrict rscale,
          f32*  restrict work,
          INT*           info
);
void sggbal(const char *job, const INT n, f32 *restrict A, const INT lda, f32 *restrict B, const INT ldb, INT *ilo, INT *ihi, f32 *restrict lscale, f32 *restrict rscale, f32 *restrict work, INT *info)#

SGGBAL balances a pair of general real matrices (A,B).

This involves, first, permuting A and B by similarity transformations to isolate eigenvalues in the first 0 to ILO-1 and last IHI+1 to N-1 elements on the diagonal; and second, applying a diagonal similarity transformation to rows and columns ILO to IHI to make the rows and columns as close in norm as possible. Both steps are optional.

Balancing may reduce the 1-norm of the matrices, and improve the accuracy of the computed eigenvalues and/or eigenvectors in the generalized eigenvalue problem A*x = lambda*B*x.

Parameters

in
job

Specifies the operations to be performed on A and B: = ‘N’: none: simply set ILO = 0, IHI = N-1, LSCALE(I) = 1.0 and RSCALE(I) = 1.0 for i = 0,…,N-1. = ‘P’: permute only; = ‘S’: scale only; = ‘B’: both permute and scale.

in
n

The order of the matrices A and B. n >= 0.

inout
A

Array of dimension (lda, n). On entry, the input matrix A. On exit, A is overwritten by the balanced matrix. If job = ‘N’, A is not referenced.

in
lda

The leading dimension of A. lda >= max(1,n).

inout
B

Array of dimension (ldb, n). On entry, the input matrix B. On exit, B is overwritten by the balanced matrix. If job = ‘N’, B is not referenced.

in
ldb

The leading dimension of B. ldb >= max(1,n).

out
ilo

See ihi.

out
ihi

ILO and IHI are set to integers such that on exit A(i,j) = 0 and B(i,j) = 0 if i > j and j = 0,…,ILO-1 or i = IHI+1,…,N-1. If job = ‘N’ or ‘S’, ILO = 0 and IHI = N-1.

out
lscale

Array of dimension (n). Details of the permutations and scaling factors applied to the left side of A and B. If P(j) is the index of the row interchanged with row j, and D(j) is the scaling factor applied to row j, then lscale[j] = P(j) for j = 0,…,ILO-1 = D(j) for j = ILO,…,IHI = P(j) for j = IHI+1,…,N-1. The order in which the interchanges are made is N-1 to IHI+1, then 0 to ILO-1.

out
rscale

Array of dimension (n). Details of the permutations and scaling factors applied to the right side of A and B. If P(j) is the index of the column interchanged with column j, and D(j) is the scaling factor applied to column j, then rscale[j] = P(j) for j = 0,…,ILO-1 = D(j) for j = ILO,…,IHI = P(j) for j = IHI+1,…,N-1. The order in which the interchanges are made is N-1 to IHI+1, then 0 to ILO-1.

out
work

Workspace array of dimension (lwork). lwork must be at least max(1, 6*n) when job = ‘S’ or ‘B’, and at least 1 when job = ‘N’ or ‘P’.

out
info

  • = 0: successful exit

  • < 0: if info = -i, the i-th argument had an illegal value.

Functions

void dggbal(
    const char*          job,
    const INT            n,
          f64*  restrict A,
    const INT            lda,
          f64*  restrict B,
    const INT            ldb,
          INT*           ilo,
          INT*           ihi,
          f64*  restrict lscale,
          f64*  restrict rscale,
          f64*  restrict work,
          INT*           info
);
void dggbal(const char *job, const INT n, f64 *restrict A, const INT lda, f64 *restrict B, const INT ldb, INT *ilo, INT *ihi, f64 *restrict lscale, f64 *restrict rscale, f64 *restrict work, INT *info)#

DGGBAL balances a pair of general real matrices (A,B).

This involves, first, permuting A and B by similarity transformations to isolate eigenvalues in the first 0 to ILO-1 and last IHI+1 to N-1 elements on the diagonal; and second, applying a diagonal similarity transformation to rows and columns ILO to IHI to make the rows and columns as close in norm as possible. Both steps are optional.

Balancing may reduce the 1-norm of the matrices, and improve the accuracy of the computed eigenvalues and/or eigenvectors in the generalized eigenvalue problem A*x = lambda*B*x.

Parameters

in
job

Specifies the operations to be performed on A and B: = ‘N’: none: simply set ILO = 0, IHI = N-1, LSCALE(I) = 1.0 and RSCALE(I) = 1.0 for i = 0,…,N-1. = ‘P’: permute only; = ‘S’: scale only; = ‘B’: both permute and scale.

in
n

The order of the matrices A and B. n >= 0.

inout
A

Array of dimension (lda, n). On entry, the input matrix A. On exit, A is overwritten by the balanced matrix. If job = ‘N’, A is not referenced.

in
lda

The leading dimension of A. lda >= max(1,n).

inout
B

Array of dimension (ldb, n). On entry, the input matrix B. On exit, B is overwritten by the balanced matrix. If job = ‘N’, B is not referenced.

in
ldb

The leading dimension of B. ldb >= max(1,n).

out
ilo

See ihi.

out
ihi

ILO and IHI are set to integers such that on exit A(i,j) = 0 and B(i,j) = 0 if i > j and j = 0,…,ILO-1 or i = IHI+1,…,N-1. If job = ‘N’ or ‘S’, ILO = 0 and IHI = N-1.

out
lscale

Array of dimension (n). Details of the permutations and scaling factors applied to the left side of A and B. If P(j) is the index of the row interchanged with row j, and D(j) is the scaling factor applied to row j, then lscale[j] = P(j) for j = 0,…,ILO-1 = D(j) for j = ILO,…,IHI = P(j) for j = IHI+1,…,N-1. The order in which the interchanges are made is N-1 to IHI+1, then 0 to ILO-1.

out
rscale

Array of dimension (n). Details of the permutations and scaling factors applied to the right side of A and B. If P(j) is the index of the column interchanged with column j, and D(j) is the scaling factor applied to column j, then rscale[j] = P(j) for j = 0,…,ILO-1 = D(j) for j = ILO,…,IHI = P(j) for j = IHI+1,…,N-1. The order in which the interchanges are made is N-1 to IHI+1, then 0 to ILO-1.

out
work

Workspace array of dimension (lwork). lwork must be at least max(1, 6*n) when job = ‘S’ or ‘B’, and at least 1 when job = ‘N’ or ‘P’.

out
info

  • = 0: successful exit

  • < 0: if info = -i, the i-th argument had an illegal value.

Functions

void cggbal(
    const char*          job,
    const INT            n,
          c64*  restrict A,
    const INT            lda,
          c64*  restrict B,
    const INT            ldb,
          INT*           ilo,
          INT*           ihi,
          f32*  restrict lscale,
          f32*  restrict rscale,
          f32*  restrict work,
          INT*           info
);
void cggbal(const char *job, const INT n, c64 *restrict A, const INT lda, c64 *restrict B, const INT ldb, INT *ilo, INT *ihi, f32 *restrict lscale, f32 *restrict rscale, f32 *restrict work, INT *info)#

CGGBAL balances a pair of general complex matrices (A,B).

This involves, first, permuting A and B by similarity transformations to isolate eigenvalues in the first 0 to ILO-1 and last IHI+1 to N-1 elements on the diagonal; and second, applying a diagonal similarity transformation to rows and columns ILO to IHI to make the rows and columns as close in norm as possible. Both steps are optional.

Balancing may reduce the 1-norm of the matrices, and improve the accuracy of the computed eigenvalues and/or eigenvectors in the generalized eigenvalue problem A*x = lambda*B*x.

Parameters

in
job

Specifies the operations to be performed on A and B: = ‘N’: none: simply set ILO = 0, IHI = N-1, LSCALE(I) = 1.0 and RSCALE(I) = 1.0 for i = 0,…,N-1. = ‘P’: permute only; = ‘S’: scale only; = ‘B’: both permute and scale.

in
n

The order of the matrices A and B. n >= 0.

inout
A

Complex array of dimension (lda, n). On entry, the input matrix A. On exit, A is overwritten by the balanced matrix. If job = ‘N’, A is not referenced.

in
lda

The leading dimension of A. lda >= max(1,n).

inout
B

Complex array of dimension (ldb, n). On entry, the input matrix B. On exit, B is overwritten by the balanced matrix. If job = ‘N’, B is not referenced.

in
ldb

The leading dimension of B. ldb >= max(1,n).

out
ilo

See ihi.

out
ihi

ILO and IHI are set to integers such that on exit A(i,j) = 0 and B(i,j) = 0 if i > j and j = 0,…,ILO-1 or i = IHI+1,…,N-1. If job = ‘N’ or ‘S’, ILO = 0 and IHI = N-1.

out
lscale

Array of dimension (n). Details of the permutations and scaling factors applied to the left side of A and B. If P(j) is the index of the row interchanged with row j, and D(j) is the scaling factor applied to row j, then lscale[j] = P(j) for j = 0,…,ILO-1 = D(j) for j = ILO,…,IHI = P(j) for j = IHI+1,…,N-1. The order in which the interchanges are made is N-1 to IHI+1, then 0 to ILO-1.

out
rscale

Array of dimension (n). Details of the permutations and scaling factors applied to the right side of A and B. If P(j) is the index of the column interchanged with column j, and D(j) is the scaling factor applied to column j, then rscale[j] = P(j) for j = 0,…,ILO-1 = D(j) for j = ILO,…,IHI = P(j) for j = IHI+1,…,N-1. The order in which the interchanges are made is N-1 to IHI+1, then 0 to ILO-1.

out
work

Real workspace array of dimension (lwork). lwork must be at least max(1, 6*n) when job = ‘S’ or ‘B’, and at least 1 when job = ‘N’ or ‘P’.

out
info

  • = 0: successful exit

  • < 0: if info = -i, the i-th argument had an illegal value.

Functions

void zggbal(
    const char*          job,
    const INT            n,
          c128* restrict A,
    const INT            lda,
          c128* restrict B,
    const INT            ldb,
          INT*           ilo,
          INT*           ihi,
          f64*  restrict lscale,
          f64*  restrict rscale,
          f64*  restrict work,
          INT*           info
);
void zggbal(const char *job, const INT n, c128 *restrict A, const INT lda, c128 *restrict B, const INT ldb, INT *ilo, INT *ihi, f64 *restrict lscale, f64 *restrict rscale, f64 *restrict work, INT *info)#

ZGGBAL balances a pair of general complex matrices (A,B).

This involves, first, permuting A and B by similarity transformations to isolate eigenvalues in the first 0 to ILO-1 and last IHI+1 to N-1 elements on the diagonal; and second, applying a diagonal similarity transformation to rows and columns ILO to IHI to make the rows and columns as close in norm as possible. Both steps are optional.

Balancing may reduce the 1-norm of the matrices, and improve the accuracy of the computed eigenvalues and/or eigenvectors in the generalized eigenvalue problem A*x = lambda*B*x.

Parameters

in
job

Specifies the operations to be performed on A and B: = ‘N’: none: simply set ILO = 0, IHI = N-1, LSCALE(I) = 1.0 and RSCALE(I) = 1.0 for i = 0,…,N-1. = ‘P’: permute only; = ‘S’: scale only; = ‘B’: both permute and scale.

in
n

The order of the matrices A and B. n >= 0.

inout
A

Complex array of dimension (lda, n). On entry, the input matrix A. On exit, A is overwritten by the balanced matrix. If job = ‘N’, A is not referenced.

in
lda

The leading dimension of A. lda >= max(1,n).

inout
B

Complex array of dimension (ldb, n). On entry, the input matrix B. On exit, B is overwritten by the balanced matrix. If job = ‘N’, B is not referenced.

in
ldb

The leading dimension of B. ldb >= max(1,n).

out
ilo

See ihi.

out
ihi

ILO and IHI are set to integers such that on exit A(i,j) = 0 and B(i,j) = 0 if i > j and j = 0,…,ILO-1 or i = IHI+1,…,N-1. If job = ‘N’ or ‘S’, ILO = 0 and IHI = N-1.

out
lscale

Array of dimension (n). Details of the permutations and scaling factors applied to the left side of A and B. If P(j) is the index of the row interchanged with row j, and D(j) is the scaling factor applied to row j, then lscale[j] = P(j) for j = 0,…,ILO-1 = D(j) for j = ILO,…,IHI = P(j) for j = IHI+1,…,N-1. The order in which the interchanges are made is N-1 to IHI+1, then 0 to ILO-1.

out
rscale

Array of dimension (n). Details of the permutations and scaling factors applied to the right side of A and B. If P(j) is the index of the column interchanged with column j, and D(j) is the scaling factor applied to column j, then rscale[j] = P(j) for j = 0,…,ILO-1 = D(j) for j = ILO,…,IHI = P(j) for j = IHI+1,…,N-1. The order in which the interchanges are made is N-1 to IHI+1, then 0 to ILO-1.

out
work

Real workspace array of dimension (lwork). lwork must be at least max(1, 6*n) when job = ‘S’ or ‘B’, and at least 1 when job = ‘N’ or ‘P’.

out
info

  • = 0: successful exit

  • < 0: if info = -i, the i-th argument had an illegal value.