Giter Site home page Giter Site logo

moyner / iluzero.jl Goto Github PK

View Code? Open in Web Editor NEW

This project forked from mcovalt/iluzero.jl

0.0 0.0 0.0 32 KB

A Julia implementation of incomplete LU factorization with zero level of fill in. Compatible with ForwardDiff.jl.

License: MIT License

Julia 100.00%

iluzero.jl's Introduction

ILUZero.jl

ILUZero.jl is a Julia implementation of incomplete LU factorization with zero level of fill-in. It allows for non-allocating updates of the factorization. The module is compatible with ForwardDiff.jl.

Requirements

  • Julia 1.0 and up

Installation

julia> ]
pkg> add ILUZero

Why use ILUZero.jl?

You probably shouldn't. Julia's built in factorization methods are much better. Julia uses SuiteSparse for sparse matrix factorization which factorizes at about nearly the same speed and results in similarly sized preconditioners which are much more robust. In addition, Julia uses heuristics to determine a good factorization scheme for your matrix automatically.

Due to the zero-fill of this package, however, factorization should be a bit faster and preconditioners can be preallocated if updated by a matrix of identical sparsity.

How to use

julia> using ILUZero
  • LU = ilu0(A): Create a factorization based on a sparse matrix A
  • ilu0!(LU, A): Update factorization LU in-place based on a sparse matrix A. This assumes the original factorization was created with another sparse matrix with the exact same sparsity pattern as A. No check is made for this.
  • To solve for x in (LU)x=b, use the same methods as you typically would: \ or ldiv!(x, LU, b). See the docs for further information.
  • There's also:
    • Forward substitution: forward_substitution!(y, LU, b) solves L\b and stores the solution in y.
    • Backward substitution: backward_substitution!(x, LU, y) solves U\y and stores the solution in x.
    • Nonzero count: nnz(LU) will return the number of nonzero entries in LU.

Performance

julia> using ILUZero
julia> using BenchmarkTools, LinearAlgebra, SparseArrays
julia> A = sprand(1000, 1000, 5 / 1000) + 10I
julia> fact = @btime ilu0(A)
       107.600 μs (16 allocations: 160.81 KiB)
julia> updated_fact = @btime ilu0!($fact, $A)
       71.500 μs (0 allocations: 0 bytes)

iluzero.jl's People

Contributors

amontoison avatar mcovalt avatar moyner avatar pazner avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.