Skip to content

Commit b67d7da

Browse files
committed
Add docs
1 parent 4fde592 commit b67d7da

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

src/prelude.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
21
pub use vector::Norm;
32
pub use matrix::Matrix;
43
pub use square::SquareMatrix;
54
pub use hermite::HermiteMatrix;
6-
pub use triangular::{SolveTriangular, drop_lower, drop_upper};
7-
pub use util::{all_close_l1, all_close_l2, all_close_max};
5+
pub use triangular::*;
6+
pub use util::*;

src/triangular.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
//! Define methods for triangular matrices
12
23
use ndarray::*;
34
use super::matrix::{Matrix, MFloat};

src/util.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
//! misc utilities
12
23
use std::iter::Sum;
34
use ndarray::*;
@@ -32,6 +33,7 @@ pub fn vstack<A, S>(xs: &[ArrayBase<S, Ix1>]) -> Result<Array<A, Ix2>, ShapeErro
3233
stack(Axis(0), &views)
3334
}
3435

36+
/// check two arrays are close in maximum norm
3537
pub fn all_close_max<A, Tol, S1, S2, D>(test: &ArrayBase<S1, D>,
3638
truth: &ArrayBase<S2, D>,
3739
atol: Tol)
@@ -46,6 +48,7 @@ pub fn all_close_max<A, Tol, S1, S2, D>(test: &ArrayBase<S1, D>,
4648
if tol < atol { Ok(tol) } else { Err(tol) }
4749
}
4850

51+
/// check two arrays are close in L1 norm
4952
pub fn all_close_l1<A, Tol, S1, S2, D>(test: &ArrayBase<S1, D>, truth: &ArrayBase<S2, D>, rtol: Tol) -> Result<Tol, Tol>
5053
where A: LinalgScalar + NormedField<Output = Tol>,
5154
Tol: Float + Sum,
@@ -57,6 +60,7 @@ pub fn all_close_l1<A, Tol, S1, S2, D>(test: &ArrayBase<S1, D>, truth: &ArrayBas
5760
if tol < rtol { Ok(tol) } else { Err(tol) }
5861
}
5962

63+
/// check two arrays are close in L2 norm
6064
pub fn all_close_l2<A, Tol, S1, S2, D>(test: &ArrayBase<S1, D>, truth: &ArrayBase<S2, D>, rtol: Tol) -> Result<Tol, Tol>
6165
where A: LinalgScalar + NormedField<Output = Tol>,
6266
Tol: Float + Sum,

0 commit comments

Comments
 (0)