mirror of
https://github.com/kalmarek/GroupRings.jl.git
synced 2025-01-01 11:45: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)
|
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