adapt GroupRing constructors to new type definition

This commit is contained in:
kalmar 2017-05-17 17:40:32 +02:00
parent 203743bb4d
commit 4491078b9e
1 changed files with 13 additions and 2 deletions

View File

@ -77,12 +77,23 @@ function GroupRing(G::Group, pm::Array{Int,2})
return GroupRing(G, pm)
end
function GroupRing(G::Group, pm::Array{Int,2}, basis::Vector)
function GroupRing(G::Group, basis::Vector)
basis_dict = reverse_dict(basis)
pm = try
create_pm(basis, basis_dict)
catch err
isa(err, KeyError) && throw("Products are not supported on basis")
throw(err)
end
return GroupRing(G, basis, basis_dict, pm)
end
function GroupRing(G::Group, basis::Vector, pm::Array{Int,2})
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 = reverse_dict(basis)
return GroupRing(Group, pm, basis, basis_dict)
return GroupRing(G, basis, basis_dict, pm)
end
###############################################################################