GroupRing coercion (::GroupRing object overloads)

This commit is contained in:
kalmar 2017-05-16 18:35:20 +02:00
parent 5d51146688
commit eecba6c5d8
1 changed files with 12 additions and 0 deletions

View File

@ -63,6 +63,18 @@ function GroupRing(G::Group; complete=false)
return A
end
function (A::GroupRing)(X::GroupRingElem)
length(X) == length(A.basis) || throw("Can not coerce to $A: lengths differ")
X.parent = A
return X
end
function (A::GroupRing)(x::AbstractVector)
length(x) == length(A.basis) || throw("Can not coerce to $A: lengths differ")
return GroupRingElem(x, A)
end
function show(io::IO, A::GroupRing)
print(io, "GroupRing of $(A.group)")
end