mirror of
https://github.com/kalmarek/PropertyT.jl.git
synced 2024-11-27 09:15:27 +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 Memento
|
||||||
|
|
||||||
using Groups
|
using Groups
|
||||||
import Nemo: Group, GroupElem
|
import Nemo: Ring, Group, GroupElem
|
||||||
|
|
||||||
const logger = Memento.config("info", fmt="{msg}")
|
const logger = Memento.config("info", fmt="{msg}")
|
||||||
const solver_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
|
return constraints
|
||||||
end
|
end
|
||||||
|
|
||||||
function splaplacian(RG::GroupRing, S, Id=RG.group(),
|
function splaplacian{TT<:Group}(RG::GroupRing{TT}, S, Id=RG.group(), T::Type=Int)
|
||||||
n=length(RG.basis), T::Type=Int)
|
result = RG(T)
|
||||||
result = RG(spzeros(n))
|
result[Id] = T(length(S))
|
||||||
result[Id] = float(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
|
for s in S
|
||||||
result[s] -= one(T)
|
result[s] -= one(T)
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user