-
Notifications
You must be signed in to change notification settings - Fork 6
Open
Description
The variables on which a semialgebraic set is currently not defined.
We should add a field containing the ordered list of variables that is by default the union of the variables of all the polynomials defining the set but which can be set to something else.
Current behavior:
julia> using SemialgebraicSets
julia> using DynamicPolynomials
julia> @polyvar x y
(x, y)
julia> S = @set x >= 0 && y >= 0;
julia> variables(S)
ERROR: MethodError: no method matching variables(::BasicSemialgebraicSet{Float64,Polynomial{true,Float64},AlgebraicSet{Float64,Polynomial{true,Float64},Buchberger,SemialgebraicSets.SolverUsingMultiplicationMatrices{SemialgebraicSets.GröbnerBasisMultiplicationMatricesAlgorithm,ReorderedSchurMultiplicationMatricesSolver{Int64,Random.MersenneTwister}}}})
Closest candidates are:
variables(::SemialgebraicSets.PolynomialIdeal) at /home/blegat/.julia/packages/SemialgebraicSets/64a8D/src/ideal.jl:32
variables(::Union{AbstractArray{#s26,N} where N where #s26<:(Union{Monomial{C}, PolyVar{C}, Polynomial{C,T} where T, Term{C,T} where T} where C), Union{Monomial{C}, PolyVar{C}, Polynomial{C,T} where T, Term{C,T} where T} where C}) at /home/blegat/.julia/dev/DynamicPolynomials/src/DynamicPolynomials.jl:33
Stacktrace:
[1] top-level scope at none:0
julia> nvariables(S)
ERROR: MethodError: no method matching nvariables(::BasicSemialgebraicSet{Float64,Polynomial{true,Float64},AlgebraicSet{Float64,Polynomial{true,Float64},Buchberger,SemialgebraicSets.SolverUsingMultiplicationMatrices{SemialgebraicSets.GröbnerBasisMultiplicationMatricesAlgorithm,ReorderedSchurMultiplicationMatricesSolver{Int64,Random.MersenneTwister}}}})
Closest candidates are:
nvariables(::Union{AbstractArray{#s26,N} where N where #s26<:(Union{Monomial{C}, PolyVar{C}, Polynomial{C,T} where T, Term{C,T} where T} where C), Union{Monomial{C}, PolyVar{C}, Polynomial{C,T} where T, Term{C,T} where T} where C}) at /home/blegat/.julia/dev/DynamicPolynomials/src/DynamicPolynomials.jl:34
nvariables(::Union{AbstractVariable, Type{#s13} where #s13<:AbstractVariable}) at /home/blegat/.julia/dev/MultivariatePolynomials/src/monomial.jl:38
Stacktrace:
[1] top-level scope at none:0
julia> variables(S.p)
2-element Array{PolyVar{true},1}:
x
y
julia> S.variables
ERROR: type BasicSemialgebraicSet has no field variablesDesired behavior:
julia> using SemialgebraicSets
julia> using DynamicPolynomials
julia> @polyvar x y
(x, y)
julia> S = @set x >= 0 && y >= 0;
julia> variables(S)
2-element Array{PolyVar{true},1}:
x
y
julia> nvariables(S)
2cc @tweisser
mforets and chriscoey
Metadata
Metadata
Assignees
Labels
No labels