mirror of
https://github.com/kalmarek/GroupRings.jl.git
synced 2024-10-10 06:40:35 +02:00
constructors for GroupRing
This commit is contained in:
parent
84de4de030
commit
82fb401539
@ -37,6 +37,28 @@ GroupRingElem{T}(c::AbstractVector{T}, A::GroupRing) = GroupRingElem{T}(c,A)
|
||||
|
||||
convert{T<:Number}(::Type{T}, X::GroupRingElem) =
|
||||
GroupRingElem(parent(X), convert(AbstractVector{T}, X.coeffs))
|
||||
|
||||
function GroupRing(G::Group, pm::Array{Int,2})
|
||||
size(pm,1) == size(pm,2) || throw("pm must be of size (n,n), got
|
||||
$(size(pm))")
|
||||
return GroupRing(Group, pm)
|
||||
end
|
||||
|
||||
function GroupRing(G::Group, pm::Array{Int,2}, basis::Vector)
|
||||
size(pm,1) == size(pm,2) || throw("pm must be of size (n,n), got
|
||||
$(size(pm))")
|
||||
eltype(basis) == elem_type(G) || throw("basis must consist of elements of $G")
|
||||
basis_dict = Dict(g => i for (i,g) in enumerate(basis))
|
||||
return GroupRing(Group, pm, basis, basis_dict)
|
||||
end
|
||||
|
||||
function GroupRing(G::Group; complete=false)
|
||||
A = GroupRing(Group)
|
||||
if complete
|
||||
complete(A)
|
||||
end
|
||||
return A
|
||||
end
|
||||
end
|
||||
|
||||
(==)(X::GroupAlgebraElement, Y::GroupAlgebraElement) = isequal(X,Y)
|
||||
|
Loading…
Reference in New Issue
Block a user