In [ ]:
#import Pkg; Pkg.add("LazySets")
#import Pkg; Pkg.add("Combinatorics")
# we need this for a convex hull routine
In [1]:
include("plotregion.jl")
Out[1]:
Main.PlotRegion
In [ ]:

In [ ]:

In [2]:
using LinearAlgebra

A1 = [-2.0 1; 
      -1 2; 
       1 0]
b = [2.0; 7; 3]

# the input to plotregion is the matrix A
# for an LP in standard form. 
# it will show the feasible polytope for
# the first two dimensions. 
A = [A1 Matrix(1.0I,3,3)] # form the problem with slacks.
PlotRegion.plotregion(A,b)
Out[2]:
In [ ]:

In [9]:
using LinearAlgebra

A1 = [-2.0 1; 
      -1 2; 
       1 0
       -1 0]
b = [2.0; 1; 1; -0.5]

# the input to plotregion is the matrix A
# for an LP in standard form. 
# it will show the feasible polytope for
# the first two dimensions. 
A = [A1 Matrix(1.0I,4,4)] # form the problem with slacks.
PlotRegion.plotregion(A,b)
Out[9]:
In [10]:
using LinearAlgebra

A1 = [-2.0 1; 
      -1 1; 
       1 0]
b = [2.0; 7; 7]

# the input to plotregion is the matrix A
# for an LP in standard form. 
# it will show the feasible polytope for
# the first two dimensions. 
A = [A1 Matrix(1.0I,3,3)] # form the problem with slacks.
p = PlotRegion.plotregion(A,b)
PlotRegion.plot!(aspect_ratio=:equal)
Out[10]:
In [ ]:

In [ ]:

In [ ]: