1
0
mirror of https://github.com/kalmarek/PropertyT.jl.git synced 2024-08-08 07:53:52 +02:00

we don't need to pass id element -- it could be derived from S

This commit is contained in:
kalmarek 2017-10-27 14:29:47 +02:00
parent 32c020fd88
commit 94c9a75a21

View File

@ -13,18 +13,18 @@ function constraints_from_pm(pm, total_length=maximum(pm))
return constraints
end
function splaplacian{TT<:Group}(RG::GroupRing{TT}, S, Id=RG.group(), T::Type=Float64)
function splaplacian(RG::GroupRing, S, T::Type=Float64)
result = RG(T)
result[Id] = T(length(S))
result[RG.group()] = T(length(S))
for s in S
result[s] -= one(T)
end
return result
end
function splaplacian{TT<:Ring}(RG::GroupRing{TT}, S, Id=one(RG.group), T::Type=Float64)
function splaplacian{TT<:Ring}(RG::GroupRing{TT}, S, T::Type=Float64)
result = RG(T)
result[Id] = T(length(S))
result[one(RG.group)] = T(length(S))
for s in S
result[s] -= one(T)
end