OR-Tools  9.6
Gurobi

Detailed Description

Definition at line 155 of file g_gurobi.h.

Classes

class  CallbackContext
 
struct  SparseMat
 

Public Types

using Callback = std::function< absl::Status(const CallbackContext &)>
 

Public Member Functions

 ~Gurobi ()
 
absl::Status AddVar (double obj, double lb, double ub, char vtype, const std::string &name)
 
absl::Status AddVar (absl::Span< const int > vind, absl::Span< const double > vval, double obj, double lb, double ub, char vtype, const std::string &name)
 
absl::Status AddVars (absl::Span< const double > obj, absl::Span< const double > lb, absl::Span< const double > ub, absl::Span< const char > vtype, absl::Span< const std::string > names)
 
absl::Status AddVars (absl::Span< const int > vbegin, absl::Span< const int > vind, absl::Span< const double > vval, absl::Span< const double > obj, absl::Span< const double > lb, absl::Span< const double > ub, absl::Span< const char > vtype, absl::Span< const std::string > names)
 
absl::Status DelVars (absl::Span< const int > ind)
 
absl::Status AddConstr (char sense, double rhs, const std::string &name)
 
absl::Status AddConstr (absl::Span< const int > cind, absl::Span< const double > cval, char sense, double rhs, const std::string &name)
 
absl::Status AddConstrs (absl::Span< const char > sense, absl::Span< const double > rhs, absl::Span< const std::string > names)
 
absl::Status DelConstrs (absl::Span< const int > ind)
 
absl::Status ChgCoeffs (absl::Span< const int > cind, absl::Span< const int > vind, absl::Span< const double > val)
 
absl::Status AddQpTerms (absl::Span< const int > qrow, absl::Span< const int > qcol, absl::Span< const double > qval)
 
absl::Status DelQ ()
 
absl::Status SetNthObjective (int index, int priority, double weight, double abs_tol, double rel_tol, const std::string &name, double constant, absl::Span< const int > lind, absl::Span< const double > lval)
 
absl::Status AddQConstr (absl::Span< const int > lind, absl::Span< const double > lval, absl::Span< const int > qrow, absl::Span< const int > qcol, absl::Span< const double > qval, char sense, double rhs, const std::string &name)
 
absl::Status DelQConstrs (const absl::Span< const int > ind)
 
absl::Status AddSos (absl::Span< const int > types, absl::Span< const int > beg, absl::Span< const int > ind, absl::Span< const double > weight)
 
absl::Status DelSos (absl::Span< const int > ind)
 
absl::Status AddIndicator (const std::string &name, int binvar, int binval, absl::Span< const int > ind, absl::Span< const double > val, char sense, double rhs)
 
absl::Status DelGenConstrs (absl::Span< const int > ind)
 
absl::StatusOr< int > GetNnz (int first_var, int num_vars)
 
absl::Status GetVars (absl::Span< int > vbegin, absl::Span< int > vind, absl::Span< double > vval, int first_var, int num_vars)
 
absl::StatusOr< SparseMatGetVars (int first_var, int num_vars)
 
absl::Status UpdateModel ()
 
absl::Status Optimize (Callback cb=nullptr)
 
void Terminate ()
 
bool IsAttrAvailable (const char *name) const
 
absl::StatusOr< int > GetIntAttr (const char *name) const
 
absl::Status SetIntAttr (const char *attr_name, int value)
 
absl::StatusOr< double > GetDoubleAttr (const char *name) const
 
absl::Status SetDoubleAttr (const char *attr_name, double value)
 
absl::StatusOr< std::string > GetStringAttr (const char *name) const
 
absl::Status SetStringAttr (const char *attr_name, const std::string &value)
 
absl::Status GetIntAttrArray (const char *name, absl::Span< int > attr_out) const
 
absl::StatusOr< std::vector< int > > GetIntAttrArray (const char *name, int len) const
 
absl::Status SetIntAttrArray (const char *name, absl::Span< const int > new_values)
 
absl::Status SetIntAttrList (const char *name, absl::Span< const int > ind, absl::Span< const int > new_values)
 
absl::Status GetDoubleAttrArray (const char *name, absl::Span< double > attr_out) const
 
absl::StatusOr< std::vector< double > > GetDoubleAttrArray (const char *name, int len) const
 
absl::Status SetDoubleAttrArray (const char *name, absl::Span< const double > new_values)
 
absl::Status SetDoubleAttrList (const char *name, absl::Span< const int > ind, absl::Span< const double > new_values)
 
absl::Status GetCharAttrArray (const char *name, absl::Span< char > attr_out) const
 
absl::StatusOr< std::vector< char > > GetCharAttrArray (const char *name, int len) const
 
absl::Status SetCharAttrArray (const char *name, absl::Span< const char > new_values)
 
absl::Status SetCharAttrList (const char *name, absl::Span< const int > ind, absl::Span< const char > new_values)
 
absl::StatusOr< double > GetDoubleAttrElement (const char *name, int element) const
 
absl::Status SetDoubleAttrElement (const char *name, int element, double new_value)
 
absl::StatusOr< char > GetCharAttrElement (const char *name, int element) const
 
absl::Status SetCharAttrElement (const char *name, int element, char new_value)
 
absl::Status SetParam (const char *name, const std::string &value)
 
absl::Status SetIntParam (const char *name, int value)
 
absl::Status SetDoubleParam (const char *name, double value)
 
absl::Status SetStringParam (const char *name, const std::string &value)
 
absl::StatusOr< int > GetIntParam (const char *name)
 
absl::StatusOr< double > GetDoubleParam (const char *name)
 
absl::StatusOr< std::string > GetStringParam (const char *name)
 
absl::Status ResetParameters ()
 
GRBmodelmodel () const
 

Static Public Member Functions

static absl::StatusOr< std::unique_ptr< Gurobi > > New (GRBenvUniquePtr primary_env=nullptr)
 
static absl::StatusOr< std::unique_ptr< Gurobi > > NewWithSharedPrimaryEnv (GRBenv *primary_env)
 

Member Typedef Documentation

◆ Callback

using Callback = std::function<absl::Status(const CallbackContext&)>

Definition at line 228 of file g_gurobi.h.

Constructor & Destructor Documentation

◆ ~Gurobi()

~Gurobi ( )

Definition at line 153 of file g_gurobi.cc.

Member Function Documentation

◆ AddConstr() [1/2]

absl::Status AddConstr ( absl::Span< const int >  cind,
absl::Span< const double >  cval,
char  sense,
double  rhs,
const std::string &  name 
)

Definition at line 252 of file g_gurobi.cc.

◆ AddConstr() [2/2]

absl::Status AddConstr ( char  sense,
double  rhs,
const std::string &  name 
)

Definition at line 247 of file g_gurobi.cc.

◆ AddConstrs()

absl::Status AddConstrs ( absl::Span< const char >  sense,
absl::Span< const double >  rhs,
absl::Span< const std::string >  names 
)

Definition at line 267 of file g_gurobi.cc.

◆ AddIndicator()

absl::Status AddIndicator ( const std::string &  name,
int  binvar,
int  binval,
absl::Span< const int >  ind,
absl::Span< const double >  val,
char  sense,
double  rhs 
)

Definition at line 386 of file g_gurobi.cc.

◆ AddQConstr()

absl::Status AddQConstr ( absl::Span< const int >  lind,
absl::Span< const double >  lval,
absl::Span< const int >  qrow,
absl::Span< const int >  qcol,
absl::Span< const double >  qval,
char  sense,
double  rhs,
const std::string &  name 
)

Definition at line 330 of file g_gurobi.cc.

◆ AddQpTerms()

absl::Status AddQpTerms ( absl::Span< const int >  qrow,
absl::Span< const int >  qcol,
absl::Span< const double >  qval 
)

Definition at line 294 of file g_gurobi.cc.

◆ AddSos()

absl::Status AddSos ( absl::Span< const int >  types,
absl::Span< const int >  beg,
absl::Span< const int >  ind,
absl::Span< const double >  weight 
)

Definition at line 363 of file g_gurobi.cc.

◆ AddVar() [1/2]

absl::Status AddVar ( absl::Span< const int >  vind,
absl::Span< const double >  vval,
double  obj,
double  lb,
double  ub,
char  vtype,
const std::string &  name 
)

Definition at line 177 of file g_gurobi.cc.

◆ AddVar() [2/2]

absl::Status AddVar ( double  obj,
double  lb,
double  ub,
char  vtype,
const std::string &  name 
)

Definition at line 172 of file g_gurobi.cc.

◆ AddVars() [1/2]

absl::Status AddVars ( absl::Span< const double >  obj,
absl::Span< const double >  lb,
absl::Span< const double >  ub,
absl::Span< const char >  vtype,
absl::Span< const std::string >  names 
)

Definition at line 193 of file g_gurobi.cc.

