Skip to content

Commit 1abe240

Browse files
committed
Add document for opnorm
1 parent 52a504f commit 1abe240

File tree

3 files changed

+38
-2
lines changed

3 files changed

+38
-2
lines changed

lax/src/lib.rs

+35-1
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,41 @@ pub trait Lapack: Triangular_ + Tridiagonal_ {
262262
/// `anorm` should be the 1-norm of the matrix `a`.
263263
fn rcond(l: MatrixLayout, a: &[Self], anorm: Self::Real) -> Result<Self::Real>;
264264

265-
/// Compute operator norm of a matrix
265+
/// Compute norm of matrices
266+
///
267+
/// For a $n \times m$ matrix
268+
/// $$
269+
/// A = \begin{pmatrix}
270+
/// a_{11} & \cdots & a_{1m} \\\\
271+
/// \vdots & \ddots & \vdots \\\\
272+
/// a_{n1} & \cdots & a_{nm}
273+
/// \end{pmatrix}
274+
/// $$
275+
/// LAPACK can compute three types of norms:
276+
///
277+
/// - Operator norm based on 1-norm for its domain linear space:
278+
/// $$
279+
/// \Vert A \Vert_1 = \sup_{\Vert x \Vert_1 = 1} \Vert Ax \Vert_1
280+
/// = \max_{1 \le j \le m } \sum_{i=1}^n |a_{ij}|
281+
/// $$
282+
/// where
283+
/// $\Vert x\Vert_1 = \sum_{j=1}^m |x_j|$
284+
/// is 1-norm for a vector $x$.
285+
///
286+
/// - Operator norm based on $\infty$-norm for its domain linear space:
287+
/// $$
288+
/// \Vert A \Vert_\infty = \sup_{\Vert x \Vert_\infty = 1} \Vert Ax \Vert_\infty
289+
/// = \max_{1 \le i \le n } \sum_{j=1}^m |a_{ij}|
290+
/// $$
291+
/// where
292+
/// $\Vert x\Vert_\infty = \max_{j=1}^m |x_j|$
293+
/// is $\infty$-norm for a vector $x$.
294+
///
295+
/// - Frobenious norm
296+
/// $$
297+
/// \Vert A \Vert_F = \sqrt{\mathrm{Tr} \left(AA^\dagger\right)} = \sqrt{\sum_{i=1}^n \sum_{j=1}^m |a_{ij}|^2}
298+
/// $$
299+
///
266300
fn opnorm(t: NormType, l: MatrixLayout, a: &[Self]) -> Self::Real;
267301
}
268302

lax/src/opnorm.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
//! Operator norms of matrices
1+
//! Operator norm
22
33
use super::{AsPtr, NormType};
44
use crate::{layout::MatrixLayout, *};

lax/src/rcond.rs

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
//! Reciprocal conditional number
2+
13
use crate::{error::*, layout::MatrixLayout, *};
24
use cauchy::*;
35
use num_traits::Zero;

0 commit comments

Comments
 (0)