Skip to content

Commit

Permalink
Update document of Eig_ and Eigh_ traits
Browse files Browse the repository at this point in the history
  • Loading branch information
termoshtt committed Sep 8, 2022
1 parent 4fe45f9 commit 0d89696
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 23 deletions.
15 changes: 11 additions & 4 deletions lax/src/eig.rs
@@ -1,12 +1,19 @@
//! Eigenvalue decomposition for general matrices

use crate::{error::*, layout::MatrixLayout, *};
use cauchy::*;
use num_traits::{ToPrimitive, Zero};

/// Wraps `*geev` for general matrices
#[cfg_attr(doc, katexit::katexit)]
/// Eigenvalue problem for general matrix
pub trait Eig_: Scalar {
/// Calculate Right eigenvalue
/// Compute right eigenvalue and eigenvectors $Ax = \lambda x$
///
/// LAPACK correspondance
/// ----------------------
///
/// | f32 | f64 | c32 | c64 |
/// |:------|:------|:------|:------|
/// | sgeev | dgeev | cgeev | zgeev |
///
fn eig(
calc_v: bool,
l: MatrixLayout,
Expand Down
24 changes: 20 additions & 4 deletions lax/src/eigh.rs
@@ -1,20 +1,36 @@
//! Eigenvalue decomposition for Symmetric/Hermite matrices

use super::*;
use crate::{error::*, layout::MatrixLayout};
use cauchy::*;
use num_traits::{ToPrimitive, Zero};

#[cfg_attr(doc, katexit::katexit)]
/// Eigenvalue problem for symmetric/hermite matrix
pub trait Eigh_: Scalar {
/// Wraps `*syev` for real and `*heev` for complex
/// Compute right eigenvalue and eigenvectors $Ax = \lambda x$
///
/// LAPACK correspondance
/// ----------------------
///
/// | f32 | f64 | c32 | c64 |
/// |:------|:------|:------|:------|
/// | ssyev | dsyev | cheev | zheev |
///
fn eigh(
calc_eigenvec: bool,
layout: MatrixLayout,
uplo: UPLO,
a: &mut [Self],
) -> Result<Vec<Self::Real>>;

/// Wraps `*sygv` for real and `*hegv` for complex
/// Compute generalized right eigenvalue and eigenvectors $Ax = \lambda B x$
///
/// LAPACK correspondance
/// ----------------------
///
/// | f32 | f64 | c32 | c64 |
/// |:------|:------|:------|:------|
/// | ssygv | dsygv | chegv | zhegv |
///
fn eigh_generalized(
calc_eigenvec: bool,
layout: MatrixLayout,
Expand Down
19 changes: 4 additions & 15 deletions lax/src/lib.rs
Expand Up @@ -55,22 +55,11 @@
//! Eigenvalue Problem
//! -------------------
//!
//! Solve eigenvalue problem for a matrix $A$
//! According to the property input metrix,
//! there are several types of eigenvalue problem API
//!
//! $$ Av_i = \lambda_i v_i $$
//!
//! or generalized eigenvalue problem
//!
//! $$ Av_i = \lambda_i B v_i $$
//!
//! | matrix type | Eigenvalue (EV) | Generalized Eigenvalue Problem (EG) |
//! |:--------------------------------|:----------------|:------------------------------------|
//! | General (GE) |[eig] | - |
//! | Symmetric (SY) / Hermitian (HE) |[eigh] |[eigh_generalized] |
//!
//! [eig]: eig/trait.Eig_.html#tymethod.eig
//! [eigh]: eigh/trait.Eigh_.html#tymethod.eigh
//! [eigh_generalized]: eigh/trait.Eigh_.html#tymethod.eigh_generalized
//! - [Eig_] trait provides methods for eigenvalue problem for general matrix.
//! - [Eigh_] trait provides methods for eigenvalue problem for symmetric/hermite matrix.
//!
//! Singular Value Decomposition (SVD), Least square problem
//! ----------------------------------------------------------
Expand Down

0 comments on commit 0d89696

Please sign in to comment.