Contents

# ?ggevx

Computes the generalized eigenvalues, and, optionally, the left and/or right generalized eigenvectors.

## Syntax

Include Files
• mkl.h
Description
The routine computes for a pair of
n
-by-
n
real/complex nonsymmetric matrices (
A
,
B
), the generalized eigenvalues, and optionally, the left and/or right generalized eigenvectors.
Optionally also, it computes a balancing transformation to improve the conditioning of the eigenvalues and eigenvectors (
ilo
,
ihi
,
lscale
,
rscale
,
abnrm
, and
bbnrm
), reciprocal condition numbers for the eigenvalues (
rconde
), and reciprocal condition numbers for the right eigenvectors (
rcondv
).
A generalized eigenvalue for a pair of matrices (
A
,
B
) is a scalar
λ
or a ratio
alpha
/
beta
=
λ
, such that
A
-
λ
*
B
is singular. It is usually represented as the pair (
alpha
,
beta
), as there is a reasonable interpretation for
beta
=0
and even for both being zero. The right generalized eigenvector
v
(j)
corresponding to the generalized eigenvalue
λ
(j)
of (
A
,
B
) satisfies
A
*
v
(j) =
λ
(j)*
B
*
v
(j)
.
The left generalized eigenvector
u
(j)
corresponding to the generalized eigenvalue
λ
(j)
of (
A
,
B
) satisfies
u
(j)
H
*
A
=
λ
(j)*
u
(j)
H
*
B
where
u
(j)
H
denotes the conjugate transpose of
u
(j)
.
Input Parameters
matrix_layout
Specifies whether matrix storage layout is row major (
LAPACK_ROW_MAJOR
) or column major (
LAPACK_COL_MAJOR
).
balanc
Must be
'N'
,
'P'
,
'S'
, or
'B'
. Specifies the balance option to be performed.
If
balanc
=
'N'
, do not diagonally scale or permute;
If
balanc
=
'P'
, permute only;
If
balanc
=
'S'
, scale only;
If
balanc
=
'B'
, both permute and scale.
Computed reciprocal condition numbers will be for the matrices after balancing and/or permuting. Permuting does not change condition numbers (in exact arithmetic), but balancing does.
jobvl
Must be
'N'
or
'V'
.
If
jobvl
=
'N'
, the left generalized eigenvectors are not computed;
If
jobvl
=
'V'
, the left generalized eigenvectors are computed.
jobvr
Must be
'N'
or
'V'
.
If
jobvr
=
'N'
, the right generalized eigenvectors are not computed;
If
jobvr
=
'V'
, the right generalized eigenvectors are computed.
sense
Must be
'N'
,
'E'
,
'V'
, or
'B'
. Determines which reciprocal condition number are computed.
If
sense
=
'N'
, none are computed;
If
sense
=
'E'
, computed for eigenvalues only;
If
sense
=
'V'
, computed for eigenvectors only;
If
sense
=
'B'
, computed for eigenvalues and eigenvectors.
n
The order of the matrices
A
,
B
,
vl
, and
vr
(
n
0
).
a
,
b
Arrays:
a
(size at least max(1,
lda
*
n
))
is an array containing the
n
-by-
n
matrix
A
(first of the pair of matrices).
b
(size at least max(1,
ldb
*
n
))
is an array containing the
n
-by-
n
matrix
B
(second of the pair of matrices).
lda
The leading dimension of the array
a
.
Must be at least max(1,
n
).
ldb
The leading dimension of the array
b
.
Must be at least max(1,
n
).
ldvl
,
ldvr
The leading dimensions of the output matrices
vl
and
vr
, respectively.
Constraints:
ldvl
1
. If
jobvl
=
'V'
,
ldvl
max(1,
n
)
.
ldvr
1
. If
jobvr
=
'V'
,
ldvr
max(1,
n
)
.
Output Parameters
a
,
b
On exit, these arrays have been overwritten.
If
jobvl
=
'V'
or
jobvr
=
'V'
or both, then
a
contains the first part of the real Schur form of the "balanced" versions of the input
A
and
B
, and
b
contains its second part.
alphar
,
alphai
Arrays, size at least max(1,
n
) each. Contain values that form generalized eigenvalues in real flavors.
See
beta
.
alpha
Array, size at least max(1,
n
). Contain values that form generalized eigenvalues in complex flavors. See
beta
.
beta
Array, size at least max(1,
n
).
For real flavors
:
On exit,
(
alphar
[
j
] +
alphai
[
j
]*i)/
beta
[
j
],
j
=0,...,
n
- 1
, will be the generalized eigenvalues.
If
alphai
[
j
]
is zero, then the
j
-th eigenvalue is real; if positive, then the
j
-th and (
j
+1)-st eigenvalues are a complex conjugate pair, with
alphai
[
j
+1]
negative.
For complex flavors:
On exit,
alpha
[
j
]/
beta
[
j
],
j
=0,...,
n
- 1
, will be the generalized eigenvalues.
Application Notes
below.
vl
,
vr
Arrays:
vl
(size at least max(1,
ldvl
*
n
))
.
If
jobvl
=
'V'
, the left generalized eigenvectors
u
(j)
are stored one after another in the columns of
vl
, in the same order as their eigenvalues. Each eigenvector will be scaled so the largest component have abs(Re) + abs(Im) = 1.
If
jobvl
=
'N'
,
vl
is not referenced.
For real flavors
:
If the j-th eigenvalue is real, then
k
-th component of
j
-th left eigenvector
u
j
is stored in
vl
[(
k
- 1) + (j - 1)*
ldvl
]
for column major layout and in
vl
[(
k
- 1)*
ldvl
+ (
j
- 1)]
for row major layout.
.
If the j-th and (j+1)-st eigenvalues form a complex conjugate pair, then for
i
= sqrt(-1)
,
the
k
-th components of the
j
-th left eigenvector
u
j
can be computed as
vl
[(
k
- 1) + (
j
- 1)*
ldvl
]
+ i*
vl
[(
k
- 1) +
j
*
ldvl
]
for column major layout and
vl
[(
k
- 1)*
ldvl
+ (
j
- 1)]
+ i*
vl
[(
k
- 1)*
ldvl
+
j
]
for row major layout. Similarly, the
k
-th components of the left eigenvector
j
+1
u
j
+1
can be computed as
vl
[(
k
- 1) + (
j
- 1)*
ldvl
]
- i*
vl
[(
k
- 1) +
j
*
ldvl
]
for column major layout and
vl
[(
k
- 1)*
ldvl
+ (
j
- 1)]
- i*
vl
[(
k
- 1)*
ldvl
+
j
]
for row major layout.
.
For complex flavors
:
The
k
-th component of the
j
-th left eigenvector
u
j
is stored in
vl
[(
k
- 1) + (
j
- 1)*
ldvl
]
for column major layout and in
vl
[(
k
- 1)*
ldvl
+ (
j
- 1)]
for row major layout.
vr
(size at least max(1,
ldvr
*
n
))
.
If
jobvr
=
'V'
, the right generalized eigenvectors
v
(j) are stored one after another in the columns of
vr
, in the same order as their eigenvalues. Each eigenvector will be scaled so the largest component have abs(Re) + abs(Im) = 1.
If
jobvr
=
'N'
,
vr
is not referenced.
For real flavors
:
If the j-th eigenvalue is real, then
the
k
-th component of the
j
-th right eigenvector
v
j
is stored in
vr
[(
k
- 1) + (
j
- 1)*
ldvr
]
for column major layout and in
vr
[(
k
- 1)*
ldvr
+ (
j
- 1)]
for row major layout.
.
If the j-th and (j+1)-st eigenvalues form a complex conjugate pair, then
The
k
-th components of the
j
-th right eigenvector
v
j
can be computed as
vr
[(
k
- 1) + (
j
- 1)*
ldvr
]
+ i*
vr
[(
k
- 1) +
j
*
ldvr
]
for column major layout and
vr
[(
k
- 1)*
ldvr
+ (
j
- 1)]
+ i*
vr
[(
k
- 1)*
ldvr
+
j
]
for row major layout. Respectively, the
k
-th components of right eigenvector
j
+1
v
j
+ 1
can be computed as
vr
[(
k
- 1) + (
j
- 1)*
ldvr
]
- i*
vr
[(
k
- 1) +
j
*
ldvr
]
for column major layout and
vr
[(
k
- 1)*
ldvr
+ (