Skip to content

Commit 1ea3a76

Browse files
committed
Update document of solveh.rs
1 parent fe5deea commit 1ea3a76

File tree

1 file changed

+60
-7
lines changed

1 file changed

+60
-7
lines changed

lax/src/solveh.rs

Lines changed: 60 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,70 @@
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>;
12-
/// Wrapper of `*sytri` and `*hetri`
37+
38+
/// Compute inverse matrix $A^{-1}$ from factroized result
39+
///
40+
/// LAPACK correspondance
41+
/// ----------------------
42+
///
43+
/// | f32 | f64 | c32 | c64 |
44+
/// |:---------|:---------|:---------|:---------|
45+
/// | [ssytri] | [dsytri] | [chetri] | [zhetri] |
46+
///
47+
/// [ssytri]: https://netlib.org/lapack/explore-html/d0/d14/group__real_s_ycomputational_gaef378ec0761234aac417f487b43b7a8b.html
48+
/// [dsytri]: https://netlib.org/lapack/explore-html/d3/db6/group__double_s_ycomputational_ga75e09b4299b7955044a3bbf84c46b593.html
49+
/// [chetri]: https://netlib.org/lapack/explore-html/d4/d74/group__complex_h_ecomputational_gad87a6a1ac131c5635d47ac440e672bcf.html
50+
/// [zhetri]: https://netlib.org/lapack/explore-html/d3/d80/group__complex16_h_ecomputational_ga4d9cfa0653de400029b8051996ce1e96.html
51+
///
1352
fn invh(l: MatrixLayout, uplo: UPLO, a: &mut [Self], ipiv: &Pivot) -> Result<()>;
14-
/// Wrapper of `*sytrs` and `*hetrs`
53+
54+
/// Solve linear equation $Ax = b$ using factroized result
55+
///
56+
/// LAPACK correspondance
57+
/// ----------------------
58+
///
59+
/// | f32 | f64 | c32 | c64 |
60+
/// |:---------|:---------|:---------|:---------|
61+
/// | [ssytrs] | [dsytrs] | [chetrs] | [zhetrs] |
62+
///
63+
/// [ssytrs]: https://netlib.org/lapack/explore-html/d0/d14/group__real_s_ycomputational_gae20133a1119b69a7319783ff982c8c62.html
64+
/// [dsytrs]: https://netlib.org/lapack/explore-html/d3/db6/group__double_s_ycomputational_ga6a223e61effac7232e98b422f147f032.html
65+
/// [chetrs]: https://netlib.org/lapack/explore-html/d4/d74/group__complex_h_ecomputational_ga6f9d8da222ffaa7b7535efc922faa1dc.html
66+
/// [zhetrs]: https://netlib.org/lapack/explore-html/d3/d80/group__complex16_h_ecomputational_gacf697e3bb72c5fd88cd90972999401dd.html
67+
///
1568
fn solveh(l: MatrixLayout, uplo: UPLO, a: &[Self], ipiv: &Pivot, b: &mut [Self]) -> Result<()>;
1669
}
1770

0 commit comments

Comments
 (0)