GithubHelp home page GithubHelp logo

Comments (5)

MichelJuillard avatar MichelJuillard commented on July 16, 2024 1

Tell me if I can be of any help or if I can improve the current implementation in any way

from linearsolve.jl.

MichelJuillard avatar MichelJuillard commented on July 16, 2024

LU factorization needs two workspaces:

  • lu: a n x n matrix containing L and U triangular matrices
  • ipvt: a pivot vector with n elements
    If you want to keep the original matrix, you need the lu workspace, otherwise you only need ipvt
    Does LinearSolve.solve() keep the A matrix intact or is the replaced by the factorization?
    Note also, that in the case of LU factorization, Lapack doesn't need a first pass to compute the size of the workspace as it is self evident here.

from linearsolve.jl.

rayegun avatar rayegun commented on July 16, 2024

By default it does a deepcopy unless you pass alias_A=true to init in common.jl. Then it does lu!, which (I believe) is destructive to that copy held in the LinearCache.

from linearsolve.jl.

ChrisRackauckas avatar ChrisRackauckas commented on July 16, 2024

Yeah for safety it defaults to copying, but the keyword argument alias_A = true turns that off. When that argument is true, we are free to modify the original A how we please.

from linearsolve.jl.

MichelJuillard avatar MichelJuillard commented on July 16, 2024

I. In factorization.jl:41

  • A is the object in which we store the factorization
  • we need an additional vector to store the pivots
  • then we call xgetrf_ to compute the factorization (small improvement with respect to Base.lu!(), the pivot vector is allocated once for all problems with the same size)

II. If the factorization is stored in A by xgetrf_, we need to call xgetrs_ to actually solve the linear problem instead of Base.ldiv!() that expects a Base.LU object

from linearsolve.jl.

Related Issues (20)

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.