Cbc  2.10.10
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Functions
Cbc_C_Interface.h File Reference
#include "Coin_C_defines.h"
#include <stddef.h>
+ Include dependency graph for Cbc_C_Interface.h:

Go to the source code of this file.

Functions

const COINLIBAPI char *COINLINKAGE Cbc_getVersion (void)
 Current version of Cbc. More...
 
Problem creation and modification routines
COINLIBAPI Cbc_Model *COINLINKAGE Cbc_newModel (void)
 Creates an empty problem. More...
 
COINLIBAPI int COINLINKAGE Cbc_setProblemName (Cbc_Model *model, const char *array)
 Sets problem name. More...
 
COINLIBAPI void COINLINKAGE Cbc_addCol (Cbc_Model *model, const char *name, double lb, double ub, double obj, char isInteger, int nz, int *rows, double *coefs)
 Creates a new column. More...
 
COINLIBAPI void COINLINKAGE Cbc_addRow (Cbc_Model *model, const char *name, int nz, const int *cols, const double *coefs, char sense, double rhs)
 Adds a new row. More...
 
COINLIBAPI void COINLINKAGE Cbc_addSOS (Cbc_Model *model, int numRows, const int *rowStarts, const int *colIndices, const double *weights, const int type)
 Add SOS constraints to the model using row-order matrix. More...
 
COINLIBAPI void COINLINKAGE Cbc_loadProblem (Cbc_Model *model, const int numcols, const int numrows, const CoinBigIndex *start, const int *index, const double *value, const double *collb, const double *colub, const double *obj, const double *rowlb, const double *rowub)
 Loads a problem (the constraints on the rows are given by lower and upper bounds). More...
 
COINLIBAPI void COINLINKAGE Cbc_setColName (Cbc_Model *model, int iColumn, const char *name)
 Set the name of a column. More...
 
COINLIBAPI void COINLINKAGE Cbc_setRowName (Cbc_Model *model, int iRow, const char *name)
 Set the name of a row. More...
 
COINLIBAPI void COINLINKAGE Cbc_setObjSense (Cbc_Model *model, double sense)
 Sets optimization direction. More...
 
COINLIBAPI void COINLINKAGE Cbc_setRowLower (Cbc_Model *model, int index, double value)
 Set the lower bound of a single constraint. More...
 
COINLIBAPI void COINLINKAGE Cbc_setRowUpper (Cbc_Model *model, int index, double value)
 Set the upper bound of a single constraint. More...
 
COINLIBAPI void COINLINKAGE Cbc_setObjCoeff (Cbc_Model *model, int index, double value)
 Set the objective coefficient of a single variable. More...
 
COINLIBAPI void COINLINKAGE Cbc_setColLower (Cbc_Model *model, int index, double value)
 Set the lower bound of a single variable. More...
 
COINLIBAPI void COINLINKAGE Cbc_setColUpper (Cbc_Model *model, int index, double value)
 Set the upper bound of a single variable. More...
 
COINLIBAPI void COINLINKAGE Cbc_setContinuous (Cbc_Model *model, int iColumn)
 Set this variable to be continuous. More...
 
COINLIBAPI void COINLINKAGE Cbc_setInteger (Cbc_Model *model, int iColumn)
 Set this variable to be integer. More...
 
COINLIBAPI void COINLINKAGE Cbc_deleteModel (Cbc_Model *model)
 Cbc_Model destructor. More...
 
COINLIBAPI void COINLINKAGE Cbc_setMIPStart (Cbc_Model *model, int count, const char **colNames, const double colValues[])
 Enter initial feasible solution. More...
 
COINLIBAPI void COINLINKAGE Cbc_setMIPStartI (Cbc_Model *model, int count, const int colIdxs[], const double colValues[])
 Enter initial feasible solution. More...
 
COINLIBAPI Cbc_Model *COINLINKAGE Cbc_clone (Cbc_Model *model)
 Creates a copy of the current model. More...
 
Routines to query problem contents
COINLIBAPI void COINLINKAGE Cbc_problemName (Cbc_Model *model, int maxNumberCharacters, char *array)
 Queries problem name. More...
 
COINLIBAPI int COINLINKAGE Cbc_getNumElements (Cbc_Model *model)
 Number of nonzero elements in constraint matrix. More...
 
COINLIBAPI int COINLINKAGE Cbc_getNumCols (Cbc_Model *model)
 Number of variables in the model. More...
 
COINLIBAPI int COINLINKAGE Cbc_getNumIntegers (Cbc_Model *model)
 Number of integer variables in the model. More...
 
COINLIBAPI int COINLINKAGE Cbc_getNumRows (Cbc_Model *model)
 Number of constraints in the model. More...
 
COINLIBAPI void COINLINKAGE Cbc_getRowName (Cbc_Model *model, int iRow, char *name, size_t maxLength)
 Queries row name. More...
 
COINLIBAPI void COINLINKAGE Cbc_getColName (Cbc_Model *model, int iColumn, char *name, size_t maxLength)
 Queries column name. More...
 
COINLIBAPI int COINLINKAGE Cbc_getRowNz (Cbc_Model *model, int row)
 Number of non-zero entries in a row. More...
 
const COINLIBAPI int *COINLINKAGE Cbc_getRowIndices (Cbc_Model *model, int row)
 Indices of variables that appear on a row. More...
 
const COINLIBAPI double *COINLINKAGE Cbc_getRowCoeffs (Cbc_Model *model, int row)
 Coefficients of variables that appear on this row. More...
 
COINLIBAPI int COINLINKAGE Cbc_getColNz (Cbc_Model *model, int col)
 Number of non-zero entries in a column. More...
 
const COINLIBAPI int *COINLINKAGE Cbc_getColIndices (Cbc_Model *model, int col)
 Indices of rows that a column appears. More...
 
const COINLIBAPI double *COINLINKAGE Cbc_getColCoeffs (Cbc_Model *model, int col)
 Coefficients that a column appear in rows. More...
 
