mirror of
https://github.com/kalmarek/GroupRings.jl.git
synced 2024-12-29 11:00:28 +01:00
in setindex! perform coercion only when necessary
This commit is contained in:
parent
b2231c44e6
commit
1e75372068
@ -173,8 +173,11 @@ end
|
||||
function setindex!(X::GroupRingElem, value, g::GroupElem)
|
||||
RG = parent(X)
|
||||
typeof(g) == elem_type(RG.group) || throw("$g is not an element of $(RG.group)")
|
||||
g = (RG.group)(g)
|
||||
X.coeffs[RG.basis_dict[g]] = value
|
||||
if !(g in keys(RG.basis_dict))
|
||||
g = (RG.group)(g)
|
||||
else
|
||||
X.coeffs[RG.basis_dict[g]] = value
|
||||
end
|
||||
end
|
||||
|
||||
eltype(X::GroupRingElem) = eltype(X.coeffs)
|
||||
|
Loading…
Reference in New Issue
Block a user