mirror of
https://github.com/kalmarek/PropertyT.jl.git
synced 2024-11-23 08:15:29 +01:00
dispatch splaplacian on GroupRing{T} type
with multiplicative unit for Rings
This commit is contained in:
parent
a68e546b7e
commit
3c0ae5baf0
@ -5,7 +5,7 @@ using GroupRings
|
||||
using Memento
|
||||
|
||||
using Groups
|
||||
import Nemo: Group, GroupElem
|
||||
import Nemo: Ring, Group, GroupElem
|
||||
|
||||
const logger = Memento.config("info", fmt="{msg}")
|
||||
const solver_logger = Memento.config("info", fmt="{msg}")
|
||||
|
16
src/sdps.jl
16
src/sdps.jl
@ -13,10 +13,18 @@ function constraints_from_pm(pm, total_length=maximum(pm))
|
||||
return constraints
|
||||
end
|
||||
|
||||
function splaplacian(RG::GroupRing, S, Id=RG.group(),
|
||||
n=length(RG.basis), T::Type=Int)
|
||||
result = RG(spzeros(n))
|
||||
result[Id] = float(length(S))
|
||||
function splaplacian{TT<:Group}(RG::GroupRing{TT}, S, Id=RG.group(), T::Type=Int)
|
||||
result = RG(T)
|
||||
result[Id] = 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=Int)
|
||||
result = RG(T)
|
||||
result[Id] = T(length(S))
|
||||
for s in S
|
||||
result[s] -= one(T)
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user