Contents

# ?ggev

Computes the generalized eigenvalues, and the left and/or right generalized eigenvectors for a pair of nonsymmetric matrices.

## Syntax

Include Files
• mkl.h
Description
The
?ggev
routine computes the generalized eigenvalues, and optionally, the left and/or right generalized eigenvectors for a pair of
n
-by-
n
real/complex nonsymmetric matrices (
A
,
B
).
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)
.
The
?ggev
routine replaces the deprecated
?gegv
routine.
Input Parameters
matrix_layout
Specifies whether matrix storage layout is row major (
LAPACK_ROW_MAJOR
) or column major (
LAPACK_COL_MAJOR
).
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.
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.
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
, are 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
, are the generalized eigenvalues.
See also
Application Notes
below.
vl
,
vr
Arrays:
vl
(size at least max(1,
ldvl
*
n
))
. Contains the matrix of left generalized eigenvectors
VL
.
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 is scaled so the largest component has
abs(Re) + abs(Im) = 1
.
If
jobvl
=
'N'
,
vl
is not referenced.
For real flavors
:
If the j-th eigenvalue is real,
then 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.
.
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
are
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 left eigenvector
j
+1
u
j+1
are
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
))
. Contains the matrix of right generalized eigenvectors
VR
.
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 is scaled so the largest component has 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. Similarly, the
k
-th components of the 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
+ (
j
- 1)]
- i*
vr
[(
k
- 1)*
ldvr
+
j
]
for row major layout.
.
For complex flavors
:
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.
Return Values
This function returns a value
info
.
If
info
=0
, the execution is successful.
If
info
=
-i
, the