From 0d89696569e247e9fc2e5e11445bafb2f4563d7f Mon Sep 17 00:00:00 2001 From: Toshiki Teramura Date: Thu, 8 Sep 2022 14:43:50 +0900 Subject: [PATCH] Update document of `Eig_` and `Eigh_` traits --- lax/src/eig.rs | 15 +++++++++++---- lax/src/eigh.rs | 24 ++++++++++++++++++++---- lax/src/lib.rs | 19 ++++--------------- 3 files changed, 35 insertions(+), 23 deletions(-) diff --git a/lax/src/eig.rs b/lax/src/eig.rs index d3c07222..deafba2f 100644 --- a/lax/src/eig.rs +++ b/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, diff --git a/lax/src/eigh.rs b/lax/src/eigh.rs index a9406ee6..055b2f47 100644 --- a/lax/src/eigh.rs +++ b/lax/src/eigh.rs @@ -1,12 +1,20 @@ -//! 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, @@ -14,7 +22,15 @@ pub trait Eigh_: Scalar { a: &mut [Self], ) -> Result>; - /// 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, diff --git a/lax/src/lib.rs b/lax/src/lib.rs index d7b1be4a..9a8bf1cf 100644 --- a/lax/src/lib.rs +++ b/lax/src/lib.rs @@ -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 //! ----------------------------------------------------------