Skip to content

Commit fdbdc3c

Browse files
committed
Update document of Eig_ and Eigh_ traits
1 parent 4fe45f9 commit fdbdc3c

File tree

3 files changed

+35
-23
lines changed

3 files changed

+35
-23
lines changed

lax/src/eig.rs

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,19 @@
1-
//! Eigenvalue decomposition for general matrices
2-
31
use crate::{error::*, layout::MatrixLayout, *};
42
use cauchy::*;
53
use num_traits::{ToPrimitive, Zero};
64

7-
/// Wraps `*geev` for general matrices
5+
#[cfg_attr(doc, katexit::katexit)]
6+
/// Solve eigenvalue problem for general matrices
87
pub trait Eig_: Scalar {
9-
/// Calculate Right eigenvalue
8+
/// Compute right eigenvalue and eigenvectors $Ax = \lambda x$
9+
///
10+
/// LAPACK correspondance
11+
/// ----------------------
12+
///
13+
/// | f32 | f64 | c32 | c64 |
14+
/// |:------|:------|:------|:------|
15+
/// | sgeev | dgeev | cgeev | zgeev |
16+
///
1017
fn eig(
1118
calc_v: bool,
1219
l: MatrixLayout,

lax/src/eigh.rs

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,36 @@
1-
//! Eigenvalue decomposition for Symmetric/Hermite matrices
2-
31
use super::*;
42
use crate::{error::*, layout::MatrixLayout};
53
use cauchy::*;
64
use num_traits::{ToPrimitive, Zero};
75

6+
#[cfg_attr(doc, katexit::katexit)]
7+
/// Solve eigenvalue problem for symmetric/hermite matrices
88
pub trait Eigh_: Scalar {
9-
/// Wraps `*syev` for real and `*heev` for complex
9+
/// Compute right eigenvalue and eigenvectors $Ax = \lambda x$
10+
///
11+
/// LAPACK correspondance
12+
/// ----------------------
13+
///
14+
/// | f32 | f64 | c32 | c64 |
15+
/// |:------|:------|:------|:------|
16+
/// | ssyev | dsyev | cheev | zheev |
17+
///
1018
fn eigh(
1119
calc_eigenvec: bool,
1220
layout: MatrixLayout,
1321
uplo: UPLO,
1422
a: &mut [Self],
1523
) -> Result<Vec<Self::Real>>;
1624

17-
/// Wraps `*sygv` for real and `*hegv` for complex
25+
/// Compute generalized right eigenvalue and eigenvectors $Ax = \lambda B x$
26+
///
27+
/// LAPACK correspondance
28+
/// ----------------------
29+
///
30+
/// | f32 | f64 | c32 | c64 |
31+
/// |:------|:------|:------|:------|
32+
/// | ssygv | dsygv | chegv | zhegv |
33+
///
1834
fn eigh_generalized(
1935
calc_eigenvec: bool,
2036
layout: MatrixLayout,

lax/src/lib.rs

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -55,22 +55,11 @@
5555
//! Eigenvalue Problem
5656
//! -------------------
5757
//!
58-
//! Solve eigenvalue problem for a matrix $A$
58+
//! According to the property input metrix,
59+
//! there are several types of eigenvalue problem API
5960
//!
60-
//! $$ Av_i = \lambda_i v_i $$
61-
//!
62-
//! or generalized eigenvalue problem
63-
//!
64-
//! $$ Av_i = \lambda_i B v_i $$
65-
//!
66-
//! | matrix type | Eigenvalue (EV) | Generalized Eigenvalue Problem (EG) |
67-
//! |:--------------------------------|:----------------|:------------------------------------|
68-
//! | General (GE) |[eig] | - |
69-
//! | Symmetric (SY) / Hermitian (HE) |[eigh] |[eigh_generalized] |
70-
//!
71-
//! [eig]: eig/trait.Eig_.html#tymethod.eig
72-
//! [eigh]: eigh/trait.Eigh_.html#tymethod.eigh
73-
//! [eigh_generalized]: eigh/trait.Eigh_.html#tymethod.eigh_generalized
61+
//! - [Eig_] trait provides methods for eigenvalue problem for general matrix.
62+
//! - [Eigh_] trait provides methods for eigenvalue problem for symmetric/hermite matrix.
7463
//!
7564
//! Singular Value Decomposition (SVD), Least square problem
7665
//! ----------------------------------------------------------

0 commit comments

Comments
 (0)