Giter Club home page Giter Club logo

Comments (7)

jishnub avatar jishnub commented on August 11, 2024
julia> using SparseArrays

julia> sparse(A)
6×6 SparseMatrixCSC{Float64, Int64} with 12 stored entries:
 2.0  5.0  5.0            
 2.0  5.0  5.0            
 2.0  5.0  5.0            
             8.0        
                 8.0    
                     8.0

julia> sparse(A) |> bandwidths
(2, 2)

Why are you expecting (3,3) btw?

from bandedmatrices.jl.

338rajesh avatar 338rajesh commented on August 11, 2024

yeah, I agree it must be (2, 2) not (3,3).

It is working for SparseArray type but not with dense matrices as I have mentioned in the question.
I am not sure, if it is intentionally designed to work in that way for any advantage.

I confirm the same behavior with the new version of the package.

from bandedmatrices.jl.

dlfivefifty avatar dlfivefifty commented on August 11, 2024

bandwidths should be “fast”. Checking every entry is an O(n^2) operation

from bandedmatrices.jl.

MikaelSlevinsky avatar MikaelSlevinsky commented on August 11, 2024

How can you get the bandwidths of a dense matrix without checking for the zeros?

from bandedmatrices.jl.

dlfivefifty avatar dlfivefifty commented on August 11, 2024

bandwidths is about structural zeros not actual zeros. So you just assume it’s full

from bandedmatrices.jl.

MikaelSlevinsky avatar MikaelSlevinsky commented on August 11, 2024

Maybe it needs info in the docs because, for example, rank of a dense matrix is slow, based on svdvals, but it could have been "generically" full. Contrast that to rank of a LowRankMatrix which is fast and structural by the type.

from bandedmatrices.jl.

dlfivefifty avatar dlfivefifty commented on August 11, 2024

If you make a PR to the docs I’ll merge it

from bandedmatrices.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.