source: trunk/Cbc/src/Cbc_C_Interface.h @ 2488

Last change on this file since 2488 was 2488, checked in by unxusr, 8 months ago

initializations in CbcParam? and more getters and setters in Cbc_C_Interface

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 25.3 KB
RevLine 
[1271]1/* $Id: Cbc_C_Interface.h 2488 2019-02-12 10:20:57Z unxusr $ */
[1573]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*/
[2]8#ifndef CbcModelC_H
9#define CbcModelC_H
10
11/* include all defines and ugly stuff */
12#include "Coin_C_defines.h"
[2021]13#include <stddef.h>
[2]14
[2037]15/*
[2457]16 * Original version contributed by Bob Entriken,
[2037]17 * significantly updated by Miles Lubin.
[2457]18 * 2018: several updates by Haroldo
19 */
[2]20
21#ifdef __cplusplus
[1286]22extern "C" {
[2]23#endif
24
[2457]25/** Current version of Cbc */
[2464]26COINLIBAPI const char *COINLINKAGE Cbc_getVersion(void);
[703]27
[2457]28/** \name Problem creation and modification routines */
29//@{
30
[2464]31/** @brief Creates an empty problem */
32COINLIBAPI Cbc_Model *COINLINKAGE
33Cbc_newModel(void);
[2457]34
[2464]35/** @brief Sets problem name.
[2457]36     *
37     * @param model problem object
38     * @param array string with problem name
39     **/
[2464]40COINLIBAPI int COINLINKAGE
41Cbc_setProblemName(Cbc_Model *model, const char *array);
[2457]42
[2464]43/** @brief Creates a new column
[2457]44     *
45     * Creates a new column (variable)
46     *
47     * @param model problem object
48     * @param name variable name
49     * @param lb column lower bound
50     * @param ub column upper bound
51     * @param obj objective function coefficient
52     * @param isInteger 1 if variable is integral, 0 otherwise
53     * @param nz number of rows (constraints) where this column appears, can be 0 if constraints will be added later
54     * @param rows index of rows where this column appears, NULL if rows will be added later
55     * @param coefs coefficients that this column appears in its rows, NULL if rows will be added later
56     ***/
[2464]57COINLIBAPI void COINLINKAGE
58Cbc_addCol(Cbc_Model *model, const char *name, double lb,
59  double ub, double obj, char isInteger,
60  int nz, int *rows, double *coefs);
[2457]61
[2464]62/** @brief Adds a new row
[2457]63     *
64     *  Adds a new row (linear constraint) to the problem
65     *
66     *  @param model problem object
67     *  @param name constraint name
68     *  @param nz number of variables with non-zero coefficients in this row
69     *  @param cols index of variables that appear in this row
70     *  @param coefs cofficients that that variables appear
71     *  @param sense constraint sense: L if <=, G if >=, E if =, R if ranged and N if free
72     *  @param rhs right hand size
73     * */
[2464]74COINLIBAPI void COINLINKAGE
75Cbc_addRow(Cbc_Model *model, const char *name, int nz,
76  const int *cols, const double *coefs, char sense, double rhs);
[2]77
[2464]78/** @brief Add SOS constraints to the model using row-order matrix */
79COINLIBAPI void COINLINKAGE
80Cbc_addSOS(Cbc_Model *model, int numRows, const int *rowStarts,
81  const int *colIndices, const double *weights, const int type);
82
83/** Loads a problem (the constraints on the
[1286]84        rows are given by lower and upper bounds). If a pointer is NULL then the
85        following values are the default:
86        <ul>
87        <li> <code>colub</code>: all columns have upper bound infinity
88        <li> <code>collb</code>: all columns have lower bound 0
89        <li> <code>rowub</code>: all rows have upper bound infinity
90        <li> <code>rowlb</code>: all rows have lower bound -infinity
91        <li> <code>obj</code>: all variables have 0 objective coefficient
92        </ul>
[2]93
[2021]94     The constraint matrix is
95     given in standard compressed sparse column (without gaps).
96     <ul>
97     <li> <code>start[i]</code> stores the starting index of the ith column
98     <li> <code>index[k]</code> stores the row index of the kth nonzero element
99     <li> <code>value[k]</code> stores the coefficient of the kth nonzero element
100     </ul>
[1286]101    */
[2464]102COINLIBAPI void COINLINKAGE
103Cbc_loadProblem(Cbc_Model *model, const int numcols, const int numrows,
104  const CoinBigIndex *start, const int *index,
105  const double *value,
106  const double *collb, const double *colub,
107  const double *obj,
108  const double *rowlb, const double *rowub);
[2457]109
[2464]110/** @brief Set the name of a column
[2457]111     *
112     * @param model problem object
113     * @param iColumn column index
114     * @param column name
115     **/
[2464]116COINLIBAPI void COINLINKAGE
117Cbc_setColName(Cbc_Model *model, int iColumn, const char *name);
[2457]118
[2464]119/** @brief Set the name of a row
[2457]120     *
121     * @param model problem object
122     * @param iRow row index
123     * @param name row name
124     **/
[2464]125COINLIBAPI void COINLINKAGE
126Cbc_setRowName(Cbc_Model *model, int iRow, const char *name);
[2457]127
[2464]128/** @brief Sets optimization direction
[2457]129    *
130    * @param model problem object
131    * @param sense: direction of optimization (1 - minimize, -1 - maximize, 0 - ignore)
132    **/
[2464]133COINLIBAPI void COINLINKAGE
134Cbc_setObjSense(Cbc_Model *model, double sense);
[2457]135
[2464]136/** @brief Set the lower bound of a single constraint
[2457]137     *
138     * @param model problem object
139     * @param index row index
140     * @param value new row lower bound
141     **/
[2464]142COINLIBAPI void COINLINKAGE
143Cbc_setRowLower(Cbc_Model *model, int index, double value);
[2457]144
[2464]145/** @brief  Set the upper bound of a single constraint
[2457]146     *
147     * @param model problem object
148     * @param index row index
149     * @param value new row upper bound
150     **/
[2464]151COINLIBAPI void COINLINKAGE
152Cbc_setRowUpper(Cbc_Model *model, int index, double value);
[2457]153
[2464]154/** @brief Set the objective coefficient of a single variable
[2457]155     *
156     * @param model problem object
157     * @param index variable index
158     * @param value new objective function coefficient for this variable
159     **/
[2464]160COINLIBAPI void COINLINKAGE
161Cbc_setObjCoeff(Cbc_Model *model, int index, double value);
[2457]162
[2464]163/** @brief Set the lower bound of a single variable
[2457]164     *
165     * @param model problem object
166     * @param index variable index
167     * @param value variable lower bound
168     **/
[2464]169COINLIBAPI void COINLINKAGE
170Cbc_setColLower(Cbc_Model *model, int index, double value);
[2457]171
[2464]172/** @brief Set the upper bound of a single variable
[2457]173     *
174     * @param model problem object
175     * @param index variable index
176     * @param value new variable upper bound
177     **/
[2464]178COINLIBAPI void COINLINKAGE
179Cbc_setColUpper(Cbc_Model *model, int index, double value);
180
181/** @brief Set this variable to be continuous
[2457]182     *
183     * @param model problem object
184     * @param iColumn column index
185     **/
[2464]186COINLIBAPI void COINLINKAGE
187Cbc_setContinuous(Cbc_Model *model, int iColumn);
[2457]188
[2464]189/** @brief Set this variable to be integer
[2457]190     *
191     * @param model problem object
192     * @param iColumn column index
193     **/
[2464]194COINLIBAPI void COINLINKAGE
195Cbc_setInteger(Cbc_Model *model, int iColumn);
[2457]196
[2464]197/** @brief Cbc_Model destructor */
198COINLIBAPI void COINLINKAGE
199Cbc_deleteModel(Cbc_Model *model);
[2457]200
[2464]201/** @brief Enter initial feasible solution
[2462]202     *
203     * Enter an initial feasible solution. Only the non-zero main
204     * binary/integer decision variables need to be informed.
205     * Auxiliary and/or continuous variables are computed
206     * automatically.
207     *
208     * @param model problem object
209     * @param count number of variables
210     * @param colNames names of variables
211     * @param colValues variable values
212     *
213     **/
[2464]214COINLIBAPI void COINLINKAGE
215Cbc_setMIPStart(Cbc_Model *model, int count, const char **colNames, const double colValues[]);
[2462]216
[2464]217/** @brief Enter initial feasible solution
[2463]218     *
219     * Enter an initial feasible solution. Only the non-zero main
220     * binary/integer decision variables need to be informed.
221     * Auxiliary and/or continuous variables are computed
222     * automatically. Same as setMIPStart but using variable indexes.
223     *
224     * @param model problem object
225     * @param count number of variables
226     * @param colIdxs indexes of variables
227     * @param colValues variable values
228     *
229     **/
[2464]230COINLIBAPI void COINLINKAGE
231Cbc_setMIPStartI(Cbc_Model *model, int count, const int colIdxs[], const double colValues[]);
[2463]232
[2464]233/** @brief Creates a copy of the current model
[2461]234     *
235     * @param model problem object
236     * @return model copy
237     **/
[2464]238COINLIBAPI Cbc_Model *COINLINKAGE
239Cbc_clone(Cbc_Model *model);
[2461]240
[2464]241//@}
[2461]242
243/** \name Routines to query problem contents
244*/
245//@{
[2457]246
[2464]247/** @brief Queries problem name
[2457]248     *
249     * @param model problem object
250     * @param maxNumberCharacters space in string array
251     * @param array string where problem name will be saved
252     **/
[2464]253COINLIBAPI void COINLINKAGE
254Cbc_problemName(Cbc_Model *model, int maxNumberCharacters, char *array);
[2021]255
[2464]256/** @brief Number of nonzero elements in constraint matrix
[2457]257     *
258     * @param model problem object
259     * @return number of non-zero entries in constraint matrix
260     **/
[2464]261COINLIBAPI int COINLINKAGE
262Cbc_getNumElements(Cbc_Model *model);
[2457]263
[2464]264/** @brief Number of variables in the model
[2457]265     * @param model problem object
266     * @return number of columns (variables)
267     **/
[2464]268COINLIBAPI int COINLINKAGE
269Cbc_getNumCols(Cbc_Model *model);
[2457]270
[2464]271/** @brief Number of integer variables in the model
[2457]272     *
273     * @param model problem object
274     * @return number of integer variables in this model
275     **/
[2464]276COINLIBAPI int COINLINKAGE
277Cbc_getNumIntegers(Cbc_Model *model);
[2021]278
[2464]279/** Number of constraints in the model
[2457]280     * @param model problem object
281     * @return number of rows (constraints) in the model
282     **/
[2464]283COINLIBAPI int COINLINKAGE
284Cbc_getNumRows(Cbc_Model *model);
285
286/** @brief Queries row name
[2457]287     *
288     * @param model problem object
289     * @param row index
290     * @param name string where row name will be stored
291     * @param string where row name will be stored
292     **/
[2464]293COINLIBAPI void COINLINKAGE
294Cbc_getRowName(Cbc_Model *model, int iRow, char *name, size_t maxLength);
[2457]295
[2464]296/** Queries column name
[2457]297     *
298     * @param model problem object
299     * @param iColumn column index
300     * @param name where name will be stored
301     * @param maxLength maximum length of name string
302     **/
[2464]303COINLIBAPI void COINLINKAGE
304Cbc_getColName(Cbc_Model *model, int iColumn, char *name, size_t maxLength);
[2457]305
[2464]306/** @brief Number of non-zero entries in a row
[2457]307     *
308     * @param model problem object
309     * @param row row index
310     * @return number of non-zero entries in row
311     **/
[2464]312COINLIBAPI int COINLINKAGE
313Cbc_getRowNz(Cbc_Model *model, int row);
[2457]314
[2464]315/** @brief Indices of variables that appear on a row
[2457]316     *
317     * @param model problem object
318     * @param row row index
319     * @return vector with indexes of columns that appear on this row
320     **/
[2464]321COINLIBAPI const int *COINLINKAGE
322Cbc_getRowIndices(Cbc_Model *model, int row);
[2457]323
[2464]324/** @brief Coefficients of variables that appear on this row
[2457]325     *
326     * @param model problem object
327     * @param row row index
328     * @return coefficients of variables that appear on this row
329     **/
[2464]330COINLIBAPI const double *COINLINKAGE
331Cbc_getRowCoeffs(Cbc_Model *model, int row);
[2457]332
[2464]333/** @brief Number of non-zero entries in a column
[2457]334     *
335     * @param model problem object
336     * @param col column index
337     * @return numbef of rows that this column appears
338     **/
[2464]339COINLIBAPI int COINLINKAGE
340Cbc_getColNz(Cbc_Model *model, int col);
[2457]341
[2464]342/** @brief Indices of rows that a column appears
[2457]343     *
344     * @param model problem object
345     * @param col column index
346     * @return indices of rows that this column appears
347     **/
[2464]348COINLIBAPI const int *COINLINKAGE
349Cbc_getColIndices(Cbc_Model *model, int col);
[2457]350
[2464]351/** @brief Coefficients that a column appear in rows
[2457]352     *
353     * @param model problem object
354     * @param col column index
355     * @return coefficients of this column in rows
356     **/
[2464]357COINLIBAPI const double *COINLINKAGE
358Cbc_getColCoeffs(Cbc_Model *model, int col);
[2457]359
[2464]360/** @brief Right hand side of a row
[2457]361     *
362     * @param model problem object
363     * @param row row index
364     * @return row right hand side
365     **/
[2464]366COINLIBAPI double COINLINKAGE
367Cbc_getRowRHS(Cbc_Model *model, int row);
[2457]368
[2464]369/** @brief Sense a row
[2457]370     * @param model problem object
371     * @param row row index
372     * @return row sense: E for =, L for <=, G for >= and R for ranged row
373     **/
[2464]374COINLIBAPI char COINLINKAGE
375Cbc_getRowSense(Cbc_Model *model, int row);
376
377/** @brief Direction of optimization
[2457]378     *
379     * @param model problem object
380     * @return Direction of optimization (1 - minimize, -1 - maximize, 0 - ignore)
381     **/
[2464]382COINLIBAPI double COINLINKAGE
383Cbc_getObjSense(Cbc_Model *model);
[2457]384
[2464]385/** @brief Constraint lower bounds
[2457]386     *
387     * @param model problem object
388     * @return vector with lower bounds of constraints
389     **/
[2464]390COINLIBAPI const double *COINLINKAGE
391Cbc_getRowLower(Cbc_Model *model);
[2457]392
[2464]393/** @brief Constraint upper bounds
[2457]394     *
395     * @param model problem object
396     * @return constraint upper bounds
397     **/
[2464]398COINLIBAPI const double *COINLINKAGE
399Cbc_getRowUpper(Cbc_Model *model);
[2457]400
[2464]401/** @brief Objective vector
[2457]402     *
403     * @param model problem object
404     * @return vector with coefficients of variables in the objective function
405     **/
[2464]406COINLIBAPI const double *COINLINKAGE
407Cbc_getObjCoefficients(Cbc_Model *model);
[2457]408
[2464]409/** @brief Variable lower bounds
[2457]410     *
411     * @param model problem object
412     * @return vector with lower bounds of variables
413     **/
[2464]414COINLIBAPI const double *COINLINKAGE
415Cbc_getColLower(Cbc_Model *model);
[2457]416
[2464]417/** @brief Variable upper bounds
[2457]418     *
419     * @param model problem object
420     * @return vector with column upper bounds
421     **/
[2464]422COINLIBAPI const double *COINLINKAGE
423Cbc_getColUpper(Cbc_Model *model);
[2457]424
[2464]425/** @brief Determine whether the ith variable is integer restricted
[2457]426     *
427     * @param model problem object
428     * @param i variable index
429     * @return 1 if variable is integer, 0 otherwise
430     **/
[2464]431COINLIBAPI int COINLINKAGE
432Cbc_isInteger(Cbc_Model *model, int i);
[2457]433
[2473]434
[2464]435//@}
436
[2457]437/** \name Routines to load and save problems from disk
438*/
439//@{
440
[2464]441/** @brief Read an mps file from the given filename
[2457]442    *
443    * @param model problem object
444    * @param fileName file name
445    **/
[2464]446COINLIBAPI int COINLINKAGE
447Cbc_readMps(Cbc_Model *model, const char *filename);
[2457]448
[2464]449/** @brief Read an lp file from the given filename
[2457]450     *
451     * @param model problem object
452     * @param fileName file name
453     **/
[2464]454COINLIBAPI int COINLINKAGE
455Cbc_readLp(Cbc_Model *model, const char *filename);
[2457]456
[2464]457/** @brief Write an mps file from the given filename
[2457]458     *
459     * @param model problem object
460     * @param fileName file name
461     **/
[2464]462COINLIBAPI void COINLINKAGE
463Cbc_writeMps(Cbc_Model *model, const char *filename);
[2457]464
[2464]465/** @brief Write an lp file from the given filename
[2457]466     *
467     * @param model problem object
468     * @param fileName file name
469     **/
[2464]470COINLIBAPI void COINLINKAGE
471Cbc_writeLp(Cbc_Model *model, const char *filename);
472
[2457]473//@}
474
[2464]475/**@name Getting and setting model data
[2457]476     Note that problem access and modification methods,
477       such as getColLower and setColLower,
478       are *not valid* after calling Cbc_solve().
479       Therefore it is not recommended to reuse a Cbc_Model
480       object for multiple solves. A workaround is to call Cbc_clone()
481       before solving.
482     * */
[2464]483/*@{*/
[2457]484
[2464]485/** Provide an initial feasible solution to accelerate branch-and-bound
[2457]486     Note that feasibility of the solution is *not* verified.
487    */
[2464]488COINLIBAPI void COINLINKAGE
489Cbc_setInitialSolution(Cbc_Model *model, const double *sol);
490/** "Column start" vector of constraint matrix. Same format as Cbc_loadProblem() */
491COINLIBAPI const CoinBigIndex *COINLINKAGE
492Cbc_getVectorStarts(Cbc_Model *model);
493/** "Row index" vector of constraint matrix */
494COINLIBAPI const int *COINLINKAGE
495Cbc_getIndices(Cbc_Model *model);
496/** Coefficient vector of constraint matrix */
497COINLIBAPI const double *COINLINKAGE
498Cbc_getElements(Cbc_Model *model);
[2457]499
[2464]500/** Maximum lenght of a row or column name */
501COINLIBAPI size_t COINLINKAGE
502Cbc_maxNameLength(Cbc_Model *model);
503/** Print the model */
504COINLIBAPI void COINLINKAGE
505Cbc_printModel(Cbc_Model *model, const char *argPrefix);
506/*@}*/
[2457]507
[2464]508/**@name Solver parameters */
509/*@{*/
510/** Set parameter "name" to value "value". Note that this
[2021]511     * translates directly to using "-name value" as a
512     * command-line argument to Cbc.*/
[2464]513COINLIBAPI void COINLINKAGE
514Cbc_setParameter(Cbc_Model *model, const char *name, const char *value);
[2021]515
[2488]516
517/** returns the allowable gap
518 */
519COINLIBAPI double COINLINKAGE
520Cbc_getAllowableGap(Cbc_Model *model);
521
522/** sets the allowable gap
523 */
524COINLIBAPI void COINLINKAGE
525Cbc_setAllowableGap(Cbc_Model *model, double allowedGap);
526
527/** returns the allowable fraction gap
528 */
529COINLIBAPI double COINLINKAGE
530Cbc_getAllowableFractionGap(Cbc_Model *model);
531
532/** sets the allowable fraction gap
533 */
534COINLIBAPI void COINLINKAGE
535Cbc_setAllowableFractionGap(Cbc_Model *model, double allowedFracionGap);
536
537/** returns the allowable percentage gap
538 */
539COINLIBAPI double COINLINKAGE
540Cbc_getAllowablePercentageGap(Cbc_Model *model);
541
542/** sets the allowable percentage gap
543 */
544COINLIBAPI void COINLINKAGE
545Cbc_setAllowablePercentageGap(Cbc_Model *model, double allowedPercentageGap);
546
547
548/** returns the cutoff
549 */
550COINLIBAPI double COINLINKAGE
551Cbc_getCutoff(Cbc_Model *model);
552
553/** sets the cutoff
554 */
555COINLIBAPI void COINLINKAGE
556Cbc_setCutoff(Cbc_Model *model, double cutoff);
557
558
559
[2464]560/*@}*/
561/**@name Message handling.  Call backs are handled by ONE function */
562/*@{*/
563/** Pass in Callback function.
[1286]564     Message numbers up to 1000000 are Clp, Coin ones have 1000000 added */
[2464]565COINLIBAPI void COINLINKAGE
566Cbc_registerCallBack(Cbc_Model *model,
567  cbc_callback userCallBack);
[2473]568
[2464]569/** Unset Callback function */
570COINLIBAPI void COINLINKAGE
571Cbc_clearCallBack(Cbc_Model *model);
[2]572
[2473]573COINLIBAPI void COINLINKAGE Cbc_addCutCallback( 
574    Cbc_Model *model, cbc_cut_callback cutcb, 
575    const char *name, void *appData );
576
[2464]577/*@}*/
[2]578
[2464]579/**@name Solving the model */
580/*@{*/
581/* Solve the model with Cbc (using CbcMain1).
[2016]582    */
[2464]583COINLIBAPI int COINLINKAGE
584Cbc_solve(Cbc_Model *model);
585/*@}*/
[1286]586
[2461]587/**@name Accessing the solution and optimization status */
588/*@{*/
[2021]589
[2464]590/** @brief Best feasible solution vector
[2458]591     *
592     * @param model problem object
593     * @return vector with best solution found
594     **/
[2464]595COINLIBAPI const double *COINLINKAGE
596Cbc_getColSolution(Cbc_Model *model);
[2459]597
[2473]598
[2464]599/** @brief Best known bound on the optimal objective value
[2459]600     *
601     * @param model problem object
602     * @return best possible cost (lower bound)
603     **/
[2464]604COINLIBAPI double COINLINKAGE
605Cbc_getBestPossibleObjValue(Cbc_Model *model);
[2459]606
[2464]607/** @brief Best integer feasible solution
[2459]608     *
609     * Best integer feasible solution or NULL if no integer feas sol found
610     *
611     * @param model problem object
612     * @return vector with the best solution found or NULL if no feasible solution was found
613     **/
[2464]614COINLIBAPI double *COINLINKAGE
615Cbc_bestSolution(Cbc_Model *model);
[2459]616
[2464]617/** @brief number of integer feasible solution saved
[2459]618     *
619     * @param model problem object
620     * @return number of saved solutions
621     **/
[2464]622COINLIBAPI int COINLINKAGE
623Cbc_numberSavedSolutions(Cbc_Model *model);
[2459]624
[2464]625/** @brief Vector with the i-th saved solution
[2459]626     *
627     * @param model problem object
628     * @param whichSol index of the solution to be retrieved
629     * @return vector with integer feasible solution
630     **/
[2464]631COINLIBAPI const double *COINLINKAGE
632Cbc_savedSolution(Cbc_Model *model, int whichSol);
633
634/** @brief Cost of the whichSol solution
[2460]635     *
636     * @param model problem object
637     * @param whichSol solution index
638     * @return solution cost
639     **/
[2464]640COINLIBAPI double COINLINKAGE
641Cbc_savedSolutionObj(Cbc_Model *model, int whichSol);
642
643/** @brief Queries vector of reduced costs
[2458]644     *
645     * @param model problem object
646     * @return reduced cost vector
647     **/
[2464]648COINLIBAPI const double *COINLINKAGE
649Cbc_getReducedCost(Cbc_Model *model);
[2458]650
[2464]651/** If optimization was abandoned due to numerical difficulties
[2461]652     *
653     * @param model problem object
654     * @return 1 if numerical difficulties interrupted the optimization, 0 otherwise
655     * */
[2464]656COINLIBAPI int COINLINKAGE
657Cbc_isAbandoned(Cbc_Model *model);
[2461]658
[2464]659/** @brief If the optimal solution was found
[2461]660     *
661     * @param model problem object
662     * @return 1 if optimal solution was found, 0 otherwise
663     **/
[2464]664COINLIBAPI int COINLINKAGE
665Cbc_isProvenOptimal(Cbc_Model *model);
[2461]666
[2464]667/** @brief If infeasibility was proven
[2461]668     *
669     * If model is infeasible, please note that infeasibility can also be declared
670     * if cutoff is informed and no solution better than the cutoff exists.
671     *
672     * @param model problem object
673     * @return 1 if model is infeasible, 0 otherwise
674     **/
[2464]675COINLIBAPI int COINLINKAGE
676Cbc_isProvenInfeasible(Cbc_Model *model);
[2461]677
[2464]678/** @brief Is continuous model unbounded ?
[2461]679    *
680    * @param model problem object
681    * @return 1 if model is unbounded, 0 otherwise
682    * */
[2464]683COINLIBAPI int COINLINKAGE
684Cbc_isContinuousUnbounded(Cbc_Model *model);
[2461]685
[2464]686/** Objective value of best feasible solution
[2461]687     *
688     * @param model problem object
689     * @return cost of the best solution found
690     * */
[2464]691COINLIBAPI double COINLINKAGE
692Cbc_getObjValue(Cbc_Model *model);
[2461]693
[2464]694/** @brief Final optimization status
[2461]695     *
696     * Returns the optimization status. For more info check function
697     * isProvenOptimal, isProvenInfeasible, etc. Check also secondary status.
698     * Possible status are:
699     *
700     * -1 before branchAndBound
701     * 0 finished - check isProvenOptimal or isProvenInfeasible to see if solution found (or check value of best solution)
702     * 1 stopped - on maxnodes, maxsols, maxtime
703     * 2 execution abandoned due to numerical dificulties
704     * 5 user programmed interruption
705     *
706     * @param model problem object
707     * @return problem status
708    */
[2464]709COINLIBAPI int COINLINKAGE Cbc_status(Cbc_Model *model);
[2461]710
[2464]711/** @brief Secondary status of problem
[2461]712     *
713     * Returns additional information regarding the optimization status
714     *
715     * -1 unset (status_ will also be -1)
716     *  0 search completed with solution
717     *  1 linear relaxation not feasible (or worse than cutoff)
718     *  2 stopped on gap
719     *  3 stopped on nodes
720     *  4 stopped on time
721     *  5 stopped on user event
722     *  6 stopped on solutions
723     *  7 linear relaxation unbounded
724     *  8 stopped on iteration limit
725     *
726     *  @model problem object
727     *  @return optimization status
728    */
[2464]729COINLIBAPI int COINLINKAGE
730Cbc_secondaryStatus(Cbc_Model *model);
[2458]731
[2464]732/** Sum of primal infeasibilities */
733COINLIBAPI double COINLINKAGE
734Cbc_sumPrimalInfeasibilities(Cbc_Model *model);
[1286]735
[2464]736/** Number of primal infeasibilities */
737COINLIBAPI int COINLINKAGE
738Cbc_numberPrimalInfeasibilities(Cbc_Model *model);
739
740/** Just check solution (for external use) - sets sum of
[1286]741        infeasibilities etc */
[2464]742COINLIBAPI void COINLINKAGE
743Cbc_checkSolution(Cbc_Model *model);
[1286]744
[2464]745/** Number of iterations */
746COINLIBAPI int COINLINKAGE
747Cbc_getIterationCount(Cbc_Model *model);
[2461]748
[2464]749/** Node limit reached? */
750COINLIBAPI int COINLINKAGE
751Cbc_isNodeLimitReached(Cbc_Model *model);
752/** Time limit reached? */
753COINLIBAPI int COINLINKAGE
754Cbc_isSecondsLimitReached(Cbc_Model *model);
755/** Solution limit reached? */
756COINLIBAPI int COINLINKAGE
757Cbc_isSolutionLimitReached(Cbc_Model *model);
758/** Are there numerical difficulties (for initialSolve) ? */
759COINLIBAPI int COINLINKAGE
760Cbc_isInitialSolveAbandoned(Cbc_Model *model);
761/** Is optimality proven (for initialSolve) ? */
762COINLIBAPI int COINLINKAGE
763Cbc_isInitialSolveProvenOptimal(Cbc_Model *model);
764/** Is primal infeasiblity proven (for initialSolve) ? */
765COINLIBAPI int COINLINKAGE
766Cbc_isInitialSolveProvenPrimalInfeasible(Cbc_Model *model);
767/** "row" solution
[2019]768     *  This is the vector A*x, where A is the constraint matrix
769     *  and x is the current solution. */
[2464]770COINLIBAPI const double *COINLINKAGE
771Cbc_getRowActivity(Cbc_Model *model);
772/** Number of nodes explored in B&B tree */
773COINLIBAPI int COINLINKAGE
774Cbc_getNodeCount(Cbc_Model *model);
775/** Print the solution */
776COINLIBAPI void COINLINKAGE
777Cbc_printSolution(Cbc_Model *model);
[2461]778
[2464]779/*@}*/
[2473]780
781/** \name OsiSolverInterface related routines (used in callbacks) */
782//@{
783
784/** @brief Returns number of cols in OsiSolverInterface object */
785COINLIBAPI int COINLINKAGE
786Osi_getNumCols( void *osi );
787
788/** @brief Returns column name in OsiSolverInterface object */
789COINLIBAPI void COINLINKAGE
790Osi_getColName( void *osi, int i, char *name, int maxLen );
791
792/** @brief Returns column lower bounds in OsiSolverInterface object */
793COINLIBAPI const double * COINLINKAGE
794Osi_getColLower( void *osi );
795
796/** @brief Returns column upper bounds in OsiSolverInterface object */
797COINLIBAPI const double * COINLINKAGE
798Osi_getColUpper( void *osi );
799
800/** @brief Returns integrality information for columns in OsiSolverInterface object */
801COINLIBAPI int COINLINKAGE
802Osi_isInteger( void *osi, int col );
803
804/** @brief Returns number of rows in OsiSolverInterface object */
805COINLIBAPI int COINLINKAGE
806Osi_getNumRows( void *osi );
807
808COINLIBAPI int COINLINKAGE
809Osi_getRowNz(void *osi, int row);
810
811/** @brief Indices of variables that appear on a row */
812COINLIBAPI const int *COINLINKAGE
813Osi_getRowIndices(void *osi, int row);
814
815/** @brief Coefficients of variables that appear on this row
816     *
817     * @param model problem object
818     * @param row row index
819     * @return coefficients of variables that appear on this row
820     **/
821COINLIBAPI const double *COINLINKAGE
822Osi_getRowCoeffs(void *osi, int row);
823
824/** @brief Right hand side of a row
825     *
826     * @param model problem object
827     * @param row row index
828     * @return row right hand side
829     **/
830COINLIBAPI double COINLINKAGE
831Osi_getRowRHS(void *osi, int row);
832
833/** @brief Sense a row
834     * @param model problem object
835     * @param row row index
836     * @return row sense: E for =, L for <=, G for >= and R for ranged row
837     **/
838COINLIBAPI char COINLINKAGE
839Osi_getRowSense(void *osi, int row);
840
841/** @brief Returns solution vector in OsiSolverInterface object */
842COINLIBAPI const double * COINLINKAGE
843Osi_getColSolution( void *osi );
844
[2478]845
[2473]846/*@}*/
847
848/** \name OsiCuts related routines (used in callbacks) */
849//@{
850
[2478]851/** adds a row cut (used in callback) */
852COINLIBAPI void COINLINKAGE
853OsiCuts_addRowCut( void *osiCuts, int nz, const int *idx, const double *coef, char sense, double rhs );
[2473]854
855/*@}*/
856
[2]857#ifdef __cplusplus
[1286]858}
[2]859#endif
860#endif
[2465]861
862/* vi: softtabstop=2 shiftwidth=2 expandtab tabstop=2
863*/
Note: See TracBrowser for help on using the repository browser.