COINLIBAPI double COINLINKAGE Cbc_getRowRHS (Cbc_Model *model, int row)
 Right hand side of a row. More...
 
COINLIBAPI char COINLINKAGE Cbc_getRowSense (Cbc_Model *model, int row)
 Sense a row. More...
 
COINLIBAPI double COINLINKAGE Cbc_getObjSense (Cbc_Model *model)
 Direction of optimization. More...
 
const COINLIBAPI double *COINLINKAGE Cbc_getRowLower (Cbc_Model *model)
 Constraint lower bounds. More...
 
const COINLIBAPI double *COINLINKAGE Cbc_getRowUpper (Cbc_Model *model)
 Constraint upper bounds. More...
 
const COINLIBAPI double *COINLINKAGE Cbc_getObjCoefficients (Cbc_Model *model)
 Objective vector. More...
 
const COINLIBAPI double *COINLINKAGE Cbc_getColLower (Cbc_Model *model)
 Variable lower bounds. More...
 
const COINLIBAPI double *COINLINKAGE Cbc_getColUpper (Cbc_Model *model)
 Variable upper bounds. More...
 
COINLIBAPI int COINLINKAGE Cbc_isInteger (Cbc_Model *model, int i)
 Determine whether the ith variable is integer restricted. More...
 
Routines to load and save problems from disk
COINLIBAPI int COINLINKAGE Cbc_readMps (Cbc_Model *model, const char *filename)
 Read an mps file from the given filename. More...
 
COINLIBAPI int COINLINKAGE Cbc_readLp (Cbc_Model *model, const char *filename)
 Read an lp file from the given filename. More...
 
COINLIBAPI void COINLINKAGE Cbc_writeMps (Cbc_Model *model, const char *filename)
 Write an mps file from the given filename. More...
 
COINLIBAPI void COINLINKAGE Cbc_writeLp (Cbc_Model *model, const char *filename)
 Write an lp file from the given filename. More...
 
Getting and setting model data

Note that problem access and modification methods, such as getColLower and setColLower, are not valid after calling Cbc_solve().

Therefore it is not recommended to reuse a Cbc_Model object for multiple solves. A workaround is to call Cbc_clone() before solving.

COINLIBAPI void COINLINKAGE Cbc_setInitialSolution (Cbc_Model *model, const double *sol)
 Provide an initial feasible solution to accelerate branch-and-bound Note that feasibility of the solution is not verified. More...
 
const COINLIBAPI CoinBigIndex *COINLINKAGE Cbc_getVectorStarts (Cbc_Model *model)
 "Column start" vector of constraint matrix. More...
 
const COINLIBAPI int *COINLINKAGE Cbc_getIndices (Cbc_Model *model)
 "Row index" vector of constraint matrix More...
 
const COINLIBAPI double *COINLINKAGE Cbc_getElements (Cbc_Model *model)
 Coefficient vector of constraint matrix. More...
 
COINLIBAPI size_t COINLINKAGE Cbc_maxNameLength (Cbc_Model *model)
 Maximum lenght of a row or column name. More...
 
COINLIBAPI void COINLINKAGE Cbc_printModel (Cbc_Model *model, const char *argPrefix)
 Print the model. More...
 
Solver parameters
COINLIBAPI void COINLINKAGE Cbc_setParameter (Cbc_Model *model, const char *name, const char *value)
 Set parameter "name" to value "value". More...
 
COINLIBAPI double COINLINKAGE Cbc_getAllowableGap (Cbc_Model *model)
 returns the allowable gap More...
 
COINLIBAPI void COINLINKAGE Cbc_setAllowableGap (Cbc_Model *model, double allowedGap)
 sets the allowable gap More...
 
COINLIBAPI double COINLINKAGE Cbc_getAllowableFractionGap (Cbc_Model *model)
 returns the allowable fraction gap More...
 
COINLIBAPI void COINLINKAGE Cbc_setAllowableFractionGap (Cbc_Model *model, double allowedFracionGap)
 sets the allowable fraction gap More...
 
COINLIBAPI double COINLINKAGE Cbc_getAllowablePercentageGap (Cbc_Model *model)
 returns the allowable percentage gap More...
 
COINLIBAPI void COINLINKAGE Cbc_setAllowablePercentageGap (Cbc_Model *model, double allowedPercentageGap)
 sets the allowable percentage gap More...
 
COINLIBAPI double COINLINKAGE Cbc_getMaximumSeconds (Cbc_Model *model)
 returns the time limit for the search process More...
 
COINLIBAPI void COINLINKAGE Cbc_setMaximumSeconds (Cbc_Model *model, double maxSeconds)
 sets the time limit for the search process More...
 
COINLIBAPI int COINLINKAGE Cbc_getMaximumNodes (Cbc_Model *model)
 returns the maximum number of nodes that can be explored in the search tree More...
 
COINLIBAPI void COINLINKAGE Cbc_setMaximumNodes (Cbc_Model *model, int maxNodes)
 sets the maximum number of nodes that can be explored in the search tree More...
 
COINLIBAPI int COINLINKAGE Cbc_getMaximumSolutions (Cbc_Model *model)
 returns solution limit for the search process More...
 
COINLIBAPI void COINLINKAGE Cbc_setMaximumSolutions (Cbc_Model *model, int maxSolutions)
 sets a solution limit as a stopping criterion More...
 
COINLIBAPI int COINLINKAGE Cbc_getLogLevel (Cbc_Model *model)
 returns the current log leven More...
 
COINLIBAPI void COINLINKAGE Cbc_setLogLevel (Cbc_Model *model, int logLevel)
 sets the log level More...
 
COINLIBAPI double COINLINKAGE Cbc_getCutoff (Cbc_Model *model)
 returns the cutoff More...
 
COINLIBAPI void COINLINKAGE Cbc_setCutoff (Cbc_Model *model, double cutoff)
 sets the cutoff More...
 
Message handling. Call backs are handled by ONE function
COINLIBAPI void COINLINKAGE Cbc_registerCallBack (Cbc_Model *model, cbc_callback userCallBack)
 Pass in Callback function. More...
 
