1
0
mirror of https://github.com/kalmarek/PropertyT.jl.git synced 2024-11-19 15:25:29 +01:00

A more performant version of SOS decomposition

This commit is contained in:
kalmar 2016-12-22 02:39:18 +01:00
parent 5bc90f49e1
commit 8d1fbf0f62

View File

@ -87,14 +87,16 @@ function create_SDP_problem(matrix_constraints,
return m return m
end end
function resulting_SOS{T<:Number, S<:Number}(sqrt_matrix::Array{T,2}, elt::GroupAlgebraElement{S}) function resulting_SOS{T<:Number}(sqrt_matrix::Array{T,2}, elt::GroupAlgebraElement{T})
zzz = zeros(T, length(elt)) result = zeros(elt.coordinates)
result::GroupAlgebraElement{T} = GroupAlgebraElement(zzz, elt.product_matrix) zzz = zeros(elt.coordinates)
for i in 1:length(result) L = size(sqrt_matrix,2)
new_base = GroupAlgebraElement(sqrt_matrix[:,i], elt.product_matrix) for i in 1:L
result += new_base*new_base zzz[1:L] = view(sqrt_matrix, :,i)
new_base = GroupAlgebraElement(zzz, elt.product_matrix)
result += (new_base*new_base).coordinates
end end
return result return GroupAlgebraElement{T}(result, elt.product_matrix)
end end
function correct_to_augmentation_ideal{T<:Rational}(sqrt_matrix::Array{T,2}) function correct_to_augmentation_ideal{T<:Rational}(sqrt_matrix::Array{T,2})