From 634b0da31e94fd9ba45a16203b125af977ab0e23 Mon Sep 17 00:00:00 2001 From: pszufe Date: Fri, 8 May 2020 23:44:49 +0200 Subject: [PATCH] docs corrections --- docs/src/reference.md | 11 ++++++++--- src/conductance.jl | 1 - src/hypergraph.jl | 7 ------- src/models.jl | 6 +++--- src/twosection.jl | 2 +- 5 files changed, 12 insertions(+), 15 deletions(-) diff --git a/docs/src/reference.md b/docs/src/reference.md index 148886d..12ddf68 100644 --- a/docs/src/reference.md +++ b/docs/src/reference.md @@ -13,6 +13,10 @@ Creating a hypergraph ```@docs Hypergraph +random_model(::Int, ::Int) +random_kuniform_model(::Int, ::Int, ::Int) +random_dregular_model(::Int, ::Int, ::Int) +random_preferential_model ``` Manipulating vertices and hyperedges @@ -26,6 +30,7 @@ get_vertex_meta(::Hypergraph{T, V, E}, ::Int) where {T <: Real, V, E} set_hyperedge_meta!(::Hypergraph{T, V, E}, ::Union{E,Nothing}, ::Int) where {T <: Real, V, E} get_hyperedge_meta(::Hypergraph{T, V, E}, ::Int) where {T <: Real, V, E} remove_vertex!(::Hypergraph, ::Int) +remove_hyperedge!(::Hypergraph, ::Int) ``` Hypergraph array getters and setters @@ -77,11 +82,11 @@ gethyperedges(::Hypergraph, ::Int) get_connected_components(::Hypergraph) conductance(::Hypergraph, ::Set{Int}) -modularity(::Hypergraph, ::Vector{Set{Int}}, ::SimpleHypergraphs.HypergraphAggs) -random_walk(::Hypergraph, ::Int; heselect::Function, vselect::Function) - +get_twosection_adjacency_mx random_walk(::Hypergraph, ::Int; ::Function, ::Function) +modularity(::Hypergraph, ::Vector{Set{Int}}, ::SimpleHypergraphs.HypergraphAggs) + SimpleHypergraphs.HypergraphAggs randompartition(::Int64,::Int64) diff --git a/src/conductance.jl b/src/conductance.jl index f4f81c4..8e49907 100644 --- a/src/conductance.jl +++ b/src/conductance.jl @@ -8,7 +8,6 @@ For more information see `1. Introduction` at: Generalizing the Hypergraph Laplacian via a Diffusion Processwith Mediators, auhtors: T-H. Hubert Chan, Xhibin Liang. """ - function conductance(h::Hypergraph, subset::Set{Int})::Float64 if isempty(subset) error("`subset` is not allowed empty.") end if subset == Set(1:nhv(h)) error("`subset` is not allowed true subset of `h`.") end diff --git a/src/hypergraph.jl b/src/hypergraph.jl index ab8cb9d..1d5c8f6 100644 --- a/src/hypergraph.jl +++ b/src/hypergraph.jl @@ -151,13 +151,6 @@ If a vertex does not belong to a hyperedge `nothing` is returned. get(h.v2he[idx[1]], idx[2], nothing) end -@inline function Base.pop!(d::SortedDict,key::Int,::Nothing) - if haskey(d,key) - return pop!(d,key) - else - return nothing - end -end """ Base.setindex!(h::Hypergraph, ::Nothing, idx::Vararg{Int,2}) diff --git a/src/models.jl b/src/models.jl index 363a912..a2192e6 100644 --- a/src/models.jl +++ b/src/models.jl @@ -8,7 +8,7 @@ """ - random_model(nVertices, nEdges) + random_model(nVertices::Int, nEdges::Int) Generate a *random* hypergraph without any structural constraints. @@ -39,7 +39,7 @@ end """ - random_kuniform_model(nVertices, nEdges, k) + random_kuniform_model(nVertices::Int, nEdges::Int, k::Int) Generates a *k*-uniform hypergraph, i.e. an hypergraph where each hyperedge has size *k*. @@ -57,7 +57,7 @@ end """ - random_dregular_model(nVertices, nEdges, d) + random_dregular_model(nVertices::Int, nEdges::Int, d::Int) Generates a *d*-regular hypergraph, where each node has degree *d*. diff --git a/src/twosection.jl b/src/twosection.jl index c6435e1..6515f84 100644 --- a/src/twosection.jl +++ b/src/twosection.jl @@ -155,7 +155,7 @@ LightGraphs.zero(::Type{TwoSectionView{T}}) where T = TwoSectionView(Hypergraph{ get_twosection_adjacency_mx(h::Hypergraph{T,V,E}; count_self_loops::Bool=false, replace_weights::Union{Nothing,Real}=nothing ) where {T<:Real, V, E} - Returns an adjacency matrix for a two section view of a hypergraph `h`. +Returns an adjacency matrix for a two section view of a hypergraph `h`. """ function get_twosection_adjacency_mx(h::Hypergraph{T,V,E}; count_self_loops::Bool=false, replace_weights::Union{Nothing,Real}=nothing ) where {T<:Real, V, E}