KrisLibrary  1.0.0
PolytopeProjection.h
1 #ifndef POLYTOPE_PROJECTION_H
2 #define POLYTOPE_PROJECTION_H
3 
5 #include <KrisLibrary/geometry/UnboundedPolytope2D.h>
6 #include <KrisLibrary/optimization/LinearProgram.h>
7 #include <KrisLibrary/optimization/LPRobust.h>
8 #include <list>
9 
10 namespace Geometry {
11  using namespace Math3D;
12 
19 {
20  public:
23  bool EvalExtremum(const Vector2& dir, Geometry::PointRay2D& x);
24 
25  int varx,vary;
29  bool unbounded_initialized;
30  Optimization::LinearProgram lp_unbounded;
32  Optimization::RobustLPSolver unboundedSolver;
33  //stats
34  int numEvals;
35 };
36 
37 
38 
49 {
50  public:
51  PolytopeProjection2D(Optimization::LinearProgram& lp,int varx=0,int vary=1);
52  PolytopeProjection2D(Optimization::LinearProgram_Sparse& lps,int varx=0,int vary=1);
53 
55  void Solve(UnboundedPolytope2D& poly);
56 
58  void Expand();
59 
61  void Create(UnboundedPolytope2D& poly) const;
62 
63  typedef std::list<Geometry::PointRay2D>::iterator PointIterator;
64 
66  void ExpandEdge(PointIterator i,int depth=0);
67 
69  std::list<Geometry::PointRay2D> points;
70  int maxDepth;
71 };
72 
73 
74 } //namespace Geometry
75 
76 #endif
Linear program definition with sparse matrix A.
Definition: LinearProgram.h:158
A method for projecting a polytope defined by the feasible set of a linear program lp onto a 2D subsp...
Definition: PolytopeProjection.h:48
A class that tries out as many available routines as possible to solve an LP.
Definition: LPRobust.h:12
Class declarations for useful 3D math types.
A representation of a possibly unbounded polytope in the 2d plane.
Definition: UnboundedPolytope2D.h:17
Contains all the definitions in the Math3D package.
Definition: AnyGeometry.h:12
Helper callback used in PolytopeProjection2D.
Definition: PolytopeProjection.h:18
Linear program definition.Represents the LP min/max c.x subject to qi <= ai.x <= pi lj <= xj <= u...
Definition: LinearProgram.h:139
A 2D point or infinite ray. Note: rays should be normalized unit vectors.
Definition: rayprimitives.h:18
A 2D vector class.
Definition: math3d/primitives.h:41
Contains all definitions in the Geometry package.
Definition: AnyGeometry.h:11