mirror of
https://github.com/kalmarek/PropertyT.jl.git
synced 2024-11-26 00:55:27 +01: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
|
||||
end
|
||||
|
||||
function __sos_via_sqr!(
|
||||
function __sos_via_square!(
|
||||
res::SA.AlgebraElement,
|
||||
P::AbstractMatrix;
|
||||
augmented::Bool,
|
||||
@ -50,14 +50,19 @@ function __sos_via_cnstr!(
|
||||
return res
|
||||
end
|
||||
|
||||
__square(Q::AbstractMatrix) = Q' * Q
|
||||
function __square(Q::IntervalMatrices.IntervalMatrix)
|
||||
return *(IntervalMatrices.MultiplicationType{:fast}(), Q', Q)
|
||||
end
|
||||
|
||||
function compute_sos(
|
||||
A::SA.StarAlgebra,
|
||||
Q::AbstractMatrix;
|
||||
augmented::Bool,
|
||||
)
|
||||
Q² = Q' * Q
|
||||
Q² = __square(Q)
|
||||
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
|
||||
end
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user