Cbc  2.8.12
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Cbc_C_Interface.h
Go to the documentation of this file.
1 /* $Id: Cbc_C_Interface.h 2059 2014-08-23 16:31:35Z tkr $ */
2 /*
3  Copyright (C) 2004 International Business Machines Corporation and others.
4  All Rights Reserved.
5 
6  This code is licensed under the terms of the Eclipse Public License (EPL).
7 */
8 #ifndef CbcModelC_H
9 #define CbcModelC_H
10 
11 /* include all defines and ugly stuff */
12 #include "Coin_C_defines.h"
13 #include <stddef.h>
14 
15 /*
16  * Original verison contributed by Bob Entriken,
17  * significantly updated by Miles Lubin.
18 */
19 
20 
21 #ifdef __cplusplus
22 extern "C" {
23 #endif
24 
30 
32  COINLIBAPI Cbc_Model * COINLINKAGE
33  Cbc_newModel(void)
34  ;
36  COINLIBAPI void COINLINKAGE
37  Cbc_deleteModel(Cbc_Model * model)
38  ;
40  COINLIBAPI const char* COINLINKAGE Cbc_getVersion(void)
41  ;
72  COINLIBAPI void COINLINKAGE
73  Cbc_loadProblem (Cbc_Model * model, const int numcols, const int numrows,
74  const CoinBigIndex * start, const int* index,
75  const double* value,
76  const double* collb, const double* colub,
77  const double* obj,
78  const double* rowlb, const double* rowub)
79  ;
81  COINLIBAPI int COINLINKAGE
82  Cbc_readMps(Cbc_Model * model, const char *filename)
83  ;
85  COINLIBAPI void COINLINKAGE
86  Cbc_writeMps(Cbc_Model * model, const char *filename)
87  ;
91  COINLIBAPI void COINLINKAGE
92  Cbc_setInitialSolution(Cbc_Model *model, const double * sol)
93  ;
95  COINLIBAPI void COINLINKAGE
96  Cbc_problemName(Cbc_Model * model, int maxNumberCharacters, char * array)
97  ;
102  COINLIBAPI int COINLINKAGE
103  Cbc_setProblemName(Cbc_Model * model, const char * array)
104  ;
105 
107  COINLIBAPI int COINLINKAGE
108  Cbc_getNumElements(Cbc_Model * model)
109  ;
111  COINLIBAPI const CoinBigIndex * COINLINKAGE
112  Cbc_getVectorStarts(Cbc_Model * model)
113  ;
115  COINLIBAPI const int * COINLINKAGE
116  Cbc_getIndices(Cbc_Model * model)
117  ;
119  COINLIBAPI const double * COINLINKAGE
120  Cbc_getElements(Cbc_Model * model)
121  ;
122 
124  COINLIBAPI size_t COINLINKAGE
125  Cbc_maxNameLength(Cbc_Model * model)
126  ;
128  COINLIBAPI void COINLINKAGE
129  Cbc_getRowName(Cbc_Model * model, int iRow, char * name, size_t maxLength)
130  ;
132  COINLIBAPI void COINLINKAGE
133  Cbc_getColName(Cbc_Model * model, int iColumn, char * name, size_t maxLength)
134  ;
136  COINLIBAPI void COINLINKAGE
137  Cbc_setColName(Cbc_Model * model, int iColumn, const char * name)
138  ;
140  COINLIBAPI void COINLINKAGE
141  Cbc_setRowName(Cbc_Model * model, int iRow, const char * name)
142  ;
144  COINLIBAPI int COINLINKAGE
145  Cbc_getNumRows(Cbc_Model * model)
146  ;
148  COINLIBAPI int COINLINKAGE
149  Cbc_getNumCols(Cbc_Model * model)
150  ;
152  COINLIBAPI void COINLINKAGE
153  Cbc_setObjSense(Cbc_Model * model, double sense)
154  ;
156  COINLIBAPI double COINLINKAGE
157  Cbc_getObjSense(Cbc_Model * model)
158  ;
160  COINLIBAPI const double* COINLINKAGE
161  Cbc_getRowLower(Cbc_Model * model)
162  ;
164  COINLIBAPI void COINLINKAGE
165  Cbc_setRowLower(Cbc_Model * model, int index, double value)
166  ;
168  COINLIBAPI const double* COINLINKAGE
169  Cbc_getRowUpper(Cbc_Model * model)
170  ;
172  COINLIBAPI void COINLINKAGE
173  Cbc_setRowUpper(Cbc_Model * model, int index, double value)
174  ;
176  COINLIBAPI const double * COINLINKAGE
177  Cbc_getObjCoefficients(Cbc_Model * model)
178  ;
180  COINLIBAPI void COINLINKAGE
181  Cbc_setObjCoeff(Cbc_Model * model, int index, double value)
182  ;
184  COINLIBAPI const double * COINLINKAGE
185  Cbc_getColLower(Cbc_Model * model)
186  ;
188  COINLIBAPI void COINLINKAGE
189  Cbc_setColLower(Cbc_Model * model, int index, double value)
190  ;
192  COINLIBAPI const double * COINLINKAGE
193  Cbc_getColUpper(Cbc_Model * model)
194  ;
196  COINLIBAPI void COINLINKAGE
197  Cbc_setColUpper(Cbc_Model * model, int index, double value)
198  ;
200  COINLIBAPI int COINLINKAGE
201  Cbc_isInteger(Cbc_Model * model, int i)
202  ;
204  COINLIBAPI void COINLINKAGE
205  Cbc_setContinuous(Cbc_Model * model, int iColumn)
206  ;
208  COINLIBAPI void COINLINKAGE
209  Cbc_setInteger(Cbc_Model * model, int iColumn)
210  ;
213  COINLIBAPI void COINLINKAGE
214  Cbc_addSOS(Cbc_Model * model, int numRows, const int * rowStarts,
215  const int * colIndices, const double * weights, const int type)
216  ;
218  COINLIBAPI void COINLINKAGE
219  Cbc_printModel(Cbc_Model * model, const char * argPrefix)
220  ;
222  COINLIBAPI Cbc_Model * COINLINKAGE
223  Cbc_clone(Cbc_Model * model)
224  ;
231  COINLIBAPI void COINLINKAGE
232  Cbc_setParameter(Cbc_Model * model, const char * name, const char * value)
233  ;
234 
235 
241  COINLIBAPI void COINLINKAGE
242  Cbc_registerCallBack(Cbc_Model * model,
243  cbc_callback userCallBack)
244  ;
246  COINLIBAPI void COINLINKAGE
247  Cbc_clearCallBack(Cbc_Model * model)
248  ;
249 
255  /* Solve the model with Cbc (using CbcMain1).
256  */
257  COINLIBAPI int COINLINKAGE
258  Cbc_solve(Cbc_Model * model)
259  ;
265 
267  COINLIBAPI double COINLINKAGE
268  Cbc_sumPrimalInfeasibilities(Cbc_Model * model)
269  ;
271  COINLIBAPI int COINLINKAGE
272  Cbc_numberPrimalInfeasibilities(Cbc_Model * model)
273  ;
274 
277  COINLIBAPI void COINLINKAGE
278  Cbc_checkSolution(Cbc_Model * model)
279  ;
280 
282  COINLIBAPI int COINLINKAGE
283  Cbc_getIterationCount(Cbc_Model * model)
284  ;
286  COINLIBAPI int COINLINKAGE
287  Cbc_isAbandoned(Cbc_Model * model)
288  ;
290  COINLIBAPI int COINLINKAGE
291  Cbc_isProvenOptimal(Cbc_Model * model)
292  ;
294  COINLIBAPI int COINLINKAGE
295  Cbc_isProvenInfeasible(Cbc_Model * model)
296  ;
298  COINLIBAPI int COINLINKAGE
299  Cbc_isContinuousUnbounded(Cbc_Model * model)
300  ;
302  COINLIBAPI int COINLINKAGE
303  Cbc_isNodeLimitReached(Cbc_Model * model)
304  ;
306  COINLIBAPI int COINLINKAGE
307  Cbc_isSecondsLimitReached(Cbc_Model * model)
308  ;
310  COINLIBAPI int COINLINKAGE
311  Cbc_isSolutionLimitReached(Cbc_Model * model)
312  ;
314  COINLIBAPI int COINLINKAGE
315  Cbc_isInitialSolveAbandoned(Cbc_Model * model)
316  ;
318  COINLIBAPI int COINLINKAGE
319  Cbc_isInitialSolveProvenOptimal(Cbc_Model * model)
320  ;
322  COINLIBAPI int COINLINKAGE
324  ;
328  COINLIBAPI const double * COINLINKAGE
329  Cbc_getRowActivity(Cbc_Model * model)
330  ;
332  COINLIBAPI const double * COINLINKAGE
333  Cbc_getColSolution(Cbc_Model * model)
334  ;
336  COINLIBAPI double COINLINKAGE
337  Cbc_getObjValue(Cbc_Model * model)
338  ;
340  COINLIBAPI double COINLINKAGE
341  Cbc_getBestPossibleObjValue(Cbc_Model * model)
342  ;
344  COINLIBAPI int COINLINKAGE
345  Cbc_getNodeCount(Cbc_Model * model)
346  ;
348  COINLIBAPI void COINLINKAGE
349  Cbc_printSolution(Cbc_Model * model)
350  ;
360  COINLIBAPI int COINLINKAGE
361  Cbc_status(Cbc_Model * model)
362  ;
375  COINLIBAPI int COINLINKAGE
376  Cbc_secondaryStatus(Cbc_Model * model)
377  ;
379 #ifdef __cplusplus
380 }
381 #endif
382 #endif
COINLIBAPI int COINLINKAGE Cbc_isInitialSolveAbandoned(Cbc_Model *model)
Are there numerical difficulties (for initialSolve) ?
COINLIBAPI const char *COINLINKAGE Cbc_getVersion(void)
Current version of Cbc.
COINLIBAPI void COINLINKAGE Cbc_getColName(Cbc_Model *model, int iColumn, char *name, size_t maxLength)
Fill in first maxLength bytes of name array with a column name.
COINLIBAPI void COINLINKAGE Cbc_problemName(Cbc_Model *model, int maxNumberCharacters, char *array)
Fills in array with problem name.
COINLIBAPI int COINLINKAGE Cbc_getIterationCount(Cbc_Model *model)
Number of iterations.
COINLIBAPI int COINLINKAGE Cbc_solve(Cbc_Model *model)
COINLIBAPI void COINLINKAGE Cbc_setColUpper(Cbc_Model *model, int index, double value)
Set the upper bound of a single variable.
COINLIBAPI void COINLINKAGE Cbc_setRowLower(Cbc_Model *model, int index, double value)
Set the lower bound of a single constraint.
COINLIBAPI int COINLINKAGE Cbc_getNumRows(Cbc_Model *model)
Number of constraints in the model.
COINLIBAPI const 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...
COINLIBAPI int COINLINKAGE Cbc_getNumCols(Cbc_Model *model)
Number of variables in the model.
COINLIBAPI int COINLINKAGE Cbc_isProvenOptimal(Cbc_Model *model)
Is optimality proven?
COINLIBAPI void COINLINKAGE Cbc_getRowName(Cbc_Model *model, int iRow, char *name, size_t maxLength)
Fill in first maxLength bytes of name array with a row name.
COINLIBAPI int COINLINKAGE Cbc_getNodeCount(Cbc_Model *model)
Number of nodes explored in B&B tree.
COINLIBAPI const double *COINLINKAGE Cbc_getColSolution(Cbc_Model *model)
Best feasible solution vector.
COINLIBAPI int COINLINKAGE Cbc_status(Cbc_Model *model)
Final status of problem Some of these can be found out by is......
COINLIBAPI void COINLINKAGE Cbc_deleteModel(Cbc_Model *model)
Cbc_Model Destructor.
COINLIBAPI int COINLINKAGE Cbc_getNumElements(Cbc_Model *model)
Number of nonzero elements in constraint matrix.
COINLIBAPI int COINLINKAGE Cbc_isSolutionLimitReached(Cbc_Model *model)
Solution limit reached?
COINLIBAPI void COINLINKAGE Cbc_setParameter(Cbc_Model *model, const char *name, const char *value)
Set parameter "name" to value "value".
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 Unable to confirm that this function is worki...
COINLIBAPI void COINLINKAGE Cbc_setInteger(Cbc_Model *model, int iColumn)
Set this variable to be integer.
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 solu...
COINLIBAPI int COINLINKAGE Cbc_setProblemName(Cbc_Model *model, const char *array)
Sets problem name.
COINLIBAPI void COINLINKAGE Cbc_setRowUpper(Cbc_Model *model, int index, double value)
Set the upper bound of a single constraint.
COINLIBAPI const int *COINLINKAGE Cbc_getIndices(Cbc_Model *model)
"Row index" vector of constraint matrix
COINLIBAPI const CoinBigIndex *COINLINKAGE Cbc_getVectorStarts(Cbc_Model *model)
"Column start" vector of constraint matrix.
COINLIBAPI const double *COINLINKAGE Cbc_getObjCoefficients(Cbc_Model *model)
Objective vector.
COINLIBAPI void COINLINKAGE Cbc_clearCallBack(Cbc_Model *model)
Unset Callback function.
COINLIBAPI int COINLINKAGE Cbc_isInteger(Cbc_Model *model, int i)
Determine whether the ith variable is integer restricted.
COINLIBAPI void COINLINKAGE Cbc_setObjSense(Cbc_Model *model, double sense)
Direction of optimization (1 - minimize, -1 - maximize, 0 - ignore)
COINLIBAPI int COINLINKAGE Cbc_secondaryStatus(Cbc_Model *model)
Secondary status of problem -1 unset (status_ will also be -1) 0 search completed with solution 1 lin...
COINLIBAPI int COINLINKAGE Cbc_isContinuousUnbounded(Cbc_Model *model)
Was continuous solution unbounded?
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).
COINLIBAPI const double *COINLINKAGE Cbc_getElements(Cbc_Model *model)
Coefficient vector of constraint matrix.
COINLIBAPI Cbc_Model *COINLINKAGE Cbc_newModel(void)
Default Cbc_Model constructor.
COINLIBAPI void COINLINKAGE Cbc_setColName(Cbc_Model *model, int iColumn, const char *name)
Set the name of a column.
COINLIBAPI double COINLINKAGE Cbc_getObjValue(Cbc_Model *model)
Objective value of best feasible solution.
COINLIBAPI void COINLINKAGE Cbc_writeMps(Cbc_Model *model, const char *filename)
Write an mps file from the given filename.
COINLIBAPI void COINLINKAGE Cbc_checkSolution(Cbc_Model *model)
Just check solution (for external use) - sets sum of infeasibilities etc.
COINLIBAPI const double *COINLINKAGE Cbc_getRowUpper(Cbc_Model *model)
Constraint upper bounds.
COINLIBAPI void COINLINKAGE Cbc_setRowName(Cbc_Model *model, int iRow, const char *name)
Set the name of a row.
COINLIBAPI void COINLINKAGE Cbc_registerCallBack(Cbc_Model *model, cbc_callback userCallBack)
Pass in Callback function.
COINLIBAPI void COINLINKAGE Cbc_setContinuous(Cbc_Model *model, int iColumn)
Set this variable to be continuous.
COINLIBAPI Cbc_Model *COINLINKAGE Cbc_clone(Cbc_Model *model)
Return a copy of this model.
COINLIBAPI const double *COINLINKAGE Cbc_getColLower(Cbc_Model *model)
Variable lower bounds.
COINLIBAPI const double *COINLINKAGE Cbc_getColUpper(Cbc_Model *model)
Variable upper bounds.
COINLIBAPI int COINLINKAGE Cbc_readMps(Cbc_Model *model, const char *filename)
Read an mps file from the given filename.
COINLIBAPI int COINLINKAGE Cbc_isNodeLimitReached(Cbc_Model *model)
Node limit reached?
COINLIBAPI void COINLINKAGE Cbc_setObjCoeff(Cbc_Model *model, int index, double value)
Set the objective coefficient of a single variable.
COINLIBAPI int COINLINKAGE Cbc_numberPrimalInfeasibilities(Cbc_Model *model)
Number of primal infeasibilities.
COINLIBAPI double COINLINKAGE Cbc_getObjSense(Cbc_Model *model)
Direction of optimization (1 - minimize, -1 - maximize, 0 - ignore)
COINLIBAPI void COINLINKAGE Cbc_setColLower(Cbc_Model *model, int index, double value)
Set the lower bound of a single variable.
COINLIBAPI int COINLINKAGE Cbc_isSecondsLimitReached(Cbc_Model *model)
Time limit reached?
COINLIBAPI double COINLINKAGE Cbc_getBestPossibleObjValue(Cbc_Model *model)
Best known bound on the optimal objective value.
COINLIBAPI void COINLINKAGE Cbc_printSolution(Cbc_Model *model)
Print the solution.
COINLIBAPI void COINLINKAGE Cbc_printModel(Cbc_Model *model, const char *argPrefix)
Print the model.
COINLIBAPI int COINLINKAGE Cbc_isAbandoned(Cbc_Model *model)
Are there a numerical difficulties?
COINLIBAPI const double *COINLINKAGE Cbc_getRowLower(Cbc_Model *model)
Constraint lower bounds.
COINLIBAPI size_t COINLINKAGE Cbc_maxNameLength(Cbc_Model *model)
Maximum lenght of a row or column name.
COINLIBAPI double COINLINKAGE Cbc_sumPrimalInfeasibilities(Cbc_Model *model)
Sum of primal infeasibilities.
COINLIBAPI int COINLINKAGE Cbc_isInitialSolveProvenOptimal(Cbc_Model *model)
Is optimality proven (for initialSolve) ?
COINLIBAPI int COINLINKAGE Cbc_isProvenInfeasible(Cbc_Model *model)
Is infeasiblity proven (or none better than cutoff)?
COINLIBAPI int COINLINKAGE Cbc_isInitialSolveProvenPrimalInfeasible(Cbc_Model *model)
Is primal infeasiblity proven (for initialSolve) ?