KrisLibrary  1.0.0
LP_InteriorPoint.h
1 
2 #ifndef OPTIMIZATION_LP_INTERIORPOINT_H
3 #define OPTIMIZATION_LP_INTERIORPOINT_H
4 
5 #include "LinearProgram.h"
6 
7 namespace Optimization {
8 
28 {
29 public:
30  enum Result { Optimal, SubOptimal, OptimalNoBreak, Infeasible, MaxItersReached, Error };
31 
33  void SetInitialPoint(const Vector& x0);
34  Result Solve();
35  const Vector& GetX0() const { return x0; }
36  const Vector& GetOptimum() const { return xopt; }
37  void SetObjectiveBreak(double val) { objectiveBreak=val; }
38 
39  double tol_zero, tol_inner, tol_outer;
40  double objectiveBreak; //stop when f'*x < objectiveBreak
41  int verbose;
42 
43 private:
44  double Objective_Ineq(const Vector& x, double t);
45  bool FindFeasiblePoint();
46 
47  Vector x0;
48  Vector xopt;
49 };
50 
61 {
63  bool Set(const LinearProgram& lp);
64  LP_InteriorPointSolver::Result Solve();
65 
66  void SetObjective(const Vector& c);
67  void SetInitialPoint(const Vector& xinit);
68  void GetInitialPoint(Vector& xinit) const;
69  void GetOptimum(Vector& xopt) const;
70  void SetObjectiveBreak(double val);
71 
72  Vector x0;
73  Matrix N;
74  Real foffset; //f'*x0
76 };
77 
78 } //namespace Optimization
79 
80 #endif
Namespace for classes and functions in the Optimization package.
Definition: CSet.h:7
An interior-point method for solving a LP.
Definition: LP_InteriorPoint.h:27
Linear program definition.Represents the LP min/max c.x subject to qi <= ai.x <= pi lj <= xj <= u...
Definition: LinearProgram.h:139
Solves a general LP using LP_InteriorPointSolver.
Definition: LP_InteriorPoint.h:60