1
0
mirror of https://github.com/kalmarek/GroupRings.jl.git synced 2024-12-28 18:50:29 +01:00

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

This commit is contained in:
kalmarek 2018-08-15 19:29:11 +02:00
parent 2c7d968990
commit e53c638939

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