1
0
mirror of https://github.com/kalmarek/PropertyT.jl.git synced 2024-12-26 18:40:29 +01:00

logged and clean version of Laplacian

This commit is contained in:
kalmarek 2018-01-02 03:02:22 +01:00
parent fd88de171b
commit 35615c34cf

View File

@ -100,7 +100,6 @@ filename(prefix, s::Symbol) = filename(prefix, Val{s})
end end
function Laplacian(name::String, G::Group) function Laplacian(name::String, G::Group)
info(LOGGER, "Loading precomputed Δ...")
if exists(filename(name, )) && exists(filename(name, :pm)) if exists(filename(name, )) && exists(filename(name, :pm))
RG = GroupRing(G, load(filename(name, :pm), "pm")) RG = GroupRing(G, load(filename(name, :pm), "pm"))
Δ = GroupRingElem(load(filename(name, ), "Δ")[:, 1], RG) Δ = GroupRingElem(load(filename(name, ), "Δ")[:, 1], RG)
@ -110,25 +109,19 @@ function Laplacian(name::String, G::Group)
return Δ return Δ
end end
function Laplacian{T<:GroupElem}(name::String, S::Vector{T}, Id::T; radius::Int=2) function Laplacian{T<:GroupElem}(S::Vector{T}, Id::T,
info(LOGGER, "Computing multiplication table, Δ...") logger=getlogger(); radius::Int=2)
Δ = Laplacian(S, Id, radius=radius)
save(filename(name, :pm), "pm", parent(Δ).pm)
save(filename(name, ), "Δ", Δ.coeffs)
return Δ
end
function Laplacian{T<:GroupElem}(S::Vector{T}, Id::T; radius::Int=2) info(logger, "Generating metric ball of radius $radius...")
info(LOGGER, "Generating metric ball of radius $radius...") @logtime logger E_R, sizes = Groups.generate_balls(S, Id, radius=2*radius)
@logtime LOGGER E_R, sizes = Groups.generate_balls(S, Id, radius=2*radius) info(logger, "Generated balls of sizes $sizes.")
info(LOGGER, "Generated balls of sizes $sizes.")
info(LOGGER, "Creating product matrix...") info(logger, "Creating product matrix...")
@logtime LOGGER pm = GroupRings.create_pm(E_R, GroupRings.reverse_dict(E_R), sizes[radius]; twisted=true) @logtime logger pm = GroupRings.create_pm(E_R, GroupRings.reverse_dict(E_R), sizes[radius]; twisted=true)
RG = GroupRing(parent(Id), E_R, pm) RG = GroupRing(parent(Id), E_R, pm)
Δ = splaplacian(RG, S) Δ = spLaplacian(RG, S)
return Δ return Δ
end end
@ -185,10 +178,13 @@ function check_property_T(name::String, S, Id, solver, upper_bound, tol, radius)
if exists(filename(name, :pm)) && exists(filename(name, )) if exists(filename(name, :pm)) && exists(filename(name, ))
# cached # cached
info(LOGGER, "Loading precomputed Δ...")
Δ = Laplacian(name, parent(S[1])) Δ = Laplacian(name, parent(S[1]))
else else
# compute # compute
Δ = Laplacian(name, S, Id, radius=radius) Δ = Laplacian(S, Id, LOGGER, radius=radius)
save(filename(name, :pm), "pm", parent(Δ).pm)
save(filename(name, ), "Δ", Δ.coeffs)
end end
if exists(filename(name, )) && exists(filename(name, :P)) if exists(filename(name, )) && exists(filename(name, :P))