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
1 changed files with 2 additions and 4 deletions

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