mirror of
https://github.com/kalmarek/GroupRings.jl.git
synced 2025-01-01 03:40:29 +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
|
return A
|
||||||
end
|
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)
|
function show(io::IO, A::GroupRing)
|
||||||
print(io, "GroupRing of $(A.group)")
|
print(io, "GroupRing of $(A.group)")
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user