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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
//! Symmetric indefinite unpivoted `U D Uᵀ` factorization.
//!
//! This factorization is the upper-triangular counterpart of `L D Lᵀ`.
//! It targets symmetric matrices whose leading reverse pivots are nonzero. When
//! a zero pivot is encountered, the correct general algorithm is symmetric
//! pivoting (for example Bunch-Kaufman), so this module reports an error rather
//! than fabricating a fallback.
//!
//! # Theorem (unpivoted UDU factorization)
//! Let `A ∈ ℝⁿˣⁿ` be symmetric and suppose each recursively computed pivot
//! `dⱼ = aⱼⱼ − Σₖ>ⱼ uⱼₖ² dₖ` is nonzero. Then there is a unit upper-triangular
//! `U` and diagonal `D` such that `A = U D Uᵀ`.
//! *Proof (constructive):* process columns from `n-1` down to `0`. Assume the
//! trailing block already satisfies
//! `A[i,j] = Σₖ≥max(i,j) uᵢₖ dₖ uⱼₖ` for indices greater than the current
//! column. The formulas
//! `dⱼ = A[j,j] − Σₖ>ⱼ uⱼₖ² dₖ` and
//! `uᵢⱼ = (A[i,j] − Σₖ>ⱼ uᵢₖuⱼₖdₖ) / dⱼ` make the equality true for every
//! entry touching column `j`. Induction reaches column `0`, so every entry of
//! `U D Uᵀ` equals `A`. ∎
//!
//! # Corollaries
//! The determinant is `det(A) = ∏ᵢ dᵢ` because `det(U)=det(Uᵀ)=1`. Linear solves
//! use two triangular solves and one diagonal scale:
//! `U y = b`, `z = D⁻¹ y`, `Uᵀ x = z`.
//!
//! Evidence tier: theorem/proof sketch in rustdoc plus value-semantic tests for
//! reconstruction, determinant, solve, inverse, invalid input, and zero-pivot
//! rejection. The implementation is generic over [`crate::RealScalar`] and executes in
//! native scalar precision.
use crateRealScalar;
use ;
/// Unpivoted symmetric `U D Uᵀ` decomposition.
/// Factor a symmetric matrix as `A = U D Uᵀ` without pivoting.
///
/// # Errors
/// `LetoError::ShapeMismatch` for non-square input.
/// `LetoError::StorageError` for non-finite entries, nonsymmetric input, or
/// a zero pivot requiring symmetric pivoting.