mirror of
https://github.com/kalmarek/GroupRings.jl.git
synced 2024-11-19 06:30:27 +01:00
GroupRing coercion (::GroupRing object overloads)
This commit is contained in:
parent
5d51146688
commit
eecba6c5d8
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user