1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
//! Sparse Cholesky modifications (rank-1 updates and downdates).
//!
//! This module implements efficient rank-1 and low-rank modifications to
//! an existing Cholesky factorization, avoiding the cost of a full
//! re-factorization when a symmetric positive-definite matrix A = L L^T
//! is perturbed by a low-rank term.
//!
//! # Supported operations
//!
//! | Operation | Function | Formula |
//! |-----------|----------|---------|
//! | Rank-1 update | [`cholesky_rank1_update`] | A' = A + α u u^T |
//! | Rank-1 downdate | [`cholesky_rank1_downdate`] | A' = A − α u u^T |
//! | Multi-rank update | [`cholesky_rank_k_update`] | A' = A + Σ w_i v_i v_i^T |
//! | Low-rank W D W^T | [`cholesky_low_rank_update`] | A' = A + W D W^T |
//!
//! # Example
//!
//! ```
//! use scirs2_sparse::cholesky_update::{cholesky_factorize, cholesky_rank1_update};
//!
//! let a = vec![
//! vec![4.0, 2.0],
//! vec![2.0, 5.0],
//! ];
//! let l = cholesky_factorize(&a).expect("factorize");
//! let u = vec![1.0, 0.5];
//! let l_new = cholesky_rank1_update(&l, &u, 1.0).expect("update");
//! ```
//!
//! # References
//!
//! - Gill, Golub, Murray, Saunders (1974). "Methods for modifying matrix
//! factorizations." *Math. Comp.* 28(126).
//! - Stewart (1979). "The effects of rounding error on an algorithm for
//! downdating a Cholesky factorization." *IMA J. Appl. Math.* 23(2).
/// Types and configuration for Cholesky modifications.
/// Rank-1 Cholesky update via Givens rotations.
/// Rank-1 Cholesky downdate via hyperbolic Givens rotations.
/// Multiple rank-1 and low-rank Cholesky updates.
// Re-exports for convenience
pub use ;
pub use ;
pub use ;
pub use ;