1
0
mirror of https://github.com/kalmarek/PropertyT.jl.git synced 2024-11-14 14:15:28 +01:00

make orbit_constraint use new constraints indexing

This commit is contained in:
kalmarek 2018-08-20 03:53:17 +02:00
parent 45923d9597
commit ed181d14f8

View File

@ -41,12 +41,10 @@ function orbit_spvector(vect::AbstractVector, orbits)
return orb_vector
end
function orbit_constraint(constraints::Vector{Vector{Tuple{Int,Int}}}, n)
function orbit_constraint(constraints::Vector{Vector{Int}}, n)
result = spzeros(n,n)
for cnstr in constraints
for p in cnstr
result[p[2], p[1]] += 1.0/length(constraints)
end
result[cnstr] += 1.0/length(constraints)
end
return result
end