Skip to content

Commit 4127c4c

Browse files
committed
add sanity check
1 parent 408ef69 commit 4127c4c

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/symbolicindexing.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,7 @@ struct NWState{U,P,T,NW<:Network}
109109
t::T
110110
function NWState(thing, uflat::AbstractVector, p=nothing, t=nothing)
111111
nw = extract_nw(thing)
112+
@argcheck length(uflat) == dim(nw) "Length of uflat ($(length(uflat))) does not match number of states in network ($(dim(nw)))."
112113
_p = p isa Union{NWParameter,Nothing} ? p : NWParameter(nw, p)
113114
s = new{typeof(uflat),typeof(_p),typeof(t),typeof(nw)}(nw,uflat,_p,t)
114115
@argcheck isnothing(p) || s.nw === s.p.nw

0 commit comments

Comments
 (0)