Skip to content

Commit 5e379b2

Browse files
authored
Add dedicated set_dot method for CanonicalVector (#322)
1 parent 677d0df commit 5e379b2

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

src/MOI_wrapper/hermitian_complex_psd_cone_bridge.jl

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,20 @@ function MOI.Utilities.set_dot(
5252
return result
5353
end
5454

55+
function MOI.Utilities.set_dot(
56+
x::MOI.Utilities.CanonicalVector{T},
57+
y::MOI.Utilities.CanonicalVector{T},
58+
set::ComplexPositiveSemidefiniteConeTriangle,
59+
) where {T}
60+
if x.index != y.index
61+
return zero(T)
62+
elseif isqrt(x.index)^2 == x.index
63+
return one(T)
64+
else
65+
return T(2)
66+
end
67+
end
68+
5569
function MOI.Utilities.dot_coefficients(
5670
a::AbstractVector,
5771
set::ComplexPositiveSemidefiniteConeTriangle,

0 commit comments

Comments
 (0)