1
0
mirror of https://github.com/kalmarek/PropertyT.jl.git synced 2024-11-14 14:15:28 +01:00

add generic saveGRElem, loadGRElem

This commit is contained in:
kalmarek 2018-09-16 18:02:35 +02:00
parent 08d53840a0
commit 3df3967fad

View File

@ -45,13 +45,19 @@ function Laplacian(S, Id, radius)
return Δ
end
function loadLaplacian(name::String, G::Group)
if exists(filename(name, )) && exists(filename(name, :pm))
function saveGRElem(filename::String, g::GroupRingElem)
RG = parent(g)
JLD.save(filename, "coeffs", g.coeffs, "pm", RG.pm, "G", RG.group)
end
function loadGRElem(fname::String, G::Group)
if isfile(fname)
info("Loading precomputed Δ...")
RG = GroupRing(G, load(filename(name, :pm), "pm"))
Δ = GroupRingElem(load(filename(name, ), "Δ")[:, 1], RG)
coeffs, pm = load(fname, "coeffs", "pm")
RG = GroupRing(G, pm)
Δ = GroupRingElem(coeffs, RG)
else
throw("You need to precompute $(filename(name, :pm)) and $(filename(name, )) to load it!")
throw(ErrorException("You need to precompute $fname first!"))
end
return Δ
end