Skip to content

Commit af5eac2

Browse files
committed
WIP: Update document of solveh.rs
Drop module-level doc in solveh.rs
1 parent fe5deea commit af5eac2

File tree

1 file changed

+30
-5
lines changed

1 file changed

+30
-5
lines changed

lax/src/solveh.rs

Lines changed: 30 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,38 @@
1-
//! Solve symmetric linear problem using the Bunch-Kaufman diagonal pivoting method.
2-
//!
3-
//! See also [the manual of dsytrf](http://www.netlib.org/lapack/lapack-3.1.1/html/dsytrf.f.html)
4-
51
use crate::{error::*, layout::MatrixLayout, *};
62
use cauchy::*;
73
use num_traits::{ToPrimitive, Zero};
84

5+
#[cfg_attr(doc, katexit::katexit)]
6+
/// Solve symmetric/hermite indefinite linear problem using the [Bunch-Kaufman diagonal pivoting method][BK].
7+
///
8+
/// For a given symmetric matrix $A$,
9+
/// this method factorizes $A = U^T D U$ or $A = L D L^T$ where
10+
///
11+
/// - $U$ (or $L$) are is a product of permutation and unit upper (lower) triangular matrices
12+
/// - $D$ is symmetric and block diagonal with 1-by-1 and 2-by-2 diagonal blocks.
13+
///
14+
/// This takes two-step approach based in LAPACK:
15+
///
16+
/// 1. Factorize given matrix $A$ into upper ($U$) or lower ($L$) form with diagonal matrix $D$
17+
/// 2. Then solve linear equation $Ax = b$, and/or calculate inverse matrix $A^{-1}$
18+
///
19+
/// [BK]: https://doi.org/10.2307/2005787
20+
///
921
pub trait Solveh_: Sized {
10-
/// Bunch-Kaufman: wrapper of `*sytrf` and `*hetrf`
22+
/// Factorize input matrix using Bunch-Kaufman diagonal pivoting method
23+
///
24+
/// LAPACK correspondance
25+
/// ----------------------
26+
///
27+
/// | f32 | f64 | c32 | c64 |
28+
/// |:---------|:---------|:---------|:---------|
29+
/// | [ssytrf] | [dsytrf] | [chetrf] | [zhetrf] |
30+
///
31+
/// [ssytrf]: https://netlib.org/lapack/explore-html/d0/d14/group__real_s_ycomputational_ga12d2e56511cf7df066712c61d9acec45.html
32+
/// [dsytrf]: https://netlib.org/lapack/explore-html/d3/db6/group__double_s_ycomputational_gad91bde1212277b3e909eb6af7f64858a.html
33+
/// [chetrf]: https://netlib.org/lapack/explore-html/d4/d74/group__complex_h_ecomputational_ga081dd1908e46d064c2bf0a1f6b664b86.html
34+
/// [zhetrf]: https://netlib.org/lapack/explore-html/d3/d80/group__complex16_h_ecomputational_gadc84a5c9818ee12ea19944623131bd52.html
35+
///
1136
fn bk(l: MatrixLayout, uplo: UPLO, a: &mut [Self]) -> Result<Pivot>;
1237
/// Wrapper of `*sytri` and `*hetri`
1338
fn invh(l: MatrixLayout, uplo: UPLO, a: &mut [Self], ipiv: &Pivot) -> Result<()>;

0 commit comments

Comments
 (0)