From c4dcaf25feb371c2393c76620ee51b2f30b9b57b Mon Sep 17 00:00:00 2001 From: kalmar Date: Fri, 4 Aug 2017 20:47:38 +0200 Subject: [PATCH] @parallelising computation of SOS --- src/CheckSolution.jl | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/src/CheckSolution.jl b/src/CheckSolution.jl index a7d94f5..f261788 100644 --- a/src/CheckSolution.jl +++ b/src/CheckSolution.jl @@ -36,16 +36,18 @@ function compute_SOS(sqrt_matrix, elt::GroupRingElem) l = length(elt.coeffs) pm = parent(elt).pm - result = zeros(eltype(sqrt_matrix), l) - for i in 1:n - result .+= groupring_square(view(sqrt_matrix,:,i), l, pm) + # result = zeros(eltype(sqrt_matrix), l) + # for i in 1:n + # result .+= groupring_square(view(sqrt_matrix,:,i), l, pm) + # end + + @everywhere groupring_square = PropertyT.groupring_square + + result = @parallel (+) for i in 1:n + groupring_square(view(sqrt_matrix,:,i), length(elt.coeffs), parent(elt).pm) end - # result = @parallel (+) for i in 1:n - # groupring_square(sqrt_matrix[:,i], elt) - # end - - return GroupRingElem(result, parent(elt)) + return GroupRingElem(result, parent(elt)) end function correct_to_augmentation_ideal{T<:Rational}(sqrt_matrix::Array{T,2})