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

minimal constructor for GroupRing with no initialisation

This commit is contained in:
kalmar 2017-07-19 22:49:57 +02:00
parent 10ab783844
commit e8eaabc5d2

View File

@ -102,22 +102,8 @@ function GroupRingElem{T<:Number}(c::AbstractVector{T}, RG::GroupRing)
return GroupRingElem{T}(c, RG)
end
function GroupRing(G::Group, pm::Array{Int,2})
size(pm,1) == size(pm,2) || throw("pm must be square, got $(size(pm))")
RG = GroupRing(G, initialise=false)
RG.pm = pm
return RG
end
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)
function GroupRing(G::Group; init::Bool=false)
return GroupRing(G, collect(elements(G)), init=init)
end
function GroupRing(G::Group, basis::Vector, pm::Array{Int,2})