mirror of
https://github.com/kalmarek/GroupRings.jl.git
synced 2025-01-01 11:45:28 +01:00
Merge branch 'enh/Nemoification' of https://git.wmi.amu.edu.pl/kalmar/GroupRings.jl into enh/Nemoification
This commit is contained in:
commit
fe1f552b26
@ -135,7 +135,18 @@ function {Gr,T}(RG::GroupRing{Gr,T})(x::AbstractVector)
|
|||||||
return result
|
return result
|
||||||
end
|
end
|
||||||
|
|
||||||
(RG::GroupRing)(X::GroupRingElem) = RG(X.coeffs)
|
function (RG::GroupRing)(X::GroupRingElem)
|
||||||
|
RG == parent(X) || throw("Can not coerce!")
|
||||||
|
return RG(X.coeffs)
|
||||||
|
end
|
||||||
|
|
||||||
|
function (RG::GroupRing)(X::GroupRingElem, emb::Function)
|
||||||
|
result = RG(eltype(X.coeffs))
|
||||||
|
for g in parent(X).basis
|
||||||
|
result[emb(g)] = X[g]
|
||||||
|
end
|
||||||
|
return result
|
||||||
|
end
|
||||||
|
|
||||||
###############################################################################
|
###############################################################################
|
||||||
#
|
#
|
||||||
@ -166,8 +177,11 @@ end
|
|||||||
function setindex!(X::GroupRingElem, value, g::GroupElem)
|
function setindex!(X::GroupRingElem, value, g::GroupElem)
|
||||||
RG = parent(X)
|
RG = parent(X)
|
||||||
typeof(g) == elem_type(RG.group) || throw("$g is not an element of $(RG.group)")
|
typeof(g) == elem_type(RG.group) || throw("$g is not an element of $(RG.group)")
|
||||||
g = (RG.group)(g)
|
if !(g in keys(RG.basis_dict))
|
||||||
X.coeffs[RG.basis_dict[g]] = value
|
g = (RG.group)(g)
|
||||||
|
else
|
||||||
|
X.coeffs[RG.basis_dict[g]] = value
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
eltype(X::GroupRingElem) = eltype(X.coeffs)
|
eltype(X::GroupRingElem) = eltype(X.coeffs)
|
||||||
|
Loading…
Reference in New Issue
Block a user