relax type assumptions in compute_SOS and else

This commit is contained in:
kalmarek 2019-06-25 17:35:46 +02:00
parent b5f12501f9
commit 7a8b21db3c
No known key found for this signature in database
GPG Key ID: 8BF1A3855328FC15
2 changed files with 6 additions and 6 deletions

View File

@ -37,7 +37,7 @@ function compute_SOS(RG::GroupRing, Q::AbstractMatrix{<:Real})
return GroupRingElem(result, RG) return GroupRingElem(result, RG)
end end
function compute_SOS_square(pm::AbstractMatrix{<:Integer}, Q::AbstractMatrix{<:Real}) function compute_SOS_square(pm::AbstractMatrix{<:Integer}, Q::AbstractMatrix)
result = zeros(eltype(Q), maximum(pm)); result = zeros(eltype(Q), maximum(pm));
for i in 1:size(Q,2) for i in 1:size(Q,2)
@ -47,12 +47,12 @@ function compute_SOS_square(pm::AbstractMatrix{<:Integer}, Q::AbstractMatrix{<:R
return result return result
end end
function compute_SOS_square(RG::GroupRing, Q::AbstractMatrix{<:Real}) function compute_SOS_square(RG::GroupRing, Q::AbstractMatrix)
return GroupRingElem(compute_SOS_square(RG.pm, Q), RG) return GroupRingElem(compute_SOS_square(RG.pm, Q), RG)
end end
function augIdproj(Q::AbstractMatrix{T}) where {T<:Real} function augIdproj(Q::AbstractMatrix{T}) where T
result = zeros(size(Q)) result = zeros(T, size(Q))
l = size(Q, 2) l = size(Q, 2)
Threads.@threads for j in 1:l Threads.@threads for j in 1:l
col = sum(view(Q, :,j))/l col = sum(view(Q, :,j))/l

View File

@ -58,9 +58,9 @@ function orthSVD(M::AbstractMatrix{T}) where {T<:AbstractFloat}
return fact.U[:,1:M_rank] return fact.U[:,1:M_rank]
end end
function orbit_decomposition(G::Group, E::Vector, rdict=GroupRings.reverse_dict(E)) orbit_decomposition(G::Group, E::AbstractVector, rdict=GroupRings.reverse_dict(E)) = orbit_decomposition(collect(G), E, rdict)
elts = collect(G) function orbit_decomposition(elts::AbstractVector{<:GroupElem}, E::AbstractVector, rdict=GroupRings.reverse_dict(E))
tovisit = trues(size(E)); tovisit = trues(size(E));
orbits = Vector{Vector{Int}}() orbits = Vector{Vector{Int}}()