1
0
mirror of https://github.com/kalmarek/PropertyT.jl.git synced 2024-11-30 01:55: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 return orb_vector
end end
function orbit_constraint(constraints::Vector{Vector{Tuple{Int,Int}}}, n) function orbit_constraint(constraints::Vector{Vector{Int}}, n)
result = spzeros(n,n) result = spzeros(n,n)
for cnstr in constraints for cnstr in constraints
for p in cnstr result[cnstr] += 1.0/length(constraints)
result[p[2], p[1]] += 1.0/length(constraints)
end
end end
return result return result
end end