source: trunk/src/Cbc_C_Interface.h @ 2874

Last change on this file since 2874 was 2874, checked in by unxusr, 22 months ago

visual studio C interface DLL fixes

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 44.0 KB
Line 
1/* $Id: Cbc_C_Interface.h 2874 2020-02-17 01:01:44Z unxusr $ */
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 "CbcSolverConfig.h"
13#include "Coin_C_defines.h"
14
15#include <stddef.h>
16
17/**
18 * @file Cbc_C_Interface.h
19 * @author COIN-OR CBC Development team
20 * @date 15 Aug 2019
21 *
22 * The C API for the COIN-OR Branch-and-Cut solver
23 *
24 */
25
26/*
27 * Original version contributed by Bob Entriken,
28 * significantly updated by Miles Lubin.
29 * 2018: several updates by Haroldo
30 */
31
32#ifdef __cplusplus
33extern "C" {
34#endif
35
36typedef struct Cbc_Model Cbc_Model;
37
38/*! Which method should be used to solve the linear programming problem.
39 *  If a problem with integer variables, this affects only the root node.
40 * */
41enum LPMethod {
42  LPM_Auto    = 0,  /*! Solver will decide automatically which method to use */
43  LPM_Dual    = 1,  /*! Dual simplex */
44  LPM_Primal  = 2,  /*! Primal simplex */
45  LPM_Barrier = 3   /*! The barrier algorithm. */
46};
47
48/*! Selects the pivot selection strategy to be used
49 * in the dual simplex algorithm.
50 * */
51enum DualPivot {
52  DP_Auto       = 0,  /*! Solver will decide automatically which method to use */
53  DP_Dantzig    = 1,  /*! Simple strategy, implemented as example. */
54  DP_Steepest   = 2,  /*! Default strategy */
55  DP_Partial    = 3,  /*! Same as steepest, but examines a subset of choices. */
56  DP_PESteepest = 4  /*! Positive edge criterion, tries to avoid degenerate moves. Influenced by the psi parameter */
57};
58
59/*! Type of cutting plane */
60enum CutType {
61  CT_Gomory         = 0,  /*! Gomory cuts obtained from the tableau */
62  CT_MIR            = 1,  /*! Mixed integer rounding cuts */
63  CT_ZeroHalf       = 2,  /*! Zero-half cuts */
64  CT_Clique         = 3,  /*! Clique cuts */
65  CT_KnapsackCover  = 4,  /*! Knapsack cover cuts */
66  CT_LiftAndProject = 5   /*! Lift and project cuts */
67};
68
69/*! Double parameters
70 * */
71enum DblParam {
72  DBL_PARAM_PRIMAL_TOL    = 0,  /*! Tollerance to consider a solution feasible in the linear programming solver. */
73  DBL_PARAM_DUAL_TOL      = 1,  /*! Tollerance for a solution to be considered optimal in the linear programming solver. */
74  DBL_PARAM_ZERO_TOL      = 2,  /*! Coefficients less that this value will be ignored when reading instances */
75  DBL_PARAM_INT_TOL       = 3,  /*! Maximum allowed distance from integer value for a variable to be considered integral */
76  DBL_PARAM_PRESOLVE_TOL  = 4,  /*! Tollerance used in the presolver, should be increased if the pre-solver is declaring infeasible a feasible problem */
77  DBL_PARAM_TIME_LIMIT    = 5,  /*! Time limit in seconds */
78  DBL_PARAM_PSI           = 6,  /*! Two dimensional princing factor in the Positive Edge pivot strategy. */
79  DBL_PARAM_CUTOFF        = 7,  /*! Only search for solutions with cost less-or-equal to this value. */
80  DBL_PARAM_ALLOWABLE_GAP = 8,  /*! Allowable gap between the lower and upper bound to conclude the search */
81  DBL_PARAM_GAP_RATIO     = 9   /*! Stops the search when the difference between the upper and lower bound is less than this fraction of the larger value */
82};
83#define N_DBL_PARAMS 10
84
85/*! Integer parameters */
86enum IntParam {
87  INT_PARAM_PERT_VALUE          = 0,  /*! Method of perturbation, -5000 to 102, default 50 */
88  INT_PARAM_IDIOT               = 1,  /*! Parameter of the "idiot" method to try to produce an initial feasible basis. -1 let the solver decide if this should be applied; 0 deactivates it and >0 sets number of passes. */
89  INT_PARAM_STRONG_BRANCHING    = 2,  /*! Number of variables to be evaluated in strong branching. */
90  INT_PARAM_CUT_DEPTH           = 3,  /*! Sets the application of cuts to every depth multiple of this value. -1, the default value, let the solve decide. */
91  INT_PARAM_MAX_NODES           = 4,  /*! Maximum number of nodes to be explored in the search tree */
92  INT_PARAM_NUMBER_BEFORE       = 5,  /*! Number of branche before trusting pseudocodes computed in strong branching. */
93  INT_PARAM_FPUMP_ITS           = 6,  /*! Maximum number of iterations in the feasibility pump method. */
94  INT_PARAM_MAX_SOLS            = 7,  /*! Maximum number of solutions generated during the search. Stops the search when this number of solutions is found. */
95  INT_PARAM_CUT_PASS_IN_TREE    = 8, /*! Maxinum number of cuts passes in the search tree (with the exception of the root node). Default 1. */
96  INT_PARAM_THREADS             = 9, /*! Number of threads that can be used in the branch-and-bound method.*/
97  INT_PARAM_CUT_PASS            = 10, /*! Number of cut passes in the root node. Default -1, solver decides */
98  INT_PARAM_LOG_LEVEL           = 11, /*! Verbosity level, from 0 to 2 */
99  INT_PARAM_MAX_SAVED_SOLS      = 12, /*! Size of the pool to save the best solutions found during the search. */
100  INT_PARAM_MULTIPLE_ROOTS      = 13 /*! Multiple root passes to get additional cuts and solutions. */
101};
102#define N_INT_PARAMS 14
103 
104/** typedef for cbc callback to monitor the progress of the search
105 * in terms of improved upper and lower bounds */
106typedef int(COINLINKAGE_CB *cbc_progress_callback)(void *model,
107                                                   int phase,
108                                                   int step,
109                                                   const char *phaseName,
110                                                   double seconds,
111                                                   double lb,
112                                                   double ub,
113                                                   int nint,
114                                                   int *vecint,
115                                                   void *cbData
116                                                   );
117
118
119/** typedef for cbc callback to monitor the discovery
120 * of new integer feasible solutions */
121typedef int (COINLINKAGE_CB *cbc_incumbent_callback)(void *cbcModel, double obj, int nz, char **vnames, double *x, void *appData);
122
123typedef void(COINLINKAGE_CB *cbc_callback)(Cbc_Model *model, int msgno, int ndouble,
124  const double *dvec, int nint, const int *ivec,
125  int nchar, char **cvec);
126
127/**
128 * \brief CBC cut callback
129 * 
130 * The CBC cut generation callback
131 *
132 * \param osiSolver an OsiSolverInterface object with the problem and the fractional solution
133 *        please note that if pre-processing is on then the number of variables and constraints
134 *        in this problem will be smaller than the dimensions of the initial problem. if keepNames
135 *        is true than the original variable names will be preseved to ease the mapping of the
136 *        pre-processed variables and the original ones.
137 *
138 * \param osiCuts an OsiCuts object, where cuts should be added.
139 *
140 * \param appData optional pointer to an object contained some original problem informatio that
141 *        can be filled by the user.
142 *
143 **/
144typedef void(COINLINKAGE_CB *cbc_cut_callback)(void *osiSolver, void *osiCuts, void *appdata);
145
146/** Current version of Cbc */
147COINLIBAPI const char *COINLINKAGE Cbc_getVersion(void);
148
149/** \name Problem creation and modification routines */
150
151/** @brief Creates an empty problem */
152COINLIBAPI Cbc_Model *COINLINKAGE
153Cbc_newModel(void);
154
155/** @brief Sets problem name.
156   *
157   * @param model problem object
158   * @param array string with problem name
159   **/
160COINLIBAPI int COINLINKAGE
161Cbc_setProblemName(Cbc_Model *model, const char *array);
162
163/** @brief activates/deactivates name indexes
164 *
165 * When name indexes are active column/row indexes can be queried fast.
166 *
167 * @param model problem object
168 * @param store: 1 maintain indexes of column and constraints names for searching indexes, 0 not
169 **/
170COINLIBAPI void COINLINKAGE
171Cbc_storeNameIndexes(Cbc_Model *model, char _store);
172
173/** @brief Creates a new column
174  *
175  * Creates a new column (variable)
176  *
177  * @param model problem object
178  * @param name variable name
179  * @param lb column lower bound
180  * @param ub column upper bound
181  * @param obj objective function coefficient
182  * @param isInteger 1 if variable is integral, 0 otherwise
183  * @param nz number of rows (constraints) where this column appears, can be 0 if constraints will be added later
184  * @param rows index of rows where this column appears, NULL if rows will be added later
185  * @param coefs coefficients that this column appears in its rows, NULL if rows will be added later
186  ***/
187COINLIBAPI void COINLINKAGE
188Cbc_addCol(Cbc_Model *model, const char *name, double lb,
189  double ub, double obj, char isInteger,
190  int nz, int *rows, double *coefs);
191
192
193/** @brief Deletes some columns
194  *
195  *  Deletes some columns (variables)
196  *
197  *  @param model problem object
198  *  @param numCols number of columns that will be deleted
199  *  @param cols Vector with indexes of columns that will be deleted
200  * */
201COINLIBAPI void COINLINKAGE
202Cbc_deleteCols(Cbc_Model *model, int numCols, const int cols[]);
203
204/** @brief Adds a new row
205  *
206  *  Adds a new row (linear constraint) to the problem
207  *
208  *  @param model problem object
209  *  @param name constraint name
210  *  @param nz number of variables with non-zero coefficients in this row
211  *  @param cols index of variables that appear in this row
212  *  @param coefs coefficients that that variables appear
213  *  @param sense constraint sense: L if <=, G if >=, E if =, R if ranged and N if free
214  *  @param rhs right hand size
215  * */
216COINLIBAPI void COINLINKAGE
217Cbc_addRow(Cbc_Model *model, const char *name, int nz,
218  const int *cols, const double *coefs, char sense, double rhs);
219
220
221/** @brief Adds a lazy constraint
222 *
223 *  This method adds a lazy constraint, i.e. a constraint
224 *  that will be included in the model only after the first
225 *  integer solution violating it is generated.
226 *
227 **/
228COINLIBAPI void COINLINKAGE
229Cbc_addLazyConstraint(Cbc_Model *model, int nz,
230  int *cols, double *coefs, char sense, double rhs);
231
232/** @brief Deletes some rows
233 *
234 *  Deletes some rows from the model
235 *
236 *  @param model problem object
237 *  @param numRows number of rows
238 *  @param rows rows to be deleted
239 * */
240COINLIBAPI void COINLINKAGE
241Cbc_deleteRows(Cbc_Model *model, int numRows, const int rows[]);
242
243/** @brief Add SOS constraints to the model using row-order matrix */
244COINLIBAPI void COINLINKAGE
245Cbc_addSOS(Cbc_Model *model, int numRows, const int *rowStarts,
246  const int *colIndices, const double *weights, const int type);
247
248/** Loads a problem (the constraints on the
249    rows are given by lower and upper bounds). If a pointer is NULL then the
250    following values are the default:
251        <ul>
252        <li> <code>colub</code>: all columns have upper bound infinity
253        <li> <code>collb</code>: all columns have lower bound 0
254        <li> <code>rowub</code>: all rows have upper bound infinity
255        <li> <code>rowlb</code>: all rows have lower bound -infinity
256        <li> <code>obj</code>: all variables have 0 objective coefficient
257        </ul>
258
259     The constraint matrix is given in standard compressed sparse column
260     (without gaps).
261       <ul>
262       <li> <code>start[i]</code> stores the starting index of the ith column
263       <li> <code>index[k]</code> stores the row index of the kth nonzero element
264       <li> <code>value[k]</code> stores the coefficient of the kth nonzero element
265       </ul>
266  */
267COINLIBAPI void COINLINKAGE
268Cbc_loadProblem(Cbc_Model *model, const int numcols, const int numrows,
269  const CoinBigIndex *start, const int *index,
270  const double *value,
271  const double *collb, const double *colub,
272  const double *obj,
273  const double *rowlb, const double *rowub);
274
275/** @brief Set the name of a column
276  *
277  * @param model problem object
278  * @param iColumn column index
279  * @param column name
280  **/
281COINLIBAPI void COINLINKAGE
282Cbc_setColName(Cbc_Model *model, int iColumn, const char *name);
283
284/** @brief Set the name of a row
285  *
286  * @param model problem object
287  * @param iRow row index
288  * @param name row name
289  **/
290COINLIBAPI void COINLINKAGE
291Cbc_setRowName(Cbc_Model *model, int iRow, const char *name);
292
293/** @brief Sets optimization direction
294  *
295  * @param model problem object
296  * @param sense: direction of optimization (1 - minimize, -1 - maximize, 0 - ignore)
297  **/
298COINLIBAPI void COINLINKAGE
299Cbc_setObjSense(Cbc_Model *model, double sense);
300
301/** @brief Set the lower bound of a single constraint
302  *
303  * @param model problem object
304  * @param index row index
305  * @param value new row lower bound
306  **/
307COINLIBAPI void COINLINKAGE
308Cbc_setRowLower(Cbc_Model *model, int index, double value);
309
310/** @brief  Set the upper bound of a single constraint
311  *
312  * @param model problem object
313  * @param index row index
314  * @param value new row upper bound
315  **/
316COINLIBAPI void COINLINKAGE
317Cbc_setRowUpper(Cbc_Model *model, int index, double value);
318
319/** @brief  Sets the RHS of a constraint
320  *
321  * @param model problem object
322  * @param row row index
323  * @param rhs value of the new RHS
324  **/
325COINLIBAPI void COINLINKAGE
326Cbc_setRowRHS(Cbc_Model *model, int row, double rhs);
327
328/** @brief Set the objective coefficient of a single variable
329  *
330  * @param model problem object
331  * @param index variable index
332  * @param value new objective function coefficient for this variable
333  **/
334COINLIBAPI void COINLINKAGE
335Cbc_setObjCoeff(Cbc_Model *model, int index, double value);
336
337/** @brief Set the lower bound of a single variable
338  *
339  * @param model problem object
340  * @param index variable index
341  * @param value variable lower bound
342  **/
343COINLIBAPI void COINLINKAGE
344Cbc_setColLower(Cbc_Model *model, int index, double value);
345
346/** @brief Set the upper bound of a single variable
347  *
348  * @param model problem object
349  * @param index variable index
350  * @param value new variable upper bound
351  **/
352COINLIBAPI void COINLINKAGE
353Cbc_setColUpper(Cbc_Model *model, int index, double value);
354
355/** @brief Set this variable to be continuous
356  *
357  * @param model problem object
358  * @param iColumn column index
359  **/
360COINLIBAPI void COINLINKAGE
361Cbc_setContinuous(Cbc_Model *model, int iColumn);
362
363/** @brief Set this variable to be integer
364  *
365  * @param model problem object
366  * @param iColumn column index
367  **/
368COINLIBAPI void COINLINKAGE
369Cbc_setInteger(Cbc_Model *model, int iColumn);
370
371/** @brief Frees memory of model object
372  *
373  * @param model problem object */
374COINLIBAPI void COINLINKAGE
375Cbc_deleteModel(Cbc_Model *model);
376
377/** @brief Enter initial feasible solution
378  *
379  * Enter an initial feasible solution. Only the non-zero main
380  * binary/integer decision variables need to be informed.
381  * Auxiliary and/or continuous variables are computed
382  * automatically.
383  *
384  * @param model problem object
385  * @param count number of variables
386  * @param colNames names of variables
387  * @param colValues variable values
388  *
389  **/
390COINLIBAPI void COINLINKAGE
391Cbc_setMIPStart(Cbc_Model *model, int count, const char **colNames, const double colValues[]);
392
393/** @brief Enter initial feasible solution
394  *
395  * Enter an initial feasible solution. Only the non-zero main
396  * binary/integer decision variables need to be informed.
397  * Auxiliary and/or continuous variables are computed
398  * automatically. Same as setMIPStart but using variable indexes.
399  *
400  * @param model problem object
401  * @param count number of variables
402  * @param colIdxs indexes of variables
403  * @param colValues variable values
404  *
405  **/
406COINLIBAPI void COINLINKAGE
407Cbc_setMIPStartI(Cbc_Model *model, int count, const int colIdxs[], const double colValues[]);
408
409/** @brief Reads an initial feasible solution from a file
410  *
411  * Reads an initial feasible solution from a file. The file format
412  * is the same used as output by CBC. In the case of a Mixed-Integer
413  * Linear Program only the non-zero integer/binary variables need to
414  * be informed.
415  *
416  * @param model problem object
417  * @param fileName problem object
418  **/
419COINLIBAPI void COINLINKAGE
420Cbc_readMIPStart(Cbc_Model *model, const char fileName[]);
421
422/** @brief Creates a copy of the current model
423  *
424  * @param model problem object
425  * @return model copy
426  **/
427COINLIBAPI Cbc_Model *COINLINKAGE
428Cbc_clone(Cbc_Model *model);
429
430/** \name Routines to query problem contents
431*/
432
433/** @brief Queries problem name
434  *
435  * @param model problem object
436  * @param maxNumberCharacters space in string array
437  * @param array string where problem name will be saved
438  **/
439COINLIBAPI void COINLINKAGE
440Cbc_problemName(Cbc_Model *model, int maxNumberCharacters, char *array);
441
442/** @brief Number of nonzero elements in constraint matrix
443  *
444  * @param model problem object
445  * @return number of non-zero entries in constraint matrix
446  **/
447COINLIBAPI int COINLINKAGE
448Cbc_getNumElements(Cbc_Model *model);
449
450/** @brief Number of variables in the model
451 *
452  * @param model problem object
453  * @return number of columns (variables)
454  **/
455COINLIBAPI int COINLINKAGE
456Cbc_getNumCols(Cbc_Model *model);
457
458/** @brief Number of integer variables in the model
459  *
460  * @param model problem object
461  * @return number of integer variables in this model
462  **/
463COINLIBAPI int COINLINKAGE
464Cbc_getNumIntegers(Cbc_Model *model);
465
466/** @brief Number of constraints in the model
467  * @param model problem object
468  * @return number of rows (constraints) in the model
469  **/
470COINLIBAPI int COINLINKAGE
471Cbc_getNumRows(Cbc_Model *model);
472
473/** @brief Queries row name
474  *
475  * @param model problem object
476  * @param row index
477  * @param name string where row name will be stored
478  * @param string where row name will be stored
479  **/
480COINLIBAPI void COINLINKAGE
481Cbc_getRowName(Cbc_Model *model, int iRow, char *name, size_t maxLength);
482
483/** @brief Queries column name
484  *
485  * @param model problem object
486  * @param iColumn column index
487  * @param name where name will be stored
488  * @param maxLength maximum length of name string
489  **/
490COINLIBAPI void COINLINKAGE
491Cbc_getColName(Cbc_Model *model, int iColumn, char *name, size_t maxLength);
492
493/** @brief searches columns by name and returns its index
494 *
495 * call Cbc_storeNameIndexes to enable search by name
496 *
497 * @param model problem object
498 * @param name column (variable) name
499 * @return column index or -1 if not found
500 **/
501COINLIBAPI int COINLINKAGE
502Cbc_getColNameIndex(Cbc_Model *model, const char *name);
503
504/** @brief searches rows by name and returns its index
505 *
506 * call Cbc_storeNameIndexes to enable search by name
507 *
508 * @param model problem object
509 * @param name row (constraint) name
510 * @return row index or -1 if not found
511 **/
512COINLIBAPI int COINLINKAGE
513Cbc_getRowNameIndex(Cbc_Model *model, const char *name);
514
515/** @brief Number of non-zero entries in a row
516  *
517  * @param model problem object
518  * @param row row index
519  * @return number of non-zero entries in row
520  **/
521COINLIBAPI int COINLINKAGE
522Cbc_getRowNz(Cbc_Model *model, int row);
523
524/** @brief Indices of variables that appear on a row
525  *
526  * @param model problem object
527  * @param row row index
528  * @return vector with indexes of columns that appear on this row
529  **/
530COINLIBAPI const int *COINLINKAGE
531Cbc_getRowIndices(Cbc_Model *model, int row);
532
533/** @brief Coefficients of variables that appear on this row
534  *
535  * @param model problem object
536  * @param row row index
537  * @return coefficients of variables that appear on this row
538  **/
539COINLIBAPI const double *COINLINKAGE
540Cbc_getRowCoeffs(Cbc_Model *model, int row);
541
542/** @brief Number of non-zero entries in a column
543  *
544  * @param model problem object
545  * @param col column index
546  * @return numbef of rows that this column appears
547  **/
548COINLIBAPI int COINLINKAGE
549Cbc_getColNz(Cbc_Model *model, int col);
550
551/** @brief Indices of rows that a column appears
552  *
553  * @param model problem object
554  * @param col column index
555  * @return indices of rows that this column appears
556  **/
557COINLIBAPI const int *COINLINKAGE
558Cbc_getColIndices(Cbc_Model *model, int col);
559
560/** @brief Coefficients that a column appear in rows
561  *
562  * @param model problem object
563  * @param col column index
564  * @return coefficients of this column in rows
565  **/
566COINLIBAPI const double *COINLINKAGE
567Cbc_getColCoeffs(Cbc_Model *model, int col);
568
569/** @brief Right hand side of a row
570  *
571  * @param model problem object
572  * @param row row index
573  * @return row right hand side
574  **/
575COINLIBAPI double COINLINKAGE
576Cbc_getRowRHS(Cbc_Model *model, int row);
577
578/** @brief Sense of a row
579  *
580  * @param model problem object
581  * @param row row index
582  * @return row sense: E for =, L for <=, G for >= and R for ranged row
583  **/
584COINLIBAPI char COINLINKAGE
585Cbc_getRowSense(Cbc_Model *model, int row);
586
587/** @brief Direction of optimization
588  *
589  * @param model problem object
590  * @return Direction of optimization (1 - minimize, -1 - maximize, 0 - ignore)
591  **/
592COINLIBAPI double COINLINKAGE
593Cbc_getObjSense(Cbc_Model *model);
594
595/** @brief Constraint lower bounds
596  *
597  * @param model problem object
598  * @return vector with lower bounds of constraints
599  **/
600COINLIBAPI const double *COINLINKAGE
601Cbc_getRowLower(Cbc_Model *model);
602
603/** @brief Constraint upper bounds
604 *
605 * @param model problem object
606 * @return constraint upper bounds
607 **/
608COINLIBAPI const double *COINLINKAGE
609Cbc_getRowUpper(Cbc_Model *model);
610
611/** @brief Objective vector
612  *
613  * @param model problem object
614  * @return vector with coefficients of variables in the objective function
615  **/
616COINLIBAPI const double *COINLINKAGE
617Cbc_getObjCoefficients(Cbc_Model *model);
618
619/** @brief Variable lower bounds
620  *
621  * @param model problem object
622  * @return vector with lower bounds of variables
623  **/
624COINLIBAPI const double *COINLINKAGE
625Cbc_getColLower(Cbc_Model *model);
626
627/** @brief Variable upper bounds
628  *
629  * @param model problem object
630  * @return vector with column upper bounds
631  **/
632COINLIBAPI const double *COINLINKAGE
633Cbc_getColUpper(Cbc_Model *model);
634
635/** @brief Determine whether the i-th variable is restricted to be integral
636  *
637  * @param model problem object
638  * @param i variable index
639  * @return 1 if variable is integer, 0 otherwise
640  **/
641COINLIBAPI int COINLINKAGE
642Cbc_isInteger(Cbc_Model *model, int i);
643
644/** \name Routines to load and save problems from disk
645*/
646
647/** @brief Read an MPS file from the given filename
648  *
649  * @param model problem object
650  * @param fileName file name
651  **/
652COINLIBAPI int COINLINKAGE
653Cbc_readMps(Cbc_Model *model, const char *filename);
654
655/** @brief Read a LP file from the given filename
656  *
657  * @param model problem object
658  * @param fileName file name
659  **/
660COINLIBAPI int COINLINKAGE
661Cbc_readLp(Cbc_Model *model, const char *filename);
662
663/** @brief Write an MPS file from the given filename
664  *
665  * @param model problem object
666  * @param fileName file name
667  **/
668COINLIBAPI void COINLINKAGE
669Cbc_writeMps(Cbc_Model *model, const char *filename);
670
671/** @brief Write an LP file from the given filename
672  *
673  * @param model problem object
674  * @param fileName file name
675  **/
676COINLIBAPI void COINLINKAGE
677Cbc_writeLp(Cbc_Model *model, const char *filename);
678
679/**@name Getting and setting model data
680     Note that problem access and modification methods,
681       such as getColLower and setColLower,
682       are *not valid* after calling Cbc_solve().
683       Therefore it is not recommended to reuse a Cbc_Model
684       object for multiple solves. A workaround is to call Cbc_clone()
685       before solving.
686     * */
687/*@{*/
688
689/** Provide an initial feasible solution to accelerate branch-and-bound
690     Note that feasibility of the solution is *not* verified.
691    */
692COINLIBAPI void COINLINKAGE
693Cbc_setInitialSolution(Cbc_Model *model, const double *sol);
694
695/** "Column start" vector of constraint matrix. Same format as Cbc_loadProblem() */
696COINLIBAPI const CoinBigIndex *COINLINKAGE
697Cbc_getVectorStarts(Cbc_Model *model);
698/** "Row index" vector of constraint matrix */
699COINLIBAPI const int *COINLINKAGE
700
701Cbc_getIndices(Cbc_Model *model);
702
703/** Coefficient vector of constraint matrix */
704COINLIBAPI const double *COINLINKAGE
705Cbc_getElements(Cbc_Model *model);
706
707/** Maximum lenght of a row or column name */
708COINLIBAPI size_t COINLINKAGE
709Cbc_maxNameLength(Cbc_Model *model);
710
711/*@}*/
712
713/**@name Solver parameters */
714/*@{*/
715
716/** Sets a parameter
717 *
718 * @param model problem object
719 * @param name parameter name, e.g. cuts
720 * @param name parameter value, e.g. off
721 *
722 **/
723COINLIBAPI void COINLINKAGE
724Cbc_setParameter(Cbc_Model *model, const char *name, const char *value);
725
726/** Sets an integer parameter
727 *
728 * @param model problem object
729 * @param which which integer parameter
730 * @param val  value
731 *
732 **/
733COINLIBAPI void COINLINKAGE
734Cbc_setIntParam(Cbc_Model *model, enum IntParam which, const int val);
735
736/** Sets a double parameter
737 *
738 * @param model problem object
739 * @param which which integer parameter
740 * @param val  value
741 *
742 **/
743COINLIBAPI void COINLINKAGE
744Cbc_setDblParam(Cbc_Model *model, enum DblParam which, const double val);
745
746
747
748
749
750/** @brief returns the allowable gap
751 *
752 * @param model model object
753 * @return the maximum allowable gap between the lower bound and the upper bound, when
754 *         the gap decrease to a smaller value the search is concluded
755 */
756COINLIBAPI double COINLINKAGE
757Cbc_getAllowableGap(Cbc_Model *model);
758
759/** @brief sets the allowable gap
760 *
761 * @param model model object
762 * @param allowedGap the maximum allowable gap between the lower bound and the upper bound, when
763 *         the gap decrease to a smaller value the search is concluded
764 */
765
766COINLIBAPI void COINLINKAGE
767Cbc_setAllowableGap(Cbc_Model *model, double allowedGap);
768
769/** returns the allowable fraction gap
770 */
771COINLIBAPI double COINLINKAGE
772Cbc_getAllowableFractionGap(Cbc_Model *model);
773
774/** sets the allowable fraction gap
775 */
776COINLIBAPI void COINLINKAGE
777Cbc_setAllowableFractionGap(Cbc_Model *model, double allowedFracionGap);
778
779/** gets the tolerance for infeasibility in the LP solver
780 */
781COINLIBAPI double COINLINKAGE
782Cbc_getPrimalTolerance(Cbc_Model *model);
783
784/** sets the tolerance for infeasibility in the LP solver
785 */
786COINLIBAPI void COINLINKAGE
787Cbc_setPrimalTolerance(Cbc_Model *model, double tol);
788
789/** gets the tolerance for optimality in the LP solver
790 */
791COINLIBAPI double COINLINKAGE
792Cbc_getDualTolerance(Cbc_Model *model);
793
794/** sets the tolerance for optimality in the LP solver
795 */
796COINLIBAPI void COINLINKAGE
797Cbc_setDualTolerance(Cbc_Model *model, double tol);
798
799/** returns the time limit for the search process
800 */
801COINLIBAPI double COINLINKAGE
802Cbc_getMaximumSeconds(Cbc_Model *model);
803
804/** sets the time limit for the search process
805 */
806COINLIBAPI void COINLINKAGE
807Cbc_setMaximumSeconds(Cbc_Model *model, double maxSeconds);
808
809/** returns the maximum number of nodes that can be explored in the search tree
810 */
811COINLIBAPI int COINLINKAGE
812Cbc_getMaximumNodes(Cbc_Model *model);
813
814/** sets the maximum number of nodes that can be explored in the search tree
815 */
816COINLIBAPI void COINLINKAGE
817Cbc_setMaximumNodes(Cbc_Model *model, int maxNodes);
818
819/** returns solution limit for the search process
820 */
821COINLIBAPI int COINLINKAGE
822Cbc_getMaximumSolutions(Cbc_Model *model);
823
824/** sets a solution limit as a stopping criterion
825 */
826COINLIBAPI void COINLINKAGE
827Cbc_setMaximumSolutions(Cbc_Model *model, int maxSolutions);
828
829/** returns the current log leven
830 */
831COINLIBAPI int COINLINKAGE
832Cbc_getLogLevel(Cbc_Model *model);
833
834/** sets the log level
835 */
836COINLIBAPI void COINLINKAGE
837Cbc_setLogLevel(Cbc_Model *model, int logLevel);
838
839/** returns the cutoff
840 */
841COINLIBAPI double COINLINKAGE
842Cbc_getCutoff(Cbc_Model *model);
843
844/** sets the cutoff
845 */
846COINLIBAPI void COINLINKAGE
847Cbc_setCutoff(Cbc_Model *model, double cutoff);
848
849/** sets which method will be used to solve the linear programming problem
850 */
851COINLIBAPI void COINLINKAGE
852Cbc_setLPmethod(Cbc_Model *model, enum LPMethod lpm );
853
854/** Returns a pointer to the OsiClpSolverInterface object
855 * containing the problem
856 */
857COINLIBAPI void * COINLINKAGE
858Cbc_getSolverPtr(Cbc_Model *model);
859
860
861/** sets which pivotting method should be used in the dual simplex
862 */
863COINLIBAPI void COINLINKAGE
864Cbc_setDualPivot(Cbc_Model *model, enum DualPivot dp );
865
866/*@}*/
867/**@name Message handling.  */
868/*@{*/
869/** Pass in Callback function.
870     Message numbers up to 1000000 are Clp, Coin ones have 1000000 added */
871COINLIBAPI void COINLINKAGE
872Cbc_registerCallBack(Cbc_Model *model,
873  cbc_callback userCallBack);
874
875/** Unset Callback function */
876COINLIBAPI void COINLINKAGE
877Cbc_clearCallBack(Cbc_Model *model);
878
879/** @brief adds a callback to generate cutting planes
880 *
881 * @param model mip model
882 * @param cutcb cut callback function
883 * @param name cut generator name
884 * @param appData optional pointer to some additional information that the cut generator may need
885 * @param howOften 1 if the cut generator should be called at every node, > 1 at every howOften nodes negative
886 *        values have the same meaning but in this case the cut generator may be disable if not bound improvement
887 *        was obtained with these cuts. -99 for cut generators that will be called only at the root node
888 * @param atSolution if the cut generator must to be called also when an integer solution if found (=1) or zero otherwise
889 **/
890COINLIBAPI void COINLINKAGE Cbc_addCutCallback( 
891    Cbc_Model *model, 
892    cbc_cut_callback cutcb, 
893    const char *name, 
894    void *appData, 
895    int howOften,
896    char atSolution );
897
898/** callback to monitor new incumbent solutions **/
899COINLIBAPI void COINLINKAGE Cbc_addIncCallback(
900    Cbc_Model *model, cbc_incumbent_callback inccb, 
901    void *appData );
902
903/** callback to monitor improvements in lower or upper
904 * bounds */
905COINLIBAPI void COINLINKAGE Cbc_addProgrCallback(
906  Cbc_Model *model, cbc_progress_callback prgcbc,
907  void *appData);
908
909/*@}*/
910
911/**@name Solving the model */
912/*@{*/
913
914/** @brief Solves the model with CBC
915   *
916   * @param model problem object
917   * @return execution status, for MIPs:
918   *   -1 before branchAndBound
919   *   0  finished - check isProvenOptimal or isProvenInfeasible to see if solution found (or check value of best solution)
920   *   1  stopped - on maxnodes, maxsols, maxtime
921   *   2  difficulties so run was abandoned
922   *   5  event user programmed event occurred
923   **/
924COINLIBAPI int COINLINKAGE
925Cbc_solve(Cbc_Model *model);
926
927/** @brief Solves only the linear programming relaxation
928  *
929  * @param model problem object
930  * @return execution status
931  *   0  optimal
932  *   1  incomplete search (stopped on time, iterations)
933  *   2  unfeasible
934  *   3  unbounded
935  **/
936COINLIBAPI int COINLINKAGE
937Cbc_solveLinearProgram(Cbc_Model *model);
938
939
940/*@}*/
941
942/**@name Accessing the solution and optimization status */
943/*@{*/
944
945/** @brief Best feasible solution vector
946  *
947  * @param model problem object
948  * @return vector with best solution found
949  **/
950COINLIBAPI const double *COINLINKAGE
951Cbc_getColSolution(Cbc_Model *model);
952
953/** @brief Best known bound on the optimal objective value
954  *
955  * @param model problem object
956  * @return best possible cost (lower bound)
957  **/
958COINLIBAPI double COINLINKAGE
959Cbc_getBestPossibleObjValue(Cbc_Model *model);
960
961/** @brief Best integer feasible solution
962  *
963  * Best integer feasible solution or NULL if no integer feas sol found
964  *
965  * @param model problem object
966  * @return vector with the best solution found or NULL if no feasible solution was found
967  **/
968COINLIBAPI const double *COINLINKAGE
969Cbc_bestSolution(Cbc_Model *model);
970
971/** @brief number of integer feasible solution saved
972  *
973  * @param model problem object
974  * @return number of saved solutions
975  **/
976COINLIBAPI int COINLINKAGE
977Cbc_numberSavedSolutions(Cbc_Model *model);
978
979/** @brief Vector with the i-th saved solution
980  *
981  * @param model problem object
982  * @param whichSol index of the solution to be retrieved
983  * @return vector with integer feasible solution
984  **/
985COINLIBAPI const double *COINLINKAGE
986Cbc_savedSolution(Cbc_Model *model, int whichSol);
987
988/** @brief Cost of the whichSol solution
989  *
990  * @param model problem object
991  * @param whichSol solution index
992  * @return solution cost
993  **/
994COINLIBAPI double COINLINKAGE
995Cbc_savedSolutionObj(Cbc_Model *model, int whichSol);
996
997/** @brief Queries vector of reduced costs
998  *
999  * @param model problem object
1000  * @return reduced cost vector
1001  **/
1002COINLIBAPI const double *COINLINKAGE
1003Cbc_getReducedCost(Cbc_Model *model);
1004
1005/** @brief Queries vector of row prices (values for dual variables)
1006  *
1007  * @param model problem object
1008  * @return reduced cost vector
1009   */
1010COINLIBAPI const double *COINLINKAGE
1011Cbc_getRowPrice(Cbc_Model *model);
1012
1013/** If optimization was abandoned due to numerical difficulties
1014  *
1015  * @param model problem object
1016  * @returns 1 if numerical difficulties interrupted the optimization, 0 otherwise
1017  * */
1018COINLIBAPI int COINLINKAGE
1019Cbc_isAbandoned(Cbc_Model *model);
1020
1021/** @brief If the optimal solution was found
1022  *
1023  * @param model problem object
1024  * @return 1 if optimal solution was found, 0 otherwise
1025  **/
1026COINLIBAPI int COINLINKAGE
1027Cbc_isProvenOptimal(Cbc_Model *model);
1028
1029/** @brief If infeasibility was proven
1030  *
1031  * If model is infeasible, please note that infeasibility can also be declared
1032  * if cutoff is informed and no solution better than the cutoff exists.
1033  *
1034  * @param model problem object
1035  * @return 1 if model is infeasible, 0 otherwise
1036  **/
1037COINLIBAPI int COINLINKAGE
1038Cbc_isProvenInfeasible(Cbc_Model *model);
1039
1040/** @brief Is continuous model unbounded ?
1041    *
1042    * @param model problem object
1043    * @return 1 if model is unbounded, 0 otherwise
1044    * */
1045COINLIBAPI int COINLINKAGE
1046Cbc_isContinuousUnbounded(Cbc_Model *model);
1047
1048/** Objective value of best feasible solution
1049  *
1050  * @param model problem object
1051  * @return cost of the best solution found
1052  * */
1053COINLIBAPI double COINLINKAGE
1054Cbc_getObjValue(Cbc_Model *model);
1055
1056/** @brief Final optimization status
1057  *
1058  * Returns the optimization status of MIP models. For more info check function
1059  * isProvenOptimal, isProvenInfeasible, etc. Check also secondary status.
1060  * Possible status are:
1061  *
1062  * -1 before branchAndBound
1063  * 0 finished - check isProvenOptimal or isProvenInfeasible to see if solution found (or check value of best solution)
1064  * 1 stopped - on maxnodes, maxsols, maxtime
1065  * 2 execution abandoned due to numerical dificulties
1066  * 5 user programmed interruption
1067  *
1068  * @param model problem object
1069  * @return problem status
1070  */
1071COINLIBAPI int COINLINKAGE Cbc_status(Cbc_Model *model);
1072
1073/** @brief Secondary status of problem
1074  *
1075  * Returns additional information regarding the optimization status
1076  *
1077  * -1 unset (status_ will also be -1)
1078  *  0 search completed with solution
1079  *  1 linear relaxation not feasible (or worse than cutoff)
1080  *  2 stopped on gap
1081  *  3 stopped on nodes
1082  *  4 stopped on time
1083  *  5 stopped on user event
1084  *  6 stopped on solutions
1085  *  7 linear relaxation unbounded
1086  *  8 stopped on iteration limit
1087  *
1088  *  @model problem object
1089  *  @return optimization status
1090  */
1091COINLIBAPI int COINLINKAGE
1092Cbc_secondaryStatus(Cbc_Model *model);
1093
1094/** Number of iterations */
1095COINLIBAPI int COINLINKAGE
1096Cbc_getIterationCount(Cbc_Model *model);
1097
1098/** Node limit reached? */
1099COINLIBAPI int COINLINKAGE
1100Cbc_isNodeLimitReached(Cbc_Model *model);
1101
1102/** Time limit reached? */
1103COINLIBAPI int COINLINKAGE
1104Cbc_isSecondsLimitReached(Cbc_Model *model);
1105
1106/** Solution limit reached? */
1107COINLIBAPI int COINLINKAGE
1108Cbc_isSolutionLimitReached(Cbc_Model *model);
1109
1110/** Are there numerical difficulties (for initialSolve) ? */
1111COINLIBAPI int COINLINKAGE
1112Cbc_isInitialSolveAbandoned(Cbc_Model *model);
1113
1114/** Is optimality proven (for initialSolve) ? */
1115COINLIBAPI int COINLINKAGE
1116Cbc_isInitialSolveProvenOptimal(Cbc_Model *model);
1117
1118/** Is primal infeasiblity proven (for initialSolve) ? */
1119COINLIBAPI int COINLINKAGE
1120Cbc_isInitialSolveProvenPrimalInfeasible(Cbc_Model *model);
1121
1122/** "row" solution
1123  *  This is the vector A*x, where A is the constraint matrix
1124  *  and x is the current solution. */
1125COINLIBAPI const double *COINLINKAGE
1126Cbc_getRowActivity(Cbc_Model *model);
1127
1128/** Number of nodes explored in B&B tree */
1129COINLIBAPI int COINLINKAGE
1130Cbc_getNodeCount(Cbc_Model *model);
1131
1132/*@}*/
1133
1134/** \name OsiSolverInterface related routines (used in callbacks) */
1135
1136/** @brief Creates a new OsiClpSolverInterface and returns a pointer to an OsiSolverInterface object */
1137COINLIBAPI void * COINLINKAGE
1138Osi_newSolver();
1139
1140/** @brief Solves initial LP relaxation */
1141COINLIBAPI void COINLINKAGE
1142Osi_initialSolve(void *osi);
1143
1144/** @brief Reoptimizes linear program  */
1145COINLIBAPI void COINLINKAGE
1146Osi_resolve(void *osi);
1147
1148/** @brief Performs branch and bound */
1149COINLIBAPI void COINLINKAGE
1150Osi_branchAndBound(void *osi);
1151
1152
1153/** @brief Checks if optimization was abandoned */
1154COINLIBAPI char COINLINKAGE
1155Osi_isAbandoned(void *osi);
1156
1157/** @brief Checks if optimal solution was found */
1158COINLIBAPI char COINLINKAGE
1159Osi_isProvenOptimal(void *osi);
1160
1161/** @brief Checks if problem is primal infeasible */
1162COINLIBAPI char COINLINKAGE
1163Osi_isProvenPrimalInfeasible(void *osi);
1164
1165/** @brief Checks if problem is dual infeasible */
1166COINLIBAPI char COINLINKAGE
1167Osi_isProvenDualInfeasible(void *osi);
1168
1169/** @brief Checks if primal objective limit was reached */
1170COINLIBAPI char COINLINKAGE
1171Osi_isPrimalObjectiveLimitReached(void *osi);
1172
1173/** @brief Checks if dual objective limit was reached */
1174COINLIBAPI char COINLINKAGE
1175Osi_isDualObjectiveLimitReached(void *osi);
1176
1177/** @brief Checks if iteration limit was reached */
1178COINLIBAPI char COINLINKAGE
1179Osi_isIterationLimitReached(void *osi);
1180
1181/** @brief Returns number of cols in OsiSolverInterface object */
1182COINLIBAPI int COINLINKAGE
1183Osi_getNumCols( void *osi );
1184
1185/** @brief Returns column name in OsiSolverInterface object */
1186COINLIBAPI void COINLINKAGE
1187Osi_getColName( void *osi, int i, char *name, int maxLen );
1188
1189/** @brief Returns column lower bounds in OsiSolverInterface object */
1190COINLIBAPI const double * COINLINKAGE
1191Osi_getColLower( void *osi );
1192
1193/** @brief Returns column upper bounds in OsiSolverInterface object */
1194COINLIBAPI const double * COINLINKAGE
1195Osi_getColUpper( void *osi );
1196
1197/** @brief Returns integrality information for columns in OsiSolverInterface object */
1198COINLIBAPI int COINLINKAGE
1199Osi_isInteger( void *osi, int col );
1200
1201/** @brief Returns number of rows in OsiSolverInterface object */
1202COINLIBAPI int COINLINKAGE
1203Osi_getNumRows( void *osi );
1204
1205/** @brief Returns number non-zeros in the constraint matrix */
1206COINLIBAPI int COINLINKAGE
1207Osi_getNumNz( void *osi );
1208
1209/** @brief Returns number integer/binary variables */
1210COINLIBAPI int COINLINKAGE
1211Osi_getNumIntegers( void *osi );
1212
1213COINLIBAPI int COINLINKAGE
1214Osi_getRowNz(void *osi, int row);
1215
1216/** @brief Indices of variables that appear on a row */
1217COINLIBAPI const int *COINLINKAGE
1218Osi_getRowIndices(void *osi, int row);
1219
1220/** @brief Coefficients of variables that appear on this row
1221     *
1222     * @param model problem object
1223     * @param row row index
1224     * @return coefficients of variables that appear on this row
1225     **/
1226COINLIBAPI const double *COINLINKAGE
1227Osi_getRowCoeffs(void *osi, int row);
1228
1229/** @brief Right hand side of a row
1230     *
1231     * @param model problem object
1232     * @param row row index
1233     * @return row right hand side
1234     **/
1235COINLIBAPI double COINLINKAGE
1236Osi_getRowRHS(void *osi, int row);
1237
1238/** @brief Sense a row
1239     * @param model problem object
1240     * @param row row index
1241     * @return row sense: E for =, L for <=, G for >= and R for ranged row
1242     **/
1243COINLIBAPI char COINLINKAGE
1244Osi_getRowSense(void *osi, int row);
1245
1246/** @brief Returns vector with objective function coefficients */
1247COINLIBAPI const double * COINLINKAGE
1248Osi_getObjCoefficients();
1249
1250/** @brief Returns the objective sense: 1 for MIN and -1 for MAX */
1251COINLIBAPI double COINLINKAGE
1252Osi_getObjSense();
1253
1254/** @brief Returns solution vector in OsiSolverInterface object */
1255COINLIBAPI const double * COINLINKAGE
1256Osi_getColSolution( void *osi );
1257
1258/** @brief Returns vector of reduced costs */
1259COINLIBAPI const double * COINLINKAGE
1260Osi_getReducedCost( void *osi );
1261
1262/** @brief Returns of dual variables */
1263COINLIBAPI const double *COINLINKAGE
1264Osi_getRowPrice( void *osi );
1265
1266/** @brief Returns the objective function value */
1267COINLIBAPI double COINLINKAGE
1268Osi_getObjValue( void *osi );
1269
1270/** @brief Sets column upper bound */
1271COINLIBAPI void COINLINKAGE
1272Osi_setColUpper (void *osi, int elementIndex, double ub);
1273
1274/** @brief Sets column upper bound */
1275COINLIBAPI void COINLINKAGE
1276Osi_setColLower(void *osi, int elementIndex, double lb);
1277
1278/** @brief Sets one objective function coefficient */
1279COINLIBAPI void COINLINKAGE
1280Osi_setObjCoef(void *osi, int elementIndex, double obj);
1281
1282/** @brief Sets optimization direction
1283    *
1284    * @param osi OsiSolverInterface object
1285    * @param sense: direction of optimization (1 - minimize, -1 - maximize, 0 - ignore)
1286    **/
1287COINLIBAPI void COINLINKAGE
1288Osi_setObjSense(void *osi, double sense);
1289
1290/** @brief Sets a variable to integer */
1291COINLIBAPI void COINLINKAGE
1292Osi_setInteger(void *osi, int index);
1293
1294/** @brief Sets a variable to continuous */
1295COINLIBAPI void COINLINKAGE
1296Osi_setContinuous(void *osi, int index);
1297
1298/** @brief Number of non-zero entries in a column
1299     *
1300     * @param model problem object
1301     * @param col column index
1302     * @return numbef of rows that this column appears
1303     **/
1304COINLIBAPI int COINLINKAGE
1305Osi_getColNz(void *model, int col);
1306
1307/** @brief Indices of rows that a column appears
1308     *
1309     * @param model problem object
1310     * @param col column index
1311     * @return indices of rows that this column appears
1312     **/
1313COINLIBAPI const int *COINLINKAGE
1314Osi_getColIndices(void *model, int col);
1315
1316/** @brief Coefficients that a column appear in rows
1317     *
1318     * @param model problem object
1319     * @param col column index
1320     * @return coefficients of this column in rows
1321     **/
1322COINLIBAPI const double *COINLINKAGE
1323Osi_getColCoeffs(void *model, int col);
1324
1325/** @brief Creates a new column
1326     *
1327     * Creates a new column (variable)
1328     *
1329     * @param osi OsiSolverInterface object
1330     * @param name variable name
1331     * @param lb column lower bound
1332     * @param ub column upper bound
1333     * @param obj objective function coefficient
1334     * @param isInteger 1 if variable is integral, 0 otherwise
1335     * @param nz number of rows (constraints) where this column appears, can be 0 if constraints will be added later
1336     * @param rows index of rows where this column appears, NULL if rows will be added later
1337     * @param coefs coefficients that this column appears in its rows, NULL if rows will be added later
1338     ***/
1339COINLIBAPI void COINLINKAGE
1340Osi_addCol(void *osi, const char *name, double lb,
1341  double ub, double obj, char isInteger,
1342  int nz, int *rows, double *coefs);
1343
1344/** @brief Adds a new row
1345     *
1346     *  Adds a new row (linear constraint) to the problem
1347     *
1348     *  @param osi OsiSolverInterface object
1349     *  @param name constraint name
1350     *  @param nz number of variables with non-zero coefficients in this row
1351     *  @param cols index of variables that appear in this row
1352     *  @param coefs cofficients that that variables appear
1353     *  @param sense constraint sense: L if <=, G if >=, E if =, R if ranged and N if free
1354     *  @param rhs right hand size
1355     * */
1356COINLIBAPI void COINLINKAGE
1357Osi_addRow(void *osi, const char *name, int nz,
1358  const int *cols, const double *coefs, char sense, double rhs);
1359
1360/** @brief Returns the integer tolerance
1361 **/ 
1362COINLIBAPI double COINLINKAGE
1363Osi_getIntegerTolerance(void *osi);
1364
1365/** @brief Deletes an OsiSolverInterface object */
1366COINLIBAPI void COINLINKAGE
1367Osi_deleteSolver( void *osi );
1368
1369/*@}*/
1370
1371/** \name Cgl related routines */
1372
1373void Cgl_generateCuts( void *osiClpSolver, enum CutType ct, void *osiCuts, int strength );
1374
1375/*@}*/
1376
1377
1378/** \name OsiCuts related routines (used in callbacks) */
1379
1380/** Creates a new cut pool and returns its pointer */
1381COINLIBAPI void * COINLINKAGE
1382OsiCuts_new();
1383
1384/** adds a row cut (used in callback) */
1385COINLIBAPI void COINLINKAGE
1386OsiCuts_addRowCut( void *osiCuts, int nz, const int *idx, const double *coef, char sense, double rhs );
1387
1388/** adds a row cut (used in callback), stating that this is a globally valid cut */
1389COINLIBAPI void COINLINKAGE
1390OsiCuts_addGlobalRowCut( void *osiCuts, int nz, const int *idx, const double *coef, char sense, double rhs );
1391
1392/** Returns the number of row cuts stored */
1393COINLIBAPI int COINLINKAGE
1394OsiCuts_sizeRowCuts( void *osiCuts );
1395
1396/** Returns the number of row cuts stored */
1397COINLIBAPI int COINLINKAGE
1398OsiCuts_nzRowCut( void *osiCuts, int iRowCut );
1399
1400/** Returns the variable indexes in a row cut */
1401COINLIBAPI const int * COINLINKAGE
1402OsiCuts_idxRowCut( void *osiCuts, int iRowCut );
1403
1404/** Returns the variable coefficients in a row cut */
1405COINLIBAPI const double * COINLINKAGE
1406OsiCuts_coefRowCut( void *osiCuts, int iRowCut );
1407
1408/** Returns the variable coefficients in a row cut */
1409COINLIBAPI double COINLINKAGE
1410OsiCuts_rhsRowCut( void *osiCuts, int iRowCut );
1411
1412/** Returns the sense of a row cut */
1413COINLIBAPI char COINLINKAGE
1414OsiCuts_senseRowCut( void *osiCuts, int iRowCut );
1415
1416/** Deletes a cut pool */
1417COINLIBAPI void COINLINKAGE
1418OsiCuts_delete( void *osiCuts );
1419
1420
1421
1422/*@}*/
1423
1424#ifdef __cplusplus
1425}
1426#endif
1427#endif
1428
1429/* vi: softtabstop=2 shiftwidth=2 expandtab tabstop=2
1430*/
Note: See TracBrowser for help on using the repository browser.