COINLIBAPI void COINLINKAGE Cbc_clearCallBack (Cbc_Model *model)
 Unset Callback function. More...
 
COINLIBAPI void COINLINKAGE Cbc_addCutCallback (Cbc_Model *model, cbc_cut_callback cutcb, const char *name, void *appData)
 
Solving the model
COINLIBAPI int COINLINKAGE Cbc_solve (Cbc_Model *model)
 
Accessing the solution and optimization status
const COINLIBAPI double *COINLINKAGE Cbc_getColSolution (Cbc_Model *model)
 Best feasible solution vector. More...
 
COINLIBAPI double COINLINKAGE Cbc_getBestPossibleObjValue (Cbc_Model *model)
 Best known bound on the optimal objective value. More...
 
COINLIBAPI double *COINLINKAGE Cbc_bestSolution (Cbc_Model *model)
 Best integer feasible solution. More...
 
COINLIBAPI int COINLINKAGE Cbc_numberSavedSolutions (Cbc_Model *model)
 number of integer feasible solution saved More...
 
const COINLIBAPI double *COINLINKAGE Cbc_savedSolution (Cbc_Model *model, int whichSol)
 Vector with the i-th saved solution. More...
 
COINLIBAPI double COINLINKAGE Cbc_savedSolutionObj (Cbc_Model *model, int whichSol)
 Cost of the whichSol solution. More...
 
const COINLIBAPI double *COINLINKAGE Cbc_getReducedCost (Cbc_Model *model)
 Queries vector of reduced costs. More...
 
COINLIBAPI int COINLINKAGE Cbc_isAbandoned (Cbc_Model *model)
 If optimization was abandoned due to numerical difficulties. More...
 
COINLIBAPI int COINLINKAGE Cbc_isProvenOptimal (Cbc_Model *model)
 If the optimal solution was found. More...
 
COINLIBAPI int COINLINKAGE Cbc_isProvenInfeasible (Cbc_Model *model)
 If infeasibility was proven. More...
 
COINLIBAPI int COINLINKAGE Cbc_isContinuousUnbounded (Cbc_Model *model)
 Is continuous model unbounded ? More...
 
COINLIBAPI double COINLINKAGE Cbc_getObjValue (Cbc_Model *model)
 Objective value of best feasible solution. More...
 
COINLIBAPI int COINLINKAGE Cbc_status (Cbc_Model *model)
 Final optimization status. More...
 
COINLIBAPI int COINLINKAGE Cbc_secondaryStatus (Cbc_Model *model)
 Secondary status of problem. More...
 
COINLIBAPI double COINLINKAGE Cbc_sumPrimalInfeasibilities (Cbc_Model *model)
 Sum of primal infeasibilities. More...
 
COINLIBAPI int COINLINKAGE Cbc_numberPrimalInfeasibilities (Cbc_Model *model)
 Number of primal infeasibilities. More...
 
COINLIBAPI void COINLINKAGE Cbc_checkSolution (Cbc_Model *model)
 Just check solution (for external use) - sets sum of infeasibilities etc. More...
 
COINLIBAPI int COINLINKAGE Cbc_getIterationCount (Cbc_Model *model)
 Number of iterations. More...
 
COINLIBAPI int COINLINKAGE Cbc_isNodeLimitReached (Cbc_Model *model)
 Node limit reached? More...
 
COINLIBAPI int COINLINKAGE Cbc_isSecondsLimitReached (Cbc_Model *model)
 Time limit reached? More...
 
COINLIBAPI int COINLINKAGE Cbc_isSolutionLimitReached (Cbc_Model *model)
 Solution limit reached? More...
 
COINLIBAPI int COINLINKAGE Cbc_isInitialSolveAbandoned (Cbc_Model *model)
 Are there numerical difficulties (for initialSolve) ? More...
 
COINLIBAPI int COINLINKAGE Cbc_isInitialSolveProvenOptimal (Cbc_Model *model)
 Is optimality proven (for initialSolve) ? More...
 
COINLIBAPI int COINLINKAGE Cbc_isInitialSolveProvenPrimalInfeasible (Cbc_Model *model)
 Is primal infeasiblity proven (for initialSolve) ? More...
 
const COINLIBAPI double *COINLINKAGE Cbc_getRowActivity (Cbc_Model *model)
 "row" solution This is the vector A*x, where A is the constraint matrix and x is the current solution. More...
 
COINLIBAPI int COINLINKAGE Cbc_getNodeCount (Cbc_Model *model)
 Number of nodes explored in B&B tree. More...
 
COINLIBAPI void COINLINKAGE Cbc_printSolution (Cbc_Model *model)
 Print the solution. More...
 
OsiSolverInterface related routines (used in callbacks)
COINLIBAPI int COINLINKAGE Osi_getNumCols (void *osi)
 Returns number of cols in OsiSolverInterface object. More...
 
COINLIBAPI void COINLINKAGE Osi_getColName (void *osi, int i, char *name, int maxLen)
 Returns column name in OsiSolverInterface object. More...
 
const COINLIBAPI double *COINLINKAGE Osi_getColLower (void *osi)
 Returns column lower bounds in OsiSolverInterface object. More...
 
const COINLIBAPI double *COINLINKAGE Osi_getColUpper (void *osi)
 Returns column upper bounds in OsiSolverInterface object. More...
 
COINLIBAPI int COINLINKAGE Osi_isInteger (void *osi, int col)
 Returns integrality information for columns in OsiSolverInterface object. More...
 
COINLIBAPI int COINLINKAGE Osi_getNumRows (void *osi)
 Returns number of rows in OsiSolverInterface object. More...
 
COINLIBAPI int COINLINKAGE Osi_getRowNz (void *osi, int row)
 
const COINLIBAPI int *COINLINKAGE Osi_getRowIndices (void *osi, int row)
 Indices of variables that appear on a row. More...
 
const COINLIBAPI double *COINLINKAGE Osi_getRowCoeffs (void *osi, int row)
 Coefficients of variables that appear on this row. More...
 
