You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to use Laplacians.jl sparsify function on a Laplacian matrix (L = I - A D^{-1}), but I get an error.
The code to reproduce the error is below:
using Laplacians
n = 10
A = triu(rand(n, n))
A = A + A'
A = A - diagm(diag(A))
A = sparse(A)
d = sum(A, 2)
x = find(d)
pinvD = sparse(x, x, 1.0./d[x])
L = speye(n, n) - A * pinvD
sparsify(L)
The error message is:
WARNING: The matrix should not have any nonzero diagonal entries.
ERROR: BoundsError: attempt to access 10-element Array{Laplacians.ApproxCholPQElem{Int64},1} at index [123919728]
Stacktrace:
[1] approxCholPQDec!(::Laplacians.ApproxCholPQ{Int64}, ::Int64) at C:\Users\Rania Ibrahim.julia\v0.6\Laplacians\src\approxChol.jl:1253
[2] approxChol(::Laplacians.LLmatp{Int64,Float64}) at C:\Users\Rania Ibrahim.julia\v0.6\Laplacians\src\approxChol.jl:541
[3] #approxCholLapGreedy#189(::Float64, ::Int64, ::Float64, ::Bool, ::Array{Int64,1}, ::Laplacians.ApproxCholParams, ::Function, ::SparseMatrixCSC{Float64,Int64}) at C:\Users\Rania Ibrahim.julia\v0.6\Laplacians\src\approxChol.jl:782
[4] (::Laplacians.#kw##approxCholLapGreedy)(::Array{Any,1}, ::Laplacians.#approxCholLapGreedy, ::SparseMatrixCSC{Float64,Int64}) at .<missing>:0
[5] #approxCholLap1#205(::Float64, ::Int64, ::Float64, ::Bool, ::Array{Int64,1}, ::Laplacians.ApproxCholParams, ::Function, ::SparseMatrixCSC{Float64,Int64}) at C:\Users\Rania Ibrahim.julia\v0.6\Laplacians\src\approxChol.jl:903
[6] (::Laplacians.#kw##approxCholLap1)(::Array{Any,1}, ::Laplacians.#approxCholLap1, ::SparseMatrixCSC{Float64,Int64}) at .<missing>:0
[7] #lapWrapComponents#113(::Float64, ::Int64, ::Float64, ::Bool, ::Array{Int64,1}, ::Array{Any,1}, ::Function, ::Function, ::SparseMatrixCSC{Float64,Int64}) at C:\Users\Rania Ibrahim.julia\v0.6\Laplacians\src\solverInterface.jl:221
[8] (::Laplacians.#kw##lapWrapComponents)(::Array{Any,1}, ::Laplacians.#lapWrapComponents, ::Function, ::SparseMatrixCSC{Float64,Int64}) at .<missing>:0
[9] (::Laplacians.#kw##approxCholLap)(::Array{Any,1}, ::Laplacians.#approxCholLap, ::SparseMatrixCSC{Float64,Int64}) at .<missing>:0
[10] #sparsify#267(::Float64, ::Float64, ::Float64, ::Function, ::SparseMatrixCSC{Float64,Int64}) at C:\Users\Rania Ibrahim.julia\v0.6\Laplacians\src\sparsify.jl:21
[11] sparsify(::SparseMatrixCSC{Float64,Int64}) at C:\Users\Rania Ibrahim.julia\v0.6\Laplacians\src\sparsify.jl:17
The text was updated successfully, but these errors were encountered:
I am trying to use Laplacians.jl sparsify function on a Laplacian matrix (L = I - A D^{-1}), but I get an error.
The code to reproduce the error is below:
The error message is:
WARNING: The matrix should not have any nonzero diagonal entries.
ERROR: BoundsError: attempt to access 10-element Array{Laplacians.ApproxCholPQElem{Int64},1} at index [123919728]
Stacktrace:
[1] approxCholPQDec!(::Laplacians.ApproxCholPQ{Int64}, ::Int64) at C:\Users\Rania Ibrahim.julia\v0.6\Laplacians\src\approxChol.jl:1253
[2] approxChol(::Laplacians.LLmatp{Int64,Float64}) at C:\Users\Rania Ibrahim.julia\v0.6\Laplacians\src\approxChol.jl:541
[3] #approxCholLapGreedy#189(::Float64, ::Int64, ::Float64, ::Bool, ::Array{Int64,1}, ::Laplacians.ApproxCholParams, ::Function, ::SparseMatrixCSC{Float64,Int64}) at C:\Users\Rania Ibrahim.julia\v0.6\Laplacians\src\approxChol.jl:782
[4] (::Laplacians.#kw##approxCholLapGreedy)(::Array{Any,1}, ::Laplacians.#approxCholLapGreedy, ::SparseMatrixCSC{Float64,Int64}) at .<missing>:0
[5] #approxCholLap1#205(::Float64, ::Int64, ::Float64, ::Bool, ::Array{Int64,1}, ::Laplacians.ApproxCholParams, ::Function, ::SparseMatrixCSC{Float64,Int64}) at C:\Users\Rania Ibrahim.julia\v0.6\Laplacians\src\approxChol.jl:903
[6] (::Laplacians.#kw##approxCholLap1)(::Array{Any,1}, ::Laplacians.#approxCholLap1, ::SparseMatrixCSC{Float64,Int64}) at .<missing>:0
[7] #lapWrapComponents#113(::Float64, ::Int64, ::Float64, ::Bool, ::Array{Int64,1}, ::Array{Any,1}, ::Function, ::Function, ::SparseMatrixCSC{Float64,Int64}) at C:\Users\Rania Ibrahim.julia\v0.6\Laplacians\src\solverInterface.jl:221
[8] (::Laplacians.#kw##lapWrapComponents)(::Array{Any,1}, ::Laplacians.#lapWrapComponents, ::Function, ::SparseMatrixCSC{Float64,Int64}) at .<missing>:0
[9] (::Laplacians.#kw##approxCholLap)(::Array{Any,1}, ::Laplacians.#approxCholLap, ::SparseMatrixCSC{Float64,Int64}) at .<missing>:0
[10] #sparsify#267(::Float64, ::Float64, ::Float64, ::Function, ::SparseMatrixCSC{Float64,Int64}) at C:\Users\Rania Ibrahim.julia\v0.6\Laplacians\src\sparsify.jl:21
[11] sparsify(::SparseMatrixCSC{Float64,Int64}) at C:\Users\Rania Ibrahim.julia\v0.6\Laplacians\src\sparsify.jl:17
The text was updated successfully, but these errors were encountered: