Skip to content

Commit 7d49905

Browse files
committed
document eigvals
1 parent 1c1a33f commit 7d49905

File tree

1 file changed

+25
-12
lines changed

1 file changed

+25
-12
lines changed

doc/specs/stdlib_linalg.md

Lines changed: 25 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1089,32 +1089,45 @@ If `err` is not present, exceptions trigger an `error stop`.
10891089

10901090
### Status
10911091

1092-
Stable
1092+
Experimental
10931093

10941094
### Description
10951095

1096-
This function returns the eigenvalues to matrix \( A \): a square, full-rank, `real` or `complex` matrix.
1097-
The eigenvalues are solutions to the eigenproblem \( A \cdot \bar{v} - \lambda \cdot \bar{v} \).
1096+
This function computes the eigenvalues for either a standard or generalized eigenproblem:
1097+
1098+
- **Standard eigenproblem**: \( A \cdot \bar{v} - \lambda \cdot \bar{v} \), where \( A \) is a square, full-rank `real` or `complex` matrix.
1099+
- **Generalized eigenproblem**: \( A \cdot \bar{v} - \lambda \cdot B \cdot \bar{v} \), where \( B \) is a square matrix with the same type and kind as \( A \).
10981100

1099-
Result array `lambda` is `complex`, and returns the eigenvalues of \( A \).
1100-
The solver is based on LAPACK's `*GEEV` backends.
1101+
The eigenvalues are stored in the result array `lambda`, which is `complex` (even for real input matrices).
1102+
The solver uses LAPACK's `*GEEV` and `*GGEV` backends for the standard and generalized problems, respectively.
11011103

11021104
### Syntax
11031105

1104-
`lambda = ` [[stdlib_linalg(module):eigvals(interface)]] `(a, [,err])`
1106+
For the standard eigenproblem:
1107+
1108+
`lambda = ` [[stdlib_linalg(module):eigvals(interface)]] `(a [, err])`
1109+
1110+
For the generalized eigenproblem:
1111+
1112+
`lambda = ` [[stdlib_linalg(module):eigvals(interface)]] `(a, b [, err])`
11051113

11061114
### Arguments
11071115

1108-
`a` : `real` or `complex` square array containing the coefficient matrix. It is an `intent(in)` argument.
1116+
`a`:
1117+
Shall be a `real` or `complex` square array containing the coefficient matrix. It is an `intent(in)` argument.
11091118

1110-
`err` (optional): Shall be a `type(linalg_state_type)` value. This is an `intent(out)` argument.
1119+
`b` (optional):
1120+
Shall be a `real` or `complex` square array containing the second coefficient matrix for the generalized problem. It is an `intent(in)` argument.
11111121

1112-
### Return value
1122+
`err` (optional):
1123+
Shall be a `type(linalg_state_type)` value. This is an `intent(out)` argument.
11131124

1114-
Returns a `complex` array containing the eigenvalues of `a`.
1125+
### Return Value
11151126

1116-
Raises `LINALG_ERROR` if the calculation did not converge.
1117-
Raises `LINALG_VALUE_ERROR` if any matrix or arrays have invalid/incompatible sizes.
1127+
Returns a `complex` rank-1 array containing the eigenvalues of the problem.
1128+
1129+
Raises `LINALG_ERROR` if the calculation did not converge.
1130+
Raises `LINALG_VALUE_ERROR` if any matrix or arrays have invalid/incompatible sizes.
11181131
If `err` is not present, exceptions trigger an `error stop`.
11191132

11201133
### Example

0 commit comments

Comments
 (0)