Skip to content
This repository has been archived by the owner on Oct 8, 2021. It is now read-only.

function inneighbors does not work on directed weighted graphs #26

Closed
simonschoelly opened this issue Aug 3, 2018 · 5 comments
Closed

Comments

@simonschoelly
Copy link

using LightGraphs, SimpleWeightedGraphs
g = SimpleWeightedDiGraph(3)
inneighbors(g, 3)

> ERROR: type Adjoint has no field rowval
Stacktrace:
 [1] getproperty(::Any, ::Symbol) at ./sysimg.jl:18
 [2] inneighbors(::SimpleWeightedDiGraph{Int64,Float64}, ::Int64) at /home/simon/.julia/dev/SimpleWeightedGraphs/src/simpleweighteddigraph.jl:86
 [3] top-level scope at none:0

Using Julia 0.7 (nightly)
outneighbors(g, 3) seems to work though.

@sbromberger
Copy link
Owner

SimpleWeightedGraphs is going to suffer major breakage soon with 0.7 anyway since our unsafe view will cause segfaults.

@sbromberger
Copy link
Owner

sbromberger commented Aug 12, 2018

hm. I can't reproduce this in the latest master:

julia> g = SimpleWeightedDiGraph(3)
{3, 0} directed simple Int64 graph with Float64 weights

julia> inneighbors(g, 3)
0-element Array{Int64,1}

@sbromberger
Copy link
Owner

@simonschoelly - can you test the latest master on 1.0 for performance? I want to make sure we don't have any regressions.

@simonschoelly
Copy link
Author

I think the reason for that error was, that you had code of the form

mat  = g.weights'
mat.rowval

which does now work because mat is of type Adjoint. Now you are doing

mat = SparseMatrixCSC(g.weight')
mat.rowval

which does work. The tests for the latest master pass on 1.0. Is that what you mean by performance?

@sbromberger
Copy link
Owner

I'm going to close this out because it's fixed in master.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants