trajopt
 All Classes Namespaces Files Functions Variables Typedefs Pages
gurobi_interface.hpp
Go to the documentation of this file.
1 #include "solver_interface.hpp"
2 
11 struct _GRBmodel;
12 typedef struct _GRBmodel GRBmodel;
13 
14 namespace sco {
15 
16 class GurobiModel : public Model {
17 public:
18  GRBmodel* m_model;
19  vector<Var> m_vars;
20  vector<Cnt> m_cnts;
21 
22  GurobiModel();
23 
24  Var addVar(const string& name);
25  Var addVar(const string& name, double lower, double upper);
26 
27  Cnt addEqCnt(const AffExpr&, const string& name);
28  Cnt addIneqCnt(const AffExpr&, const string& name);
29  Cnt addIneqCnt(const QuadExpr&, const string& name);
30 
31  void removeVars(const vector<Var>&);
32  void removeCnts(const vector<Cnt>&);
33 
34  void update();
35  void setVarBounds(const std::vector<Var>&, const std::vector<double>& lower, const std::vector<double>& upper);
36  vector<double> getVarValues(const vector<Var>&) const;
37 
38  CvxOptStatus optimize();
40  CvxOptStatus optimizeFeasRelax();
41 
42  void setObjective(const AffExpr&);
43  void setObjective(const QuadExpr&);
44  void writeToFile(const string& fname);
45 
46  VarVector getVars() const;
47 
48  ~GurobiModel();
49 
50 };
51 
52 
53 }
54