COINLIBAPI double COINLINKAGE Osi_getRowRHS (void *osi, int row)
 Right hand side of a row. More...
 
COINLIBAPI char COINLINKAGE Osi_getRowSense (void *osi, int row)
 Sense a row. More...
 
const COINLIBAPI double *COINLINKAGE Osi_getColSolution (void *osi)
 Returns solution vector in OsiSolverInterface object. More...
 
OsiCuts related routines (used in callbacks)
COINLIBAPI void COINLINKAGE OsiCuts_addRowCut (void *osiCuts, int nz, const int *idx, const double *coef, char sense, double rhs)
 adds a row cut (used in callback) More...
 

Function Documentation

◆ Cbc_getVersion()

const COINLIBAPI char* COINLINKAGE Cbc_getVersion ( void  )

Current version of Cbc.

◆ Cbc_newModel()

COINLIBAPI Cbc_Model* COINLINKAGE Cbc_newModel ( void  )

Creates an empty problem.

◆ Cbc_setProblemName()

COINLIBAPI int COINLINKAGE Cbc_setProblemName ( Cbc_Model *  model,
const char *  array 
)

Sets problem name.

Parameters
modelproblem object
arraystring with problem name

◆ Cbc_addCol()

COINLIBAPI void COINLINKAGE Cbc_addCol ( Cbc_Model *  model,
const char *  name,
double  lb,
double  ub,
double  obj,
char  isInteger,
int  nz,
int *  rows,
double *  coefs 
)

Creates a new column.

Creates a new column (variable)

Parameters
modelproblem object
namevariable name
lbcolumn lower bound
ubcolumn upper bound
objobjective function coefficient
isInteger1 if variable is integral, 0 otherwise
nznumber of rows (constraints) where this column appears, can be 0 if constraints will be added later
rowsindex of rows where this column appears, NULL if rows will be added later
coefscoefficients that this column appears in its rows, NULL if rows will be added later

◆ Cbc_addRow()

COINLIBAPI void COINLINKAGE Cbc_addRow ( Cbc_Model *  model,
const char *  name,
int  nz,
const int *  cols,
const double *  coefs,
char  sense,
double  rhs 
)

Adds a new row.

Adds a new row (linear constraint) to the problem

@param model problem object
@param name constraint name
@param nz number of variables with non-zero coefficients in this row
@param cols index of variables that appear in this row
@param coefs cofficients that that variables appear
@param sense constraint sense: L if <=, G if >=, E if =, R if ranged and N if free
@param rhs right hand size

◆ Cbc_addSOS()

COINLIBAPI void COINLINKAGE Cbc_addSOS ( Cbc_Model *  model,
int  numRows,
const int *  rowStarts,
const int *  colIndices,
const double *  weights,
const int  type 
)

Add SOS constraints to the model using row-order matrix.

◆ Cbc_loadProblem()

COINLIBAPI void COINLINKAGE Cbc_loadProblem ( Cbc_Model *  model,
const int  numcols,
const int  numrows,
const CoinBigIndex *  start,
const int *  index,
const double *  value,
const double *  collb,
const double *  colub,
const double *  obj,
const double *  rowlb,
const double *  rowub 
)

Loads a problem (the constraints on the rows are given by lower and upper bounds).

If a pointer is NULL then the following values are the default:

  • colub: all columns have upper bound infinity
  • collb: all columns have lower bound 0
  • rowub: all rows have upper bound infinity
  • rowlb: all rows have lower bound -infinity
  • obj: all variables have 0 objective coefficient

The constraint matrix is given in standard compressed sparse column (without gaps).

  • start[i] stores the starting index of the ith column
  • index[k] stores the row index of the kth nonzero element
  • value[k] stores the coefficient of the kth nonzero element

◆ Cbc_setColName()

COINLIBAPI void COINLINKAGE Cbc_setColName ( Cbc_Model *  model,
int  iColumn,
const char *  name 
)

Set the name of a column.

Parameters
modelproblem object
iColumncolumn index
columnname

◆ Cbc_setRowName()

COINLIBAPI void COINLINKAGE Cbc_setRowName ( Cbc_Model *  model,
int  iRow,
const char *  name 
)

Set the name of a row.

Parameters
modelproblem object
iRowrow index
namerow name

◆ Cbc_setObjSense()

COINLIBAPI void COINLINKAGE Cbc_setObjSense ( Cbc_Model *  model,
double  sense 
)

Sets optimization direction.

Parameters
modelproblem object
sensedirection of optimization (1 - minimize, -1 - maximize, 0 - ignore)

◆ Cbc_setRowLower()

COINLIBAPI void COINLINKAGE Cbc_setRowLower ( Cbc_Model *  model,
int  index,
double  value 
)

Set the lower bound of a single constraint.

Parameters
modelproblem object
indexrow index
valuenew row lower bound

◆ Cbc_setRowUpper()

COINLIBAPI void COINLINKAGE Cbc_setRowUpper ( Cbc_Model *  model,
int  index,
double  value 
)

Set the upper bound of a single constraint.

Parameters
modelproblem object
indexrow index
valuenew row upper bound

◆ Cbc_setObjCoeff()

COINLIBAPI void COINLINKAGE Cbc_setObjCoeff ( Cbc_Model *  model,
int  index,
double  value 
)

Set the objective coefficient of a single variable.

Parameters
modelproblem object
indexvariable index
valuenew objective function coefficient for this variable

◆ Cbc_setColLower()

COINLIBAPI void COINLINKAGE Cbc_setColLower ( Cbc_Model *  model,
int  index,
double  value 
)

Set the lower bound of a single variable.

Parameters
modelproblem object
indexvariable index
valuevariable lower bound

◆ Cbc_setColUpper()

COINLIBAPI void COINLINKAGE Cbc_setColUpper ( Cbc_Model *  model,
int  index,
double  value 
)

Set the upper bound of a single variable.

Parameters
modelproblem object
indexvariable index
valuenew variable upper bound

◆ Cbc_setContinuous()

COINLIBAPI void COINLINKAGE Cbc_setContinuous ( Cbc_Model *  model,
int  iColumn 
)

Set this variable to be continuous.

Parameters
modelproblem object
iColumncolumn index

◆ Cbc_setInteger()

COINLIBAPI void COINLINKAGE Cbc_setInteger ( Cbc_Model *  model,
int  iColumn 
)

Set this variable to be integer.

Parameters
modelproblem object
iColumncolumn index

◆ Cbc_deleteModel()

COINLIBAPI void COINLINKAGE Cbc_deleteModel ( Cbc_Model *  model)

Cbc_Model destructor.

◆ Cbc_setMIPStart()

COINLIBAPI void COINLINKAGE Cbc_setMIPStart ( Cbc_Model *  model,
int  count,
const char **  colNames,
const double  colValues[] 
)

Enter initial feasible solution.

Enter an initial feasible solution. Only the non-zero main binary/integer decision variables need to be informed. Auxiliary and/or continuous variables are computed automatically.

Parameters
modelproblem object
countnumber of variables
colNamesnames of variables
colValuesvariable values

◆ Cbc_setMIPStartI()

COINLIBAPI void COINLINKAGE Cbc_setMIPStartI ( Cbc_Model *  model,
int  count,
const int  colIdxs[],
const double  colValues[] 
)

Enter initial feasible solution.

Enter an initial feasible solution. Only the non-zero main binary/integer decision variables need to be informed. Auxiliary and/or continuous variables are computed automatically. Same as setMIPStart but using variable indexes.

Parameters
modelproblem object
countnumber of variables
colIdxsindexes of variables
colValuesvariable values

◆ Cbc_clone()

COINLIBAPI Cbc_Model* COINLINKAGE Cbc_clone ( Cbc_Model *  model)

Creates a copy of the current model.

Parameters
modelproblem object
Returns
model copy

◆ Cbc_problemName()

COINLIBAPI void COINLINKAGE Cbc_problemName ( Cbc_Model *  model,
int  maxNumberCharacters,
char *  array 
)

Queries problem name.

Parameters
modelproblem object
maxNumberCharactersspace in string array
arraystring where problem name will be saved

◆ Cbc_getNumElements()

COINLIBAPI int COINLINKAGE Cbc_getNumElements ( Cbc_Model *  model)

Number of nonzero elements in constraint matrix.

Parameters
modelproblem object
Returns
number of non-zero entries in constraint matrix

◆ Cbc_getNumCols()

COINLIBAPI int COINLINKAGE Cbc_getNumCols ( Cbc_Model *  model)

Number of variables in the model.

Parameters
modelproblem object
Returns
number of columns (variables)

◆ Cbc_getNumIntegers()

COINLIBAPI int COINLINKAGE Cbc_getNumIntegers ( Cbc_Model *  model)

Number of integer variables in the model.

Parameters
modelproblem object
Returns
number of integer variables in this model

◆ Cbc_getNumRows()

COINLIBAPI int COINLINKAGE Cbc_getNumRows ( Cbc_Model *  model)

Number of constraints in the model.

Parameters
modelproblem object
Returns
number of rows (constraints) in the model

◆ Cbc_getRowName()

COINLIBAPI void COINLINKAGE Cbc_getRowName ( Cbc_Model *  model,
int  iRow,
char *  name,
size_t  maxLength 
)

Queries row name.

Parameters
modelproblem object
rowindex
namestring where row name will be stored
stringwhere row name will be stored

◆ Cbc_getColName()

COINLIBAPI void COINLINKAGE Cbc_getColName ( Cbc_Model *  model,
int  iColumn,
char *  name,
size_t  maxLength 
)

Queries column name.

Parameters
modelproblem object
iColumncolumn index
namewhere name will be stored
maxLengthmaximum length of name string

◆ Cbc_getRowNz()

COINLIBAPI int COINLINKAGE Cbc_getRowNz ( Cbc_Model *  model,
int  row 
)

Number of non-zero entries in a row.

Parameters
modelproblem object
rowrow index
Returns
number of non-zero entries in row

◆ Cbc_getRowIndices()

const COINLIBAPI int* COINLINKAGE Cbc_getRowIndices ( Cbc_Model *  model,
int  row 
)

Indices of variables that appear on a row.

Parameters
modelproblem object
rowrow index
Returns
vector with indexes of columns that appear on this row

◆ Cbc_getRowCoeffs()

const COINLIBAPI double* COINLINKAGE Cbc_getRowCoeffs ( Cbc_Model *  model,
int  row 
)

Coefficients of variables that appear on this row.

Parameters
modelproblem object
rowrow index
Returns
coefficients of variables that appear on this row

◆ Cbc_getColNz()

COINLIBAPI int COINLINKAGE Cbc_getColNz ( Cbc_Model *  model,
int  col 
)

Number of non-zero entries in a column.

Parameters
modelproblem object
colcolumn index
Returns
numbef of rows that this column appears

◆ Cbc_getColIndices()

const COINLIBAPI int* COINLINKAGE Cbc_getColIndices ( Cbc_Model *  model,
int  col 
)

Indices of rows that a column appears.

Parameters
modelproblem object
colcolumn index
Returns
indices of rows that this column appears

◆ Cbc_getColCoeffs()

const COINLIBAPI double* COINLINKAGE Cbc_getColCoeffs ( Cbc_Model *  model,
int  col 
)

Coefficients that a column appear in rows.

Parameters
modelproblem object
colcolumn index
Returns
coefficients of this column in rows

◆ Cbc_getRowRHS()

COINLIBAPI double COINLINKAGE Cbc_getRowRHS ( Cbc_Model *  model,
int  row 
)

Right hand side of a row.

Parameters
modelproblem object
rowrow index
Returns
row right hand side

◆ Cbc_getRowSense()

COINLIBAPI char COINLINKAGE Cbc_getRowSense ( Cbc_Model *  model,
int  row 
)

Sense a row.

Parameters
modelproblem object
rowrow index
Returns
row sense: E for =, L for <=, G for >= and R for ranged row

◆ Cbc_getObjSense()

COINLIBAPI double COINLINKAGE Cbc_getObjSense ( Cbc_Model *  model)

Direction of optimization.

Parameters
modelproblem object
Returns
Direction of optimization (1 - minimize, -1 - maximize, 0 - ignore)

◆ Cbc_getRowLower()

const COINLIBAPI double* COINLINKAGE Cbc_getRowLower ( Cbc_Model *  model)

Constraint lower bounds.

Parameters
modelproblem object
Returns
vector with lower bounds of constraints

◆ Cbc_getRowUpper()

const COINLIBAPI double* COINLINKAGE Cbc_getRowUpper ( Cbc_Model *  model)

Constraint upper bounds.

Parameters
modelproblem object
Returns
constraint upper bounds

◆ Cbc_getObjCoefficients()

const COINLIBAPI double* COINLINKAGE Cbc_getObjCoefficients ( Cbc_Model *  model)

Objective vector.

Parameters
modelproblem object
Returns
vector with coefficients of variables in the objective function

◆ Cbc_getColLower()

const COINLIBAPI double* COINLINKAGE Cbc_getColLower ( Cbc_Model *  model)

Variable lower bounds.

Parameters
modelproblem object
Returns
vector with lower bounds of variables

◆ Cbc_getColUpper()

const COINLIBAPI double* COINLINKAGE Cbc_getColUpper ( Cbc_Model *  model)

Variable upper bounds.

Parameters
modelproblem object
Returns
vector with column upper bounds

◆ Cbc_isInteger()

COINLIBAPI int COINLINKAGE Cbc_isInteger ( Cbc_Model *  model,
int  i 
)

Determine whether the ith variable is integer restricted.

Parameters
modelproblem object
ivariable index
Returns
1 if variable is integer, 0 otherwise

◆ Cbc_readMps()

COINLIBAPI int COINLINKAGE Cbc_readMps ( Cbc_Model *  model,
const char *  filename 
)

Read an mps file from the given filename.

Parameters
modelproblem object
fileNamefile name

◆ Cbc_readLp()

COINLIBAPI int COINLINKAGE Cbc_readLp ( Cbc_Model *  model,
const char *  filename 
)

Read an lp file from the given filename.

Parameters
modelproblem object
fileNamefile name

◆ Cbc_writeMps()

COINLIBAPI void COINLINKAGE Cbc_writeMps ( Cbc_Model *  model,
const char *  filename 
)

Write an mps file from the given filename.

Parameters
modelproblem object
fileNamefile name

◆ Cbc_writeLp()

COINLIBAPI void COINLINKAGE Cbc_writeLp ( Cbc_Model *  model,
const char *  filename 
)

Write an lp file from the given filename.

Parameters
modelproblem object
fileNamefile name

◆ Cbc_setInitialSolution()

COINLIBAPI void COINLINKAGE Cbc_setInitialSolution ( Cbc_Model *  model,
const double *  sol 
)

Provide an initial feasible solution to accelerate branch-and-bound Note that feasibility of the solution is not verified.

◆ Cbc_getVectorStarts()

const COINLIBAPI CoinBigIndex* COINLINKAGE Cbc_getVectorStarts ( Cbc_Model *  model)

"Column start" vector of constraint matrix.

Same format as Cbc_loadProblem()

◆ Cbc_getIndices()

const COINLIBAPI int* COINLINKAGE Cbc_getIndices ( Cbc_Model *  model)

"Row index" vector of constraint matrix

◆ Cbc_getElements()

const COINLIBAPI double* COINLINKAGE Cbc_getElements ( Cbc_Model *  model)

Coefficient vector of constraint matrix.

◆ Cbc_maxNameLength()

COINLIBAPI size_t COINLINKAGE Cbc_maxNameLength ( Cbc_Model *  model)

Maximum lenght of a row or column name.

◆ Cbc_printModel()

COINLIBAPI void COINLINKAGE Cbc_printModel ( Cbc_Model *  model,
const char *  argPrefix 
)

Print the model.

◆ Cbc_setParameter()

COINLIBAPI void COINLINKAGE Cbc_setParameter ( Cbc_Model *  model,
const char *  name,
const char *  value 
)

Set parameter "name" to value "value".

Note that this translates directly to using "-name value" as a command-line argument to Cbc.

◆ Cbc_getAllowableGap()

COINLIBAPI double COINLINKAGE Cbc_getAllowableGap ( Cbc_Model *  model)

returns the allowable gap

◆ Cbc_setAllowableGap()

COINLIBAPI void COINLINKAGE Cbc_setAllowableGap ( Cbc_Model *  model,
double  allowedGap 
)

sets the allowable gap

◆ Cbc_getAllowableFractionGap()

COINLIBAPI double COINLINKAGE Cbc_getAllowableFractionGap ( Cbc_Model *  model)

returns the allowable fraction gap

◆ Cbc_setAllowableFractionGap()

COINLIBAPI void COINLINKAGE Cbc_setAllowableFractionGap ( Cbc_Model *  model,
double  allowedFracionGap 
)

sets the allowable fraction gap

◆ Cbc_getAllowablePercentageGap()

COINLIBAPI double COINLINKAGE Cbc_getAllowablePercentageGap ( Cbc_Model *  model)

returns the allowable percentage gap

◆ Cbc_setAllowablePercentageGap()

COINLIBAPI void COINLINKAGE Cbc_setAllowablePercentageGap ( Cbc_Model *  model,
double  allowedPercentageGap 
)

sets the allowable percentage gap

◆ Cbc_getMaximumSeconds()

COINLIBAPI double COINLINKAGE Cbc_getMaximumSeconds ( Cbc_Model *  model)

returns the time limit for the search process

◆ Cbc_setMaximumSeconds()

COINLIBAPI void COINLINKAGE Cbc_setMaximumSeconds ( Cbc_Model *  model,
double  maxSeconds 
)

sets the time limit for the search process

◆ Cbc_getMaximumNodes()

COINLIBAPI int COINLINKAGE Cbc_getMaximumNodes ( Cbc_Model *  model)

returns the maximum number of nodes that can be explored in the search tree

◆ Cbc_setMaximumNodes()

COINLIBAPI void COINLINKAGE Cbc_setMaximumNodes ( Cbc_Model *  model,
int  maxNodes 
)

sets the maximum number of nodes that can be explored in the search tree

◆ Cbc_getMaximumSolutions()

COINLIBAPI int COINLINKAGE Cbc_getMaximumSolutions ( Cbc_Model *  model)

returns solution limit for the search process

◆ Cbc_setMaximumSolutions()

COINLIBAPI void COINLINKAGE Cbc_setMaximumSolutions ( Cbc_Model *  model,
int  maxSolutions 
)

sets a solution limit as a stopping criterion

◆ Cbc_getLogLevel()

COINLIBAPI int COINLINKAGE Cbc_getLogLevel ( Cbc_Model *  model)

returns the current log leven

◆ Cbc_setLogLevel()

COINLIBAPI void COINLINKAGE Cbc_setLogLevel ( Cbc_Model *  model,
int  logLevel 
)

sets the log level

◆ Cbc_getCutoff()

COINLIBAPI double COINLINKAGE Cbc_getCutoff ( Cbc_Model *  model)

returns the cutoff

◆ Cbc_setCutoff()

COINLIBAPI void COINLINKAGE Cbc_setCutoff ( Cbc_Model *  model,
double  cutoff 
)

sets the cutoff

◆ Cbc_registerCallBack()

COINLIBAPI void COINLINKAGE Cbc_registerCallBack ( Cbc_Model *  model,
cbc_callback  userCallBack 
)

Pass in Callback function.

Message numbers up to 1000000 are Clp, Coin ones have 1000000 added

◆ Cbc_clearCallBack()

COINLIBAPI void COINLINKAGE Cbc_clearCallBack ( Cbc_Model *  model)

Unset Callback function.

◆ Cbc_addCutCallback()

COINLIBAPI void COINLINKAGE Cbc_addCutCallback ( Cbc_Model *  model,
cbc_cut_callback  cutcb,
const char *  name,
void *  appData 
)

◆ Cbc_solve()

COINLIBAPI int COINLINKAGE Cbc_solve ( Cbc_Model *  model)

◆ Cbc_getColSolution()

const COINLIBAPI double* COINLINKAGE Cbc_getColSolution ( Cbc_Model *  model)

Best feasible solution vector.

Parameters
modelproblem object
Returns
vector with best solution found

◆ Cbc_getBestPossibleObjValue()

COINLIBAPI double COINLINKAGE Cbc_getBestPossibleObjValue ( Cbc_Model *  model)

Best known bound on the optimal objective value.

Parameters
modelproblem object
Returns
best possible cost (lower bound)

◆ Cbc_bestSolution()

COINLIBAPI double* COINLINKAGE Cbc_bestSolution ( Cbc_Model *  model)

Best integer feasible solution.

Best integer feasible solution or NULL if no integer feas sol found

Parameters
modelproblem object
Returns
vector with the best solution found or NULL if no feasible solution was found

◆ Cbc_numberSavedSolutions()

COINLIBAPI int COINLINKAGE Cbc_numberSavedSolutions ( Cbc_Model *  model)

number of integer feasible solution saved

Parameters
modelproblem object
Returns
number of saved solutions

◆ Cbc_savedSolution()

const COINLIBAPI double* COINLINKAGE Cbc_savedSolution ( Cbc_Model *  model,
int  whichSol 
)

Vector with the i-th saved solution.

Parameters
modelproblem object
whichSolindex of the solution to be retrieved
Returns
vector with integer feasible solution

◆ Cbc_savedSolutionObj()

COINLIBAPI double COINLINKAGE Cbc_savedSolutionObj ( Cbc_Model *  model,
int  whichSol 
)

Cost of the whichSol solution.

Parameters
modelproblem object
whichSolsolution index
Returns
solution cost

◆ Cbc_getReducedCost()

const COINLIBAPI double* COINLINKAGE Cbc_getReducedCost ( Cbc_Model *  model)

Queries vector of reduced costs.

Parameters
modelproblem object
Returns
reduced cost vector

◆ Cbc_isAbandoned()

COINLIBAPI int COINLINKAGE Cbc_isAbandoned ( Cbc_Model *  model)

If optimization was abandoned due to numerical difficulties.

Parameters
modelproblem object
Returns
1 if numerical difficulties interrupted the optimization, 0 otherwise

◆ Cbc_isProvenOptimal()

COINLIBAPI int COINLINKAGE Cbc_isProvenOptimal ( Cbc_Model *  model)

If the optimal solution was found.

Parameters
modelproblem object
Returns
1 if optimal solution was found, 0 otherwise

◆ Cbc_isProvenInfeasible()

COINLIBAPI int COINLINKAGE Cbc_isProvenInfeasible ( Cbc_Model *  model)

If infeasibility was proven.

If model is infeasible, please note that infeasibility can also be declared if cutoff is informed and no solution better than the cutoff exists.

Parameters
modelproblem object
Returns
1 if model is infeasible, 0 otherwise

◆ Cbc_isContinuousUnbounded()

COINLIBAPI int COINLINKAGE Cbc_isContinuousUnbounded ( Cbc_Model *  model)

Is continuous model unbounded ?

Parameters
modelproblem object
Returns
1 if model is unbounded, 0 otherwise

◆ Cbc_getObjValue()

COINLIBAPI double COINLINKAGE Cbc_getObjValue ( Cbc_Model *  model)

Objective value of best feasible solution.

Parameters
modelproblem object
Returns
cost of the best solution found

◆ Cbc_status()

COINLIBAPI int COINLINKAGE Cbc_status ( Cbc_Model *  model)

Final optimization status.

Returns the optimization status. For more info check function isProvenOptimal, isProvenInfeasible, etc. Check also secondary status. Possible status are:

-1 before branchAndBound 0 finished - check isProvenOptimal or isProvenInfeasible to see if solution found (or check value of best solution) 1 stopped - on maxnodes, maxsols, maxtime 2 execution abandoned due to numerical dificulties 5 user programmed interruption