◆ AddVars() [2/2]

absl::Status AddVars ( absl::Span< const int >  vbegin,
absl::Span< const int >  vind,
absl::Span< const double >  vval,
absl::Span< const double >  obj,
absl::Span< const double >  lb,
absl::Span< const double >  ub,
absl::Span< const char >  vtype,
absl::Span< const std::string >  names 
)

Definition at line 201 of file g_gurobi.cc.

◆ ChgCoeffs()

absl::Status ChgCoeffs ( absl::Span< const int >  cind,
absl::Span< const int >  vind,
absl::Span< const double >  val 
)

Definition at line 405 of file g_gurobi.cc.

◆ DelConstrs()

absl::Status DelConstrs ( absl::Span< const int >  ind)

Definition at line 289 of file g_gurobi.cc.

◆ DelGenConstrs()

absl::Status DelGenConstrs ( absl::Span< const int >  ind)

Definition at line 400 of file g_gurobi.cc.

◆ DelQ()

absl::Status DelQ ( )

Definition at line 305 of file g_gurobi.cc.

◆ DelQConstrs()

absl::Status DelQConstrs ( const absl::Span< const int >  ind)

Definition at line 358 of file g_gurobi.cc.

◆ DelSos()

absl::Status DelSos ( absl::Span< const int >  ind)

Definition at line 381 of file g_gurobi.cc.

◆ DelVars()

absl::Status DelVars ( absl::Span< const int >  ind)

Definition at line 242 of file g_gurobi.cc.

◆ GetCharAttrArray() [1/2]

absl::Status GetCharAttrArray ( const char *  name,
absl::Span< char >  attr_out 
) const

Definition at line 581 of file g_gurobi.cc.

◆ GetCharAttrArray() [2/2]

absl::StatusOr< std::vector< char > > GetCharAttrArray ( const char *  name,
int  len 
) const

Definition at line 589 of file g_gurobi.cc.

◆ GetCharAttrElement()

absl::StatusOr< char > GetCharAttrElement ( const char *  name,
int  element 
) const

Definition at line 640 of file g_gurobi.cc.

◆ GetDoubleAttr()

absl::StatusOr< double > GetDoubleAttr ( const char *  name) const

Definition at line 499 of file g_gurobi.cc.

◆ GetDoubleAttrArray() [1/2]

absl::Status GetDoubleAttrArray ( const char *  name,
absl::Span< double >  attr_out 
) const

Definition at line 566 of file g_gurobi.cc.

◆ GetDoubleAttrArray() [2/2]

absl::StatusOr< std::vector< double > > GetDoubleAttrArray ( const char *  name,
int  len 
) const

Definition at line 574 of file g_gurobi.cc.

◆ GetDoubleAttrElement()

absl::StatusOr< double > GetDoubleAttrElement ( const char *  name,
int  element 
) const

Definition at line 626 of file g_gurobi.cc.

◆ GetDoubleParam()

absl::StatusOr< double > GetDoubleParam ( const char *  name)

Definition at line 680 of file g_gurobi.cc.

◆ GetIntAttr()

absl::StatusOr< int > GetIntAttr ( const char *  name) const

Definition at line 492 of file g_gurobi.cc.

◆ GetIntAttrArray() [1/2]

absl::Status GetIntAttrArray ( const char *  name,
absl::Span< int >  attr_out 
) const

Definition at line 551 of file g_gurobi.cc.

◆ GetIntAttrArray() [2/2]

absl::StatusOr< std::vector< int > > GetIntAttrArray ( const char *  name,
int  len 
) const

Definition at line 559 of file g_gurobi.cc.

◆ GetIntParam()

absl::StatusOr< int > GetIntParam ( const char *  name)

Definition at line 674 of file g_gurobi.cc.

◆ GetNnz()

absl::StatusOr< int > GetNnz ( int  first_var,
int  num_vars 
)

Definition at line 416 of file g_gurobi.cc.

◆ GetStringAttr()

absl::StatusOr< std::string > GetStringAttr ( const char *  name) const

Definition at line 506 of file g_gurobi.cc.

◆ GetStringParam()

absl::StatusOr< std::string > GetStringParam ( const char *  name)

Definition at line 686 of file g_gurobi.cc.

◆ GetVars() [1/2]

absl::Status GetVars ( absl::Span< int >  vbegin,
absl::Span< int >  vind,
absl::Span< double >  vval,
int  first_var,
int  num_vars 
)

Definition at line 423 of file g_gurobi.cc.

