diff --git a/Project.toml b/Project.toml index 5c3cc7b..3d9d974 100644 --- a/Project.toml +++ b/Project.toml @@ -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" diff --git a/ext/DualizationExt.jl b/ext/DualizationExt.jl new file mode 100644 index 0000000..275541f --- /dev/null +++ b/ext/DualizationExt.jl @@ -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 diff --git a/src/solution.jl b/src/solution.jl index 3009403..e45969b 100644 --- a/src/solution.jl +++ b/src/solution.jl @@ -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))