From a9123fc500c7b79eae303174dc19b71e929a61d8 Mon Sep 17 00:00:00 2001 From: Seth Bromberger Date: Tue, 10 Feb 2015 12:36:12 -0800 Subject: [PATCH 1/2] Lint fixes --- src/dijkstra.jl | 2 +- src/linalg.jl | 4 ++-- src/persistence.jl | 6 +++--- src/smallgraphs.jl | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/dijkstra.jl b/src/dijkstra.jl index 1a3853bca..182d1643d 100644 --- a/src/dijkstra.jl +++ b/src/dijkstra.jl @@ -198,7 +198,7 @@ function dijkstra_shortest_paths( sources::AbstractVector{Int}; visitor::AbstractDijkstraVisitor=TrivialDijkstraVisitor()) state::DijkstraStates = create_dijkstra_states(graph) - dijkstra_shortest_paths!(graph, sources, visitor, state) + dijkstra_shortest_paths!(graph, edge_dists, sources, visitor, state) end function dijkstra_shortest_paths( diff --git a/src/linalg.jl b/src/linalg.jl index f20068239..8f2c33528 100644 --- a/src/linalg.jl +++ b/src/linalg.jl @@ -11,11 +11,11 @@ function adjacency_matrix(g::AbstractGraph) end function laplacian_matrix(g::Graph) - A = int(adjacency_matrix(g)) + A = map(Int, adjacency_matrix(g)) D = spdiagm(sum(A,2)[:]) return D - A end laplacian_spectrum(g::Graph) = eigvals(full(laplacian_matrix(g))) -adjacency_spectrum(g::AbstractGraph) = eigvals(full(int(adjacency_matrix(g)))) +adjacency_spectrum(g::AbstractGraph) = eigvals(full(map(Int, adjacency_matrix(g)))) diff --git a/src/persistence.jl b/src/persistence.jl index 7523c4ee3..63ff886ba 100644 --- a/src/persistence.jl +++ b/src/persistence.jl @@ -12,7 +12,7 @@ function readgraph(fn::AbstractString) f = GZip.open(fn,"r") # will work even if uncompressed line = chomp(readline(f)) nstr, dirundir = split (line,r"\s*,\s*") - n = int(nstr) + n = parseint(nstr) if dirundir == "u" directed = false end @@ -25,8 +25,8 @@ function readgraph(fn::AbstractString) while !eof(f) line = chomp(readline(f)) src_s, dst_s = split(line,r"\s*,\s*") - src = int(src_s) - dst = int(dst_s) + src = parseint(src_s) + dst = parseint(dst_s) add_edge!(g, src, dst) end return g diff --git a/src/smallgraphs.jl b/src/smallgraphs.jl index 3359589a6..5b1fcb976 100644 --- a/src/smallgraphs.jl +++ b/src/smallgraphs.jl @@ -38,7 +38,7 @@ # > (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE # > OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -function CompleteGraph(n::Integer; is_directed=true) +function CompleteGraph(n::Integer) g = Graph(n) for i = 1:n, j=1:n if i < j From b27abce214039a625a63b096271d2339a9ace1c9 Mon Sep 17 00:00:00 2001 From: Seth Bromberger Date: Tue, 10 Feb 2015 12:48:04 -0800 Subject: [PATCH 2/2] back to int() --- src/linalg.jl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/linalg.jl b/src/linalg.jl index 8f2c33528..f20068239 100644 --- a/src/linalg.jl +++ b/src/linalg.jl @@ -11,11 +11,11 @@ function adjacency_matrix(g::AbstractGraph) end function laplacian_matrix(g::Graph) - A = map(Int, adjacency_matrix(g)) + A = int(adjacency_matrix(g)) D = spdiagm(sum(A,2)[:]) return D - A end laplacian_spectrum(g::Graph) = eigvals(full(laplacian_matrix(g))) -adjacency_spectrum(g::AbstractGraph) = eigvals(full(map(Int, adjacency_matrix(g)))) +adjacency_spectrum(g::AbstractGraph) = eigvals(full(int(adjacency_matrix(g))))