Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incompatible with spy #47

Open
ChrisRackauckas opened this issue Oct 31, 2019 · 3 comments
Open

Incompatible with spy #47

ChrisRackauckas opened this issue Oct 31, 2019 · 3 comments

Comments

@ChrisRackauckas
Copy link

using FillArrays, BlockBandedMatrices
l,u = 1,1          # block bandwidths
N = M = 2          # number of row/column blocks
cols = rows = 1:N  # block sizes
jac_bbm = BlockBandedMatrix(Ones(sum(rows),sum(cols)), (rows,cols), (l,u)) # creates a block-banded matrix with ones in the non-zero entries                        # creates a block-banded  identity matrix
using Plots
spy(jac_bbm,markersize=1,colorbar=false,color=:deep)
MethodError: no method matching findnz(::BlockSkylineMatrix{Float64,Array{Float64,1},BlockBandedMatrices.BlockSkylineSizes{BlockArrays.BlockSizes{2,Tuple{Array{Int64,1},Array{Int64,1}}},Fill{Int64,1,Tuple{Base.OneTo{Int64}}},Fill{Int64,1,Tuple{Base.OneTo{Int64}}},BandedMatrices.BandedMatrix{Int64,Array{Int64,2},Base.OneTo{Int64}},Array{Int64,1}}})
Closest candidates are:
  findnz(!Matched::SparseMatrixCSC{Tv,Ti}) where {Tv, Ti} at C:\cygwin\home\Administrator\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.2\SparseArrays\src\sparsematrix.jl:1299
  findnz(!Matched::SparseVector{Tv,Ti}) where {Tv, Ti} at C:\cygwin\home\Administrator\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.2\SparseArrays\src\sparsevector.jl:738
macro expansion at recipes.jl:1064 [inlined]
apply_recipe(::Dict{Symbol,Any}, ::Type{Val{:spy}}, ::Array{Float64,1}, ::Array{Float64,1}, ::Surface{BlockSkylineMatrix{Float64,Array{Float64,1},BlockBandedMatrices.BlockSkylineSizes{BlockArrays.BlockSizes{2,Tuple{Array{Int64,1},Array{Int64,1}}},Fill{Int64,1,Tuple{Base.OneTo{Int64}}},Fill{Int64,1,Tuple{Base.OneTo{Int64}}},BandedMatrices.BandedMatrix{Int64,Array{Int64,2},Base.OneTo{Int64}},Array{Int64,1}}}}) at RecipesBase.jl:275
_process_seriesrecipe(::Plots.Plot{Plots.GRBackend}, ::Dict{Symbol,Any}) at pipeline.jl:408
_plot!(::Plots.Plot{Plots.GRBackend}, ::Dict{Symbol,Any}, ::Tuple{Plots.Spy}) at plot.jl:234
#plot#137(::Base.Iterators.Pairs{Symbol,Any,Tuple{Symbol,Symbol,Symbol},NamedTuple{(:markersize, :colorbar, :color),Tuple{Int64,Bool,Symbol}}}, ::typeof(plot), ::Plots.Spy) at plot.jl:57
#plot at none:0 [inlined]
#spy#230 at RecipesBase.jl:350 [inlined]
(::getfield(Plots, Symbol("#kw##spy")))(::NamedTuple{(:markersize, :colorbar, :color),Tuple{Int64,Bool,Symbol}}, ::typeof(spy), ::BlockSkylineMatrix{Float64,Array{Float64,1},BlockBandedMatrices.BlockSkylineSizes{BlockArrays.BlockSizes{2,Tuple{Array{Int64,1},Array{Int64,1}}},Fill{Int64,1,Tuple{Base.OneTo{Int64}}},Fill{Int64,1,Tuple{Base.OneTo{Int64}}},BandedMatrices.BandedMatrix{Int64,Array{Int64,2},Base.OneTo{Int64}},Array{Int64,1}}}) at none:0
top-level scope at advanced_ode_example.jmd:328
@dlfivefifty
Copy link
Member

Does this help:

SparseArrays.findnz(A::BlockBandedMatrix) = findnz(sparse(A))

It'll be slow but perhaps that's OK?

@ChrisRackauckas
Copy link
Author

Yeah, that's a fine workaround. Or spy(sparse(A)) is good too.

@dlfivefifty
Copy link
Member

Let's leave this open until that work around is added

@dlfivefifty dlfivefifty reopened this Oct 31, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants