Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,14 @@ SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
UnsafeArrays = "c4a57d5a-5b31-53a6-b365-19f8c011fbd6"

[weakdeps]
Dualization = "191a621a-6537-11e9-281d-650236a99e60"

[extensions]
DualizationExt = "Dualization"

[compat]
Dualization = "0.5.10, 0.6, 0.7"
FillArrays = "1.13"
KrylovKit = "0.9.5, 0.10"
LinearAlgebra = "1.10"
Expand Down
14 changes: 14 additions & 0 deletions ext/DualizationExt.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Copyright (c) 2024: Benoît Legat and contributors
#
# Use of this source code is governed by an MIT-style license that can be found
# in the LICENSE.md file or at https://opensource.org/licenses/MIT.

module DualizationExt

import Dualization
import LowRankOpt

Dualization.dual_attribute(attr::LowRankOpt.RawStatus) = attr
Dualization.dual_attribute(attr::LowRankOpt.Solution) = attr

end
4 changes: 4 additions & 0 deletions src/solution.jl
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,10 @@ function Base.size(s::ShapedSolution)
end
num_matrices(s::ShapedSolution) = length(s.matrices)

if isdefined(LinearAlgebra, :norm_recursive_check)
LinearAlgebra.norm_recursive_check(::ShapedSolution) = nothing
end

function LinearAlgebra.norm2(s::ShapedSolution{T}) where {T}
# `LinearAlgebra.generic_norm2` starts by computing the ∞ norm and do a rescaling, we don't do that here
return √(LinearAlgebra.dot(s, s))
Expand Down
Loading