Skip to content

Commit 4597d33

Browse files
committed
feat: add matrix decomposition functions including LU, QR, Cholesky, and SVD with corresponding tests
1 parent d9192f3 commit 4597d33

3 files changed

Lines changed: 849 additions & 0 deletions

File tree

CHANGELOG.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,29 @@
186186
This uses u-substitution: since `1/x = d/dx(ln(x))`, the integral becomes
187187
`∫ h'(x)/h(x) dx = ln|h(x)|`.
188188

189+
- **Matrix Decompositions**: Added four matrix decomposition functions for
190+
numerical linear algebra:
191+
- `LUDecomposition(A)``[P, L, U]` - LU factorization with partial pivoting
192+
- `QRDecomposition(A)``[Q, R]` - QR factorization using Householder reflections
193+
- `CholeskyDecomposition(A)``L` - Cholesky factorization for positive definite matrices
194+
- `SVD(A)``[U, Σ, V]` - Singular Value Decomposition
195+
196+
```javascript
197+
ce.box(['LUDecomposition', [[4, 3], [6, 3]]]).evaluate();
198+
// → [P, L, U] where PA = LU
199+
200+
ce.box(['QRDecomposition', [[1, 2], [3, 4]]]).evaluate();
201+
// → [Q, R] where A = QR, Q orthogonal, R upper triangular
202+
203+
ce.box(['CholeskyDecomposition', [[4, 2], [2, 2]]]).evaluate();
204+
// → L where A = LL^T
205+
206+
ce.box(['SVD', [[1, 2], [3, 4]]]).evaluate();
207+
// → [U, Σ, V] where A = UΣV^T
208+
```
209+
This uses u-substitution: since `1/x = d/dx(ln(x))`, the integral becomes
210+
`∫ h'(x)/h(x) dx = ln|h(x)|`.
211+
189212
- **Multi-Argument Function Derivatives**: Added derivative support for:
190213

191214
- **Log(x, base)** - Logarithm with custom base:

0 commit comments

Comments
 (0)