fix: deepcopy for baseless rings

This commit is contained in:
kalmarek 2020-10-17 16:48:36 +02:00
parent b601b882fa
commit e3b1498efa
No known key found for this signature in database
GPG Key ID: 8BF1A3855328FC15
1 changed files with 3 additions and 3 deletions

View File

@ -203,13 +203,13 @@ Base.IndexStyle(::Type{GroupRingElem}) = Base.LinearFast()
dense(X::GroupRingElem{T, A}) where {T, A<:DenseVector} = X
function dense(X::GroupRingElem{T, Sp}) where {T, Sp<:SparseVector}
return parent(X)(Vector(X.coeffs))
return GroupRingElem(Vector(X.coeffs), parent(X))
end
SparseArrays.sparse(X::GroupRingElem{T, Sp}) where {T, Sp<:SparseVector} = X
function SparseArrays.sparse(X::GroupRingElem{T, A}) where {T, A<:Vector}
return parent(X)(sparse(X.coeffs))
return GroupRingElem(sparse(X.coeffs), parent(X))
end
###############################################################################
@ -280,7 +280,7 @@ end
hasbasis(A::GroupRing) = isdefined(A, :basis)
Base.deepcopy_internal(x::GroupRingElem, dict::IdDict) =
parent(x)(deepcopy(x.coeffs))
GroupRingElem(deepcopy(x.coeffs), parent(x))
###############################################################################
#