Skip to content

Latest commit

 

History

History
30 lines (25 loc) · 628 Bytes

README.md

File metadata and controls

30 lines (25 loc) · 628 Bytes

IncompleteSelectedInversion

Example usage:

# Load package
using IncompleteSelectedInversion

# Parameters
n = 10
c = n    # Cut-off level-of-fill. c = n is complete factorisation
τ = 0.0  # Dropping tolerance. τ = 0.0 is complete factorisation

# Create test matrix
A = sprand(n,n,0.1)
A += A' + 5*I

# Factorise and invert
F  = ldlt(A) 
Fc = cldlt(A,c)
Fτ = τldlt(A,τ)
B  = selinv(F)
Bc = selinv(Fc)
Bτ = selinv(Fτ)

# Check result
@show B == Bc ==# ^ prints true because we didn't actually drop anything in the incomplete factorisations
display(inv(full(A))); println()
display(full(B)); println()