mirror of
https://github.com/kalmarek/PropertyT.jl.git
synced 2024-11-23 08:15:29 +01:00
simplify groupring_square
This commit is contained in:
parent
b97a0e30dd
commit
9ed8679c95
@ -25,19 +25,21 @@ end
|
|||||||
|
|
||||||
EOI{T<:Number}(Δ::GroupRingElem{T}, λ::T) = Δ*Δ - λ*Δ
|
EOI{T<:Number}(Δ::GroupRingElem{T}, λ::T) = Δ*Δ - λ*Δ
|
||||||
|
|
||||||
function groupring_square(vect::AbstractVector, elt::GroupRingElem)
|
function groupring_square(vect::AbstractVector, l, pm)
|
||||||
zzz = zeros(eltype(vect), length(elt.coeffs))
|
zzz = zeros(eltype(vect), l)
|
||||||
zzz[1:length(vect)] .= vect
|
zzz[1:length(vect)] .= vect
|
||||||
return GroupRings.mul!(similar(zzz), zzz, zzz, parent(elt).pm)
|
return GroupRings.mul!(similar(zzz), zzz, zzz, pm)
|
||||||
end
|
end
|
||||||
|
|
||||||
function compute_SOS(sqrt_matrix, elt)
|
function compute_SOS(sqrt_matrix, elt::GroupRingElem)
|
||||||
n = size(sqrt_matrix,2)
|
n = size(sqrt_matrix,2)
|
||||||
|
l = length(elt.coeffs)
|
||||||
|
pm = parent(elt).pm
|
||||||
|
|
||||||
result = zeros(eltype(sqrt_matrix), length(elt.coeffs))
|
result = zeros(eltype(sqrt_matrix), l)
|
||||||
for i in 1:n
|
for i in 1:n
|
||||||
result .+= (groupring_square(view(sqrt_matrix,:,i), elt))
|
result .+= groupring_square(view(sqrt_matrix,:,i), l, pm)
|
||||||
end
|
end
|
||||||
|
|
||||||
# result = @parallel (+) for i in 1:n
|
# result = @parallel (+) for i in 1:n
|
||||||
# groupring_square(sqrt_matrix[:,i], elt)
|
# groupring_square(sqrt_matrix[:,i], elt)
|
||||||
|
Loading…
Reference in New Issue
Block a user