From 7a8b21db3c581e2531128211218e0c837c519446 Mon Sep 17 00:00:00 2001 From: kalmarek Date: Tue, 25 Jun 2019 17:35:46 +0200 Subject: [PATCH] relax type assumptions in compute_SOS and else --- src/checksolution.jl | 8 ++++---- src/orbitdata.jl | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/checksolution.jl b/src/checksolution.jl index c102191..8a4a166 100644 --- a/src/checksolution.jl +++ b/src/checksolution.jl @@ -37,7 +37,7 @@ function compute_SOS(RG::GroupRing, Q::AbstractMatrix{<:Real}) return GroupRingElem(result, RG) 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)); for i in 1:size(Q,2) @@ -47,12 +47,12 @@ function compute_SOS_square(pm::AbstractMatrix{<:Integer}, Q::AbstractMatrix{<:R return result 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) end -function augIdproj(Q::AbstractMatrix{T}) where {T<:Real} - result = zeros(size(Q)) +function augIdproj(Q::AbstractMatrix{T}) where T + result = zeros(T, size(Q)) l = size(Q, 2) Threads.@threads for j in 1:l col = sum(view(Q, :,j))/l diff --git a/src/orbitdata.jl b/src/orbitdata.jl index 4a8b61f..8542ca7 100644 --- a/src/orbitdata.jl +++ b/src/orbitdata.jl @@ -58,9 +58,9 @@ function orthSVD(M::AbstractMatrix{T}) where {T<:AbstractFloat} return fact.U[:,1:M_rank] 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)); orbits = Vector{Vector{Int}}()