add full(::GroupRingElem) and sparse(::GroupRingElem)

This commit is contained in:
kalmarek 2018-08-15 19:29:11 +02:00
parent 2c7d968990
commit e53c638939
1 changed files with 10 additions and 0 deletions

View File

@ -209,6 +209,16 @@ end
Base.size(X::GroupRingElem) = size(X.coeffs)
Base.IndexStyle(::Type{GroupRingElem}) = Base.LinearFast()
function Base.full(X::GroupRingElem{T, Sp}) where {T, Sp<:SparseVector}
return parent(X)(full(X.coeffs))
end
Base.full(X::GroupRingElem{T, A}) where {T, A<:Vector} = X
Base.sparse(X::GroupRingElem{T, Sp}) where {T, Sp<:SparseVector} = X
function Base.sparse(X::GroupRingElem{T, A}) where {T, A<:Vector}
return parent(X)(sparse(X.coeffs))
end
###############################################################################
#
# String I/O