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

GroupRing coercion (::GroupRing object overloads)

This commit is contained in:
kalmar 2017-05-16 18:35:20 +02:00
parent 5d51146688
commit eecba6c5d8

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