Skip to content
This repository has been archived by the owner on Aug 5, 2024. It is now read-only.

Cholesky #53

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Cholesky #53

wants to merge 2 commits into from

Conversation

peddie
Copy link
Contributor

@peddie peddie commented May 30, 2016

Adds some useful decompositions for SPD matrices:

  • LDL^T
  • UDU^T via a slightly different algorithm
  • Cholesky
  • Rank-1 updating of Cholesky factors

peddie added 2 commits May 30, 2016 21:00
 - LDL^T decomposition from Golub and Van Loan
 - UDU^T decomposition from Gibbs
 - Outer-product Cholesky decomposition from Golub and Van Loan
 - Rank-1 Cholesky update/downdate from Golub and Van Loan
for i in 0:m ->
for j in 0:n ->
if i > j then b[i, j] <- 0.0 else b[i, j] <- a[i, j];
);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(sorry the built in upper triangular matrix type requires square dimensions). one alternative expression is:
vec i in 0:m -> vec j in 0:n -> if i > j then 0.0 else a[i,j];
then write
b <- triu a

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just made this generic out of habit. All the decompositions in this module require symmetric (and therefore square) matrices. I'll try to use the built-in triangular matrix types.

I could also add the simple expression you wrote to the prelude.

@benjamin0
Copy link
Contributor

awesome!

@peddie
Copy link
Contributor Author

peddie commented Jun 1, 2016

@scottswift @annius

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants