Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Variables of the set #7

Open
blegat opened this issue Mar 28, 2019 · 0 comments
Open

Variables of the set #7

blegat opened this issue Mar 28, 2019 · 0 comments

Comments

@blegat
Copy link
Member

blegat commented Mar 28, 2019

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 variables

Desired 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)
2

cc @tweisser

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant