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:
parent
08d53840a0
commit
3df3967fad
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user