mirror of
https://github.com/kalmarek/PropertyT.jl.git
synced 2024-11-22 16:05:27 +01:00
in reconstruct: accumulate to a single matrix
This commit is contained in:
parent
c7491f37f9
commit
3b9c75604c
@ -12,10 +12,9 @@ function reconstruct(
|
|||||||
wbdec::SW.WedderburnDecomposition,
|
wbdec::SW.WedderburnDecomposition,
|
||||||
)
|
)
|
||||||
n = __outer_dim(wbdec)
|
n = __outer_dim(wbdec)
|
||||||
res = sum(zip(Ms, SW.direct_summands(wbdec))) do (M, ds)
|
res = zeros(eltype(first(Ms)), n, n)
|
||||||
res = similar(M, n, n)
|
for (M, ds) in zip(Ms, SW.direct_summands(wbdec))
|
||||||
res = _reconstruct!(res, M, ds)
|
res = _reconstruct!(res, M, ds)
|
||||||
return res
|
|
||||||
end
|
end
|
||||||
res = average!(zero(res), res, __group_of(wbdec), wbdec.hom)
|
res = average!(zero(res), res, __group_of(wbdec), wbdec.hom)
|
||||||
return res
|
return res
|
||||||
@ -26,11 +25,10 @@ function _reconstruct!(
|
|||||||
M::AbstractMatrix,
|
M::AbstractMatrix,
|
||||||
ds::SW.DirectSummand,
|
ds::SW.DirectSummand,
|
||||||
)
|
)
|
||||||
res .= zero(eltype(res))
|
|
||||||
if !iszero(M)
|
if !iszero(M)
|
||||||
U = SW.image_basis(ds)
|
U = SW.image_basis(ds)
|
||||||
d = SW.degree(ds)
|
d = SW.degree(ds)
|
||||||
res = (U' * M * U) .* d
|
res .+= (U' * M * U) .* d
|
||||||
end
|
end
|
||||||
return res
|
return res
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user