mirror of
https://github.com/kalmarek/PropertyT.jl.git
synced 2024-09-07 07:11:42 +02:00
make sure Q'*Q hits the fast path for IntervalMatrices
This commit is contained in:
parent
cd90e072c4
commit
c7491f37f9
@ -8,7 +8,7 @@ function augment_columns!(Q::AbstractMatrix)
|
|||||||
return Q
|
return Q
|
||||||
end
|
end
|
||||||
|
|
||||||
function __sos_via_sqr!(
|
function __sos_via_square!(
|
||||||
res::SA.AlgebraElement,
|
res::SA.AlgebraElement,
|
||||||
P::AbstractMatrix;
|
P::AbstractMatrix;
|
||||||
augmented::Bool,
|
augmented::Bool,
|
||||||
@ -50,14 +50,19 @@ function __sos_via_cnstr!(
|
|||||||
return res
|
return res
|
||||||
end
|
end
|
||||||
|
|
||||||
|
__square(Q::AbstractMatrix) = Q' * Q
|
||||||
|
function __square(Q::IntervalMatrices.IntervalMatrix)
|
||||||
|
return *(IntervalMatrices.MultiplicationType{:fast}(), Q', Q)
|
||||||
|
end
|
||||||
|
|
||||||
function compute_sos(
|
function compute_sos(
|
||||||
A::SA.StarAlgebra,
|
A::SA.StarAlgebra,
|
||||||
Q::AbstractMatrix;
|
Q::AbstractMatrix;
|
||||||
augmented::Bool,
|
augmented::Bool,
|
||||||
)
|
)
|
||||||
Q² = Q' * Q
|
Q² = __square(Q)
|
||||||
res = SA.AlgebraElement(zeros(eltype(Q²), length(SA.basis(A))), A)
|
res = SA.AlgebraElement(zeros(eltype(Q²), length(SA.basis(A))), A)
|
||||||
res = __sos_via_sqr!(res, Q²; augmented = augmented)
|
res = __sos_via_square!(res, Q²; augmented = augmented)
|
||||||
return res
|
return res
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user