Skip to content

Commit

Permalink
check that underlying BiDiGraph is symmetric
Browse files Browse the repository at this point in the history
  • Loading branch information
stecrotti committed Mar 20, 2024
1 parent f69fe62 commit 50bb546
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 3 deletions.
4 changes: 2 additions & 2 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "MatrixProductBP"
uuid = "3d39929c-b583-45fa-b331-3f50b693a38a"
authors = ["stecrotti <[email protected]>"]
version = "0.3.0"
version = "0.4.0"

[deps]
CavityTools = "217fe2f1-7e3d-419f-9934-cd6900c2759a"
Expand Down Expand Up @@ -30,7 +30,7 @@ Unzip = "41fe7b60-77ed-43a1-b4f0-825fd5a5650d"
[compat]
CavityTools = "0.3"
Distributions = "0.25"
IndexedGraphs = "0.3, 0.4"
IndexedGraphs = "0.5"
InvertedIndices = "1"
Kronecker = "0.5"
Lazy = "0.15"
Expand Down
2 changes: 1 addition & 1 deletion src/MatrixProductBP.jl
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import TensorCast: @reduce, @cast, TensorCast
import LoopVectorization
import Tullio: @tullio
import IndexedGraphs: nv, ne, edges, vertices, AbstractIndexedDiGraph, IndexedGraph,
IndexedBiDiGraph, inedges, outedges, src, dst, idx, neighbors, IndexedEdge
IndexedBiDiGraph, inedges, outedges, src, dst, idx, neighbors, IndexedEdge, issymmetric
import UnPack: @unpack
import Random: shuffle!, AbstractRNG, GLOBAL_RNG
import SparseArrays: rowvals, nonzeros, nzrange
Expand Down
1 change: 1 addition & 0 deletions src/infinite_graph.jl
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ ne(g::InfiniteRegularGraph) = 1
nv(::InfiniteRegularGraph) = 1
inedges(g::InfiniteRegularGraph, i::Integer) = ( @assert i == 1; edges(g) )
outedges(g::InfiniteRegularGraph, i::Integer) = inedges(g, i)
issymmetric(::InfiniteRegularGraph) = true
Base.show(io::IO, g::InfiniteRegularGraph) = println(io, "Infinite regular graph of degree ", g.k)
check_ψs::Vector{<:Vector{<:Matrix{<:Real}}}, g::InfiniteRegularGraph) = true

Expand Down
1 change: 1 addition & 0 deletions src/mpbp.jl
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ struct MPBP{G<:AbstractIndexedDiGraph, F<:Real, V<:AbstractVector{<:BPFactor}, M
f::Vector{F}) where {G<:AbstractIndexedDiGraph, F<:Real,
V<:AbstractVector{<:BPFactor}, M2<:AbstractMPEM2, M1<:AbstractMPEM1}

@assert issymmetric(g)
T = length(w[1]) - 1
@assert length(w) == length(ϕ) == length(b) == length(f) == nv(g) "$(length(w)), $(length(ϕ)), $(nv(g))"
@assert length(ψ) == ne(g)
Expand Down

0 comments on commit 50bb546

Please sign in to comment.