Closed WuSiren closed 5 months ago
Let me add some more information.
This is the variable order:
julia> all_variables(m)
4-element Vector{VariableRef}:
d[1]
d[2]
g[1]
g[2]
The result P
is
Polyhedron CDDLib.Polyhedron{Rational{BigInt}}:
4-element iterator of HalfSpace{Rational{BigInt}, Vector{Rational{BigInt}}}:
HalfSpace(Rational{BigInt}[-1, 0], 0//1)
HalfSpace(Rational{BigInt}[0, -1], 0//1)
HalfSpace(Rational{BigInt}[1, 0], 1//1)
HalfSpace(Rational{BigInt}[0, 1], 1//1)
which is $0 \le x_1 \le 1 \land 0 \le x_2 \le 1$.
And for completeness, here is the other projection:
julia> P = eliminate(p, [1:2;])
Polyhedron CDDLib.Polyhedron{Rational{BigInt}}:
4-element iterator of HalfSpace{Rational{BigInt}, Vector{Rational{BigInt}}}:
HalfSpace(Rational{BigInt}[-1, 0], -1//1)
HalfSpace(Rational{BigInt}[0, -1], -2//1)
HalfSpace(Rational{BigInt}[1, 0], 101//1)
HalfSpace(Rational{BigInt}[0, 1], 102//1)
which is $1 \le x_1 \le 101 \land 2 \le x_2 \le 102$.
Yes, thanks. But it behaves oppositely to the example here, doesn't it?
Pardon me, is there any change? I retested the above example, why didn't I see any changes?
@WuSiren there is not yet a new release of this package. For now you can use the development version via the dev
command:
pkg> dev Polyhedra
Oh, I see. Many thanks! 🤝
The result is
(false, true)
, which indicates the projection polyhedron is with respect to the eliminated variableg[1:2]
but not the expectedd[1:2]
.Is this a bug, or I didn't use it correctly?
Looking forward to response. Thanks!