Cbc  2.9.8
Cbc_C_Interface.h
Go to the documentation of this file.
1 /* $Id: Cbc_C_Interface.h 2091 2014-10-03 00:46:49Z mlubin $ */
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  ;
212  COINLIBAPI void COINLINKAGE
213  Cbc_addSOS(Cbc_Model * model, int numRows, const int * rowStarts,
214  const int * colIndices, const double * weights, const int type)
215  ;
217  COINLIBAPI void COINLINKAGE
218  Cbc_printModel(Cbc_Model * model, const char * argPrefix)
219  ;
221  COINLIBAPI Cbc_Model * COINLINKAGE
222  Cbc_clone(Cbc_Model * model)
223  ;
230  COINLIBAPI void COINLINKAGE
231  Cbc_setParameter(Cbc_Model * model, const char * name, const char * value)
232  ;
233 
234 
240  COINLIBAPI void COINLINKAGE
241  Cbc_registerCallBack(Cbc_Model * model,
242  cbc_callback userCallBack)
243  ;
245  COINLIBAPI void COINLINKAGE
246  Cbc_clearCallBack(Cbc_Model * model)
247  ;
248 
254  /* Solve the model with Cbc (using CbcMain1).
255  */
256  COINLIBAPI int COINLINKAGE
257  Cbc_solve(Cbc_Model * model)
258  ;
264 
266  COINLIBAPI double COINLINKAGE
267  Cbc_sumPrimalInfeasibilities(Cbc_Model * model)
268  ;
270  COINLIBAPI int COINLINKAGE
271  Cbc_numberPrimalInfeasibilities(Cbc_Model * model)
272  ;
273 
276  COINLIBAPI void COINLINKAGE
277  Cbc_checkSolution(Cbc_Model * model)
278  ;
279 
281  COINLIBAPI int COINLINKAGE
282  Cbc_getIterationCount(Cbc_Model * model)
283  ;
285  COINLIBAPI int COINLINKAGE
286  Cbc_isAbandoned(Cbc_Model * model)
287  ;
289  COINLIBAPI int COINLINKAGE
290  Cbc_isProvenOptimal(Cbc_Model * model)
291  ;
293  COINLIBAPI int COINLINKAGE
294  Cbc_isProvenInfeasible(Cbc_Model * model)
295  ;
297  COINLIBAPI int COINLINKAGE
298  Cbc_isContinuousUnbounded(Cbc_Model * model)
299  ;
301  COINLIBAPI int COINLINKAGE
302  Cbc_isNodeLimitReached(Cbc_Model * model)
303  ;
305  COINLIBAPI int COINLINKAGE
306  Cbc_isSecondsLimitReached(Cbc_Model * model)
307  ;
309  COINLIBAPI int COINLINKAGE
310  Cbc_isSolutionLimitReached(Cbc_Model * model)
311  ;
313  COINLIBAPI int COINLINKAGE
314  Cbc_isInitialSolveAbandoned(Cbc_Model * model)
315  ;
317  COINLIBAPI int COINLINKAGE
318  Cbc_isInitialSolveProvenOptimal(Cbc_Model * model)
319  ;
321  COINLIBAPI int COINLINKAGE
323  ;
327  COINLIBAPI const double * COINLINKAGE
328  Cbc_getRowActivity(Cbc_Model * model)
329  ;
331  COINLIBAPI const double * COINLINKAGE
332  Cbc_getColSolution(Cbc_Model * model)
333  ;
335  COINLIBAPI double COINLINKAGE
336  Cbc_getObjValue(Cbc_Model * model)
337  ;
339  COINLIBAPI double COINLINKAGE
340  Cbc_getBestPossibleObjValue(Cbc_Model * model)
341  ;
343  COINLIBAPI int COINLINKAGE
344  Cbc_getNodeCount(Cbc_Model * model)
345  ;
347  COINLIBAPI void COINLINKAGE
348  Cbc_printSolution(Cbc_Model * model)
349  ;
359  COINLIBAPI int COINLINKAGE
360  Cbc_status(Cbc_Model * model)
361  ;
374  COINLIBAPI int COINLINKAGE
375  Cbc_secondaryStatus(Cbc_Model * model)
376  ;
378 #ifdef __cplusplus
379 }
380 #endif
381 #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.
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) ?