C API Reference#
This section documents the Gurobi C interface. This manual begins with a quick overview of the functions in the interface, and continues with detailed descriptions of all of the available interface routines.
If you are new to the Gurobi Optimizer, we suggest that you start with the Getting Started Knowledge Base article for general information. This also includes Tutorials for the different Gurobi APIs. Additionally, our Example Tour provides concrete examples of how to use the routines described here. We will point to sections or examples of this tour whenever it fits in this overview.
Contents
- Overview
- Environments
- Models
- Solving a Model
- Multiple Solutions, Objectives, and Scenarios
- Infeasible Models
- Querying and Modifying Attributes
- Additional Model Modification Information
- Lazy Updates
- Managing Parameters
- Monitoring Progress - Logging and Callbacks
- Modifying Solver Behavior - Callbacks
- Batch Optimization
- Error Handling
- Environment Creation and Destruction
- Model Creation and Modification
GRBloadmodel
GRBnewmodel
GRBcopymodel
GRBaddconstr
GRBaddconstrs
GRBaddgenconstrMax
GRBaddgenconstrMin
GRBaddgenconstrAbs
GRBaddgenconstrAnd
GRBaddgenconstrOr
GRBaddgenconstrNorm
GRBaddgenconstrIndicator
GRBaddgenconstrPWL
GRBaddgenconstrPoly
GRBaddgenconstrExp
GRBaddgenconstrExpA
GRBaddgenconstrLog
GRBaddgenconstrLogA
GRBaddgenconstrLogistic
GRBaddgenconstrPow
GRBaddgenconstrSin
GRBaddgenconstrCos
GRBaddgenconstrTan
GRBdelgenconstrs
GRBaddqconstr
GRBaddqpterms
GRBaddrangeconstr
GRBaddrangeconstrs
GRBaddsos
GRBaddvar
GRBaddvars
GRBchgcoeffs
GRBdelconstrs
GRBdelq
GRBdelqconstrs
GRBdelsos
GRBdelvars
GRBsetobjectiven
GRBsetpwlobj
GRBupdatemodel
GRBfreemodel
GRBXaddconstrs
GRBXaddrangeconstrs
GRBXaddvars
GRBXchgcoeffs
GRBXloadmodel
- Model Solution
- Model Queries
GRBgetcoeff
GRBgetconstrbyname
GRBgetconstrs
GRBgetenv
GRBgetgenconstrMax
GRBgetgenconstrMin
GRBgetgenconstrAbs
GRBgetgenconstrAnd
GRBgetgenconstrOr
GRBgetgenconstrNorm
GRBgetgenconstrIndicator
GRBgetgenconstrPWL
GRBgetgenconstrPoly
GRBgetgenconstrExp
GRBgetgenconstrExpA
GRBgetgenconstrLog
GRBgetgenconstrLogA
GRBgetgenconstrLogistic
GRBgetgenconstrPow
GRBgetgenconstrSin
GRBgetgenconstrCos
GRBgetgenconstrTan
GRBgetjsonsolution
GRBgetpwlobj
GRBgetq
GRBgetqconstr
GRBgetqconstrbyname
GRBgetsos
GRBgetvarbyname
GRBgetvars
GRBsinglescenariomodel
GRBXgetconstrs
GRBXgetvars
- Input/Output
- Attribute Management
GRBgetattrinfo
GRBgetintattr
GRBsetintattr
GRBgetintattrelement
GRBsetintattrelement
GRBgetintattrarray
GRBsetintattrarray
GRBgetintattrlist
GRBsetintattrlist
GRBgetdblattr
GRBsetdblattr
GRBgetdblattrelement
GRBsetdblattrelement
GRBgetdblattrarray
GRBsetdblattrarray
GRBgetdblattrlist
GRBsetdblattrlist
GRBgetcharattrelement
GRBsetcharattrelement
GRBgetcharattrarray
GRBsetcharattrarray
GRBgetcharattrlist
GRBsetcharattrlist
GRBgetstrattr
GRBsetstrattr
GRBgetstrattrelement
GRBsetstrattrelement
GRBgetstrattrarray
GRBsetstrattrarray
GRBgetstrattrlist
GRBsetstrattrlist
GRBgetbatchattrinfo
- Parameter Management
- Monitoring Progress - Logging and Callbacks
- Modifying Solver Behavior - Callbacks
- Batch Requests
- Error Handling
- Parameter Tuning
- Advanced simplex routines