◆ GetVars() [2/2]

absl::StatusOr< Gurobi::SparseMat > GetVars ( int  first_var,
int  num_vars 
)

Definition at line 437 of file g_gurobi.cc.

◆ IsAttrAvailable()

bool IsAttrAvailable ( const char *  name) const

Definition at line 488 of file g_gurobi.cc.

◆ model()

GRBmodel* model ( ) const
inline

Definition at line 557 of file g_gurobi.h.

◆ New()

absl::StatusOr< std::unique_ptr< Gurobi > > New ( GRBenvUniquePtr  primary_env = nullptr)
static

Definition at line 109 of file g_gurobi.cc.

◆ NewWithSharedPrimaryEnv()

absl::StatusOr< std::unique_ptr< Gurobi > > NewWithSharedPrimaryEnv ( GRBenv primary_env)
static

Definition at line 103 of file g_gurobi.cc.

◆ Optimize()

absl::Status Optimize ( Callback  cb = nullptr)

Definition at line 456 of file g_gurobi.cc.

◆ ResetParameters()

absl::Status ResetParameters ( )

Definition at line 692 of file g_gurobi.cc.

◆ SetCharAttrArray()

absl::Status SetCharAttrArray ( const char *  name,
absl::Span< const char >  new_values 
)

Definition at line 545 of file g_gurobi.cc.

◆ SetCharAttrElement()

absl::Status SetCharAttrElement ( const char *  name,
int  element,
char  new_value 
)

Definition at line 648 of file g_gurobi.cc.

◆ SetCharAttrList()

absl::Status SetCharAttrList ( const char *  name,
absl::Span< const int >  ind,
absl::Span< const char >  new_values 
)

Definition at line 616 of file g_gurobi.cc.

◆ SetDoubleAttr()

absl::Status SetDoubleAttr ( const char *  attr_name,
double  value 
)

Definition at line 528 of file g_gurobi.cc.

◆ SetDoubleAttrArray()

absl::Status SetDoubleAttrArray ( const char *  name,
absl::Span< const double >  new_values 
)

Definition at line 539 of file g_gurobi.cc.

◆ SetDoubleAttrElement()

absl::Status SetDoubleAttrElement ( const char *  name,
int  element,
double  new_value 
)

Definition at line 634 of file g_gurobi.cc.

◆ SetDoubleAttrList()

absl::Status SetDoubleAttrList ( const char *  name,
absl::Span< const int >  ind,
absl::Span< const double >  new_values 
)

Definition at line 606 of file g_gurobi.cc.

◆ SetDoubleParam()

absl::Status SetDoubleParam ( const char *  name,
double  value 
)

Definition at line 664 of file g_gurobi.cc.

◆ SetIntAttr()

absl::Status SetIntAttr ( const char *  attr_name,
int  value 
)

Definition at line 524 of file g_gurobi.cc.

◆ SetIntAttrArray()

absl::Status SetIntAttrArray ( const char *  name,
absl::Span< const int >  new_values 
)

Definition at line 533 of file g_gurobi.cc.

◆ SetIntAttrList()

absl::Status SetIntAttrList ( const char *  name,
absl::Span< const int >  ind,
absl::Span< const int >  new_values 
)

Definition at line 596 of file g_gurobi.cc.

◆ SetIntParam()

absl::Status SetIntParam ( const char *  name,
int  value 
)

Definition at line 660 of file g_gurobi.cc.

◆ SetNthObjective()

absl::Status SetNthObjective ( int  index,
int  priority,
double  weight,
double  abs_tol,
double  rel_tol,
const std::string &  name,
double  constant,
absl::Span< const int >  lind,
absl::Span< const double >  lval 
)

Definition at line 307 of file g_gurobi.cc.

◆ SetParam()

absl::Status SetParam ( const char *  name,
const std::string &  value 
)

Definition at line 655 of file g_gurobi.cc.

◆ SetStringAttr()

absl::Status SetStringAttr ( const char *  attr_name,
const std::string &  value 
)

Definition at line 519 of file g_gurobi.cc.

◆ SetStringParam()

absl::Status SetStringParam ( const char *  name,
const std::string &  value 
)

Definition at line 669 of file g_gurobi.cc.

◆ Terminate()

void Terminate ( )

Definition at line 696 of file g_gurobi.cc.

◆ UpdateModel()

absl::Status UpdateModel ( )

Definition at line 452 of file g_gurobi.cc.


The documentation for this class was generated from the following files: