diff --git a/src/basic.jl b/src/basic.jl index ba5e0bd..327b65d 100644 --- a/src/basic.jl +++ b/src/basic.jl @@ -21,9 +21,7 @@ function basicsemialgebraicset(V, p) end MP.changecoefficienttype(::Type{BasicSemialgebraicSet{S, PS, AT}}, T::Type) where {S, PS, AT} = BasicSemialgebraicSet{T, MP.changecoefficienttype(PS, T), MP.changecoefficienttype(AT, T)} -function Base.convert(::Type{BasicSemialgebraicSet{T, PT, AT}}, set::BasicSemialgebraicSet{T, PT, AT}) where {T, PT<:APL, AT<:AbstractAlgebraicSet} - return set -end + function Base.convert(::Type{BasicSemialgebraicSet{T, PT, AT}}, set::BasicSemialgebraicSet) where {T, PT, AT} return BasicSemialgebraicSet{T, PT, AT}(set.V, set.p) end diff --git a/test/macro.jl b/test/macro.jl index 96ac439..ccebd17 100644 --- a/test/macro.jl +++ b/test/macro.jl @@ -12,6 +12,7 @@ struct DummySolver <: SemialgebraicSets.AbstractAlgebraicSolver end addinequality!(S, x + y - 1) # Algebraic set forces `Float64` @test S isa BasicSemialgebraicSet{Float64} + @test S == basicsemialgebraicset(S.V, S.p) @test sprint(show, S) == "{ (x, y) | x - y = 0, x^2 - y = 0, x^2*y - 1.0 ≥ 0, x + y - 1.0 ≥ 0 }" @test sprint(show, MIME"text/plain"(), S) == "Basic semialgebraic Set defined by 2 equalities\n x - y = 0\n x^2 - y = 0\n2 inequalities\n x^2*y - 1.0 ≥ 0\n x + y - 1.0 ≥ 0\n" @test S.V isa AlgebraicSet{Float64}