Parameters
modelproblem object
Returns
problem status

◆ Cbc_secondaryStatus()

COINLIBAPI int COINLINKAGE Cbc_secondaryStatus ( Cbc_Model *  model)

Secondary status of problem.

Returns additional information regarding the optimization status

-1 unset (status_ will also be -1) 0 search completed with solution 1 linear relaxation not feasible (or worse than cutoff) 2 stopped on gap 3 stopped on nodes 4 stopped on time 5 stopped on user event 6 stopped on solutions 7 linear relaxation unbounded 8 stopped on iteration limit

@model problem object

Returns
optimization status

◆ Cbc_sumPrimalInfeasibilities()

COINLIBAPI double COINLINKAGE Cbc_sumPrimalInfeasibilities ( Cbc_Model *  model)

Sum of primal infeasibilities.

◆ Cbc_numberPrimalInfeasibilities()

COINLIBAPI int COINLINKAGE Cbc_numberPrimalInfeasibilities ( Cbc_Model *  model)

Number of primal infeasibilities.

◆ Cbc_checkSolution()

COINLIBAPI void COINLINKAGE Cbc_checkSolution ( Cbc_Model *  model)

Just check solution (for external use) - sets sum of infeasibilities etc.

◆ Cbc_getIterationCount()

COINLIBAPI int COINLINKAGE Cbc_getIterationCount ( Cbc_Model *  model)

Number of iterations.

◆ Cbc_isNodeLimitReached()

COINLIBAPI int COINLINKAGE Cbc_isNodeLimitReached ( Cbc_Model *  model)

Node limit reached?

◆ Cbc_isSecondsLimitReached()

COINLIBAPI int COINLINKAGE Cbc_isSecondsLimitReached ( Cbc_Model *  model)

Time limit reached?

◆ Cbc_isSolutionLimitReached()

COINLIBAPI int COINLINKAGE Cbc_isSolutionLimitReached ( Cbc_Model *  model)

Solution limit reached?

◆ Cbc_isInitialSolveAbandoned()

COINLIBAPI int COINLINKAGE Cbc_isInitialSolveAbandoned ( Cbc_Model *  model)

Are there numerical difficulties (for initialSolve) ?

◆ Cbc_isInitialSolveProvenOptimal()

COINLIBAPI int COINLINKAGE Cbc_isInitialSolveProvenOptimal ( Cbc_Model *  model)

Is optimality proven (for initialSolve) ?

◆ Cbc_isInitialSolveProvenPrimalInfeasible()

COINLIBAPI int COINLINKAGE Cbc_isInitialSolveProvenPrimalInfeasible ( Cbc_Model *  model)

Is primal infeasiblity proven (for initialSolve) ?

◆ Cbc_getRowActivity()

const COINLIBAPI double* COINLINKAGE Cbc_getRowActivity ( Cbc_Model *  model)

"row" solution This is the vector A*x, where A is the constraint matrix and x is the current solution.

◆ Cbc_getNodeCount()

COINLIBAPI int COINLINKAGE Cbc_getNodeCount ( Cbc_Model *  model)

Number of nodes explored in B&B tree.

◆ Cbc_printSolution()

COINLIBAPI void COINLINKAGE Cbc_printSolution ( Cbc_Model *  model)

Print the solution.

◆ Osi_getNumCols()

COINLIBAPI int COINLINKAGE Osi_getNumCols ( void *  osi)

Returns number of cols in OsiSolverInterface object.

◆ Osi_getColName()

COINLIBAPI void COINLINKAGE Osi_getColName ( void *  osi,
int  i,
char *  name,
int  maxLen 
)

Returns column name in OsiSolverInterface object.

◆ Osi_getColLower()

const COINLIBAPI double* COINLINKAGE Osi_getColLower ( void *  osi)

Returns column lower bounds in OsiSolverInterface object.

◆ Osi_getColUpper()

const COINLIBAPI double* COINLINKAGE Osi_getColUpper ( void *  osi)

Returns column upper bounds in OsiSolverInterface object.

◆ Osi_isInteger()

COINLIBAPI int COINLINKAGE Osi_isInteger ( void *  osi,
int  col 
)

Returns integrality information for columns in OsiSolverInterface object.

◆ Osi_getNumRows()

COINLIBAPI int COINLINKAGE Osi_getNumRows ( void *  osi)

Returns number of rows in OsiSolverInterface object.

◆ Osi_getRowNz()

COINLIBAPI int COINLINKAGE Osi_getRowNz ( void *  osi,
int  row 
)

◆ Osi_getRowIndices()

const COINLIBAPI int* COINLINKAGE Osi_getRowIndices ( void *  osi,
int  row 
)

Indices of variables that appear on a row.

◆ Osi_getRowCoeffs()

const COINLIBAPI double* COINLINKAGE Osi_getRowCoeffs ( void *  osi,
int  row 
)

Coefficients of variables that appear on this row.

Parameters
modelproblem object
rowrow index
Returns
coefficients of variables that appear on this row

◆ Osi_getRowRHS()

COINLIBAPI double COINLINKAGE Osi_getRowRHS ( void *  osi,
int  row 
)

Right hand side of a row.

Parameters
modelproblem object
rowrow index
Returns
row right hand side

◆ Osi_getRowSense()

COINLIBAPI char COINLINKAGE Osi_getRowSense ( void *  osi,
int  row 
)

Sense a row.

Parameters
modelproblem object
rowrow index
Returns
row sense: E for =, L for <=, G for >= and R for ranged row

◆ Osi_getColSolution()

const COINLIBAPI double* COINLINKAGE Osi_getColSolution ( void *  osi)

Returns solution vector in OsiSolverInterface object.

◆ OsiCuts_addRowCut()

COINLIBAPI void COINLINKAGE OsiCuts_addRowCut ( void *  osiCuts,
int  nz,
const int *  idx,
const double *  coef,
char  sense,
double  rhs 
)

adds a row cut (used in callback)