Skip to content

Commit 0d9e76d

Browse files
committed
Fill module documents
1 parent 183c470 commit 0d9e76d

21 files changed

+30
-38
lines changed

src/cholesky.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
//! Cholesky decomposition
12
23
use ndarray::*;
34
use num_traits::Zero;

src/eigh.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
//! Eigenvalue decomposition for Hermite matrices
12
23
use ndarray::*;
34

src/generate.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
//! Generator functions for matrices
12
23
use ndarray::*;
34
use std::ops::*;

src/lapack_traits/cholesky.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//! implement Cholesky decomposition
1+
//! Cholesky decomposition
22
33
use lapack::c;
44

src/lapack_traits/eigh.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
//! Eigenvalue decomposition for Hermite matrices
12
23
use lapack::c;
34
use num_traits::Zero;
@@ -8,6 +9,7 @@ use layout::Layout;
89

910
use super::{into_result, UPLO};
1011

12+
/// Wraps `*syev` for real and `*heev` for complex
1113
pub trait Eigh_: AssociatedReal {
1214
fn eigh(calc_eigenvec: bool, Layout, UPLO, a: &mut [Self]) -> Result<Vec<Self::Real>>;
1315
}

src/lapack_traits/mod.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
//! Define traits wrapping LAPACK routines
12
23
pub mod opnorm;
34
pub mod qr;
@@ -33,6 +34,7 @@ pub fn into_result<T>(info: i32, val: T) -> Result<T> {
3334
}
3435
}
3536

37+
/// Upper/Lower specification for seveal usages
3638
#[derive(Debug, Clone, Copy)]
3739
#[repr(u8)]
3840
pub enum UPLO {

src/lapack_traits/opnorm.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//! Implement Operator norms for matrices
1+
//! Operator norms of matrices
22
33
use lapack::c;
44
use lapack::c::Layout::ColumnMajor as cm;

src/lapack_traits/qr.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//! Implement QR decomposition
1+
//! QR decomposition
22
33
use std::cmp::min;
44
use num_traits::Zero;
@@ -10,6 +10,7 @@ use layout::Layout;
1010

1111
use super::into_result;
1212

13+
/// Wraps `*geqrf` and `*orgqr` (`*ungqr` for complex numbers)
1314
pub trait QR_: Sized {
1415
fn householder(Layout, a: &mut [Self]) -> Result<Vec<Self>>;
1516
fn q(Layout, a: &mut [Self], tau: &[Self]) -> Result<()>;

src/lapack_traits/solve.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
//! Solve linear problem using LU decomposition
12
23
use lapack::c;
34

@@ -9,6 +10,7 @@ use super::{Transpose, into_result};
910

1011
pub type Pivot = Vec<i32>;
1112

13+
/// Wraps `*getrf`, `*getri`, and `*getrs`
1214
pub trait Solve_: Sized {
1315
fn lu(Layout, a: &mut [Self]) -> Result<Pivot>;
1416
fn inv(Layout, a: &mut [Self], &Pivot) -> Result<()>;

src/lapack_traits/svd.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//! Implement Operator norms for matrices
1+
//! Singular-value decomposition
22
33
use lapack::c;
44
use num_traits::Zero;
@@ -17,12 +17,17 @@ enum FlagSVD {
1717
No = b'N',
1818
}
1919

20+
/// Result of SVD
2021
pub struct SVDOutput<A: AssociatedReal> {
22+
/// diagonal values
2123
pub s: Vec<A::Real>,
24+
/// Unitary matrix for destination space
2225
pub u: Option<Vec<A>>,
26+
/// Unitary matrix for departure space
2327
pub vt: Option<Vec<A>>,
2428
}
2529

30+
/// Wraps `*gesvd`
2631
pub trait SVD_: AssociatedReal {
2732
fn svd(Layout, calc_u: bool, calc_vt: bool, a: &mut [Self]) -> Result<SVDOutput<Self>>;
2833
}

0 commit comments

Comments
 (0)