1 | <?xml version="1.0" encoding="ISO-8859-1" standalone="no"?> |
---|
2 | <html xmlns="http://www.w3.org/1999/xhtml"><head><title> |
---|
3 | Getting Solution Information |
---|
4 | </title><meta name="generator" content="DocBook XSL Stylesheets V1.61.2"/><link rel="home" href="index.html" title="CBC User Guide"/><link rel="up" href="ch02.html" title="Chapter 2. The CBC Model Class "/><link rel="previous" href="ch02s03.html" title=" The Relationship Between OSI and CBC "/><link rel="next" href="ch02s05.html" title=" Useful Set and Get Methods in CbcModel "/></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center"> |
---|
5 | Getting Solution Information |
---|
6 | </th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ch02s03.html">Prev</a> </td><th width="60%" align="center">Chapter 2. |
---|
7 | The CBC Model Class |
---|
8 | </th><td width="20%" align="right"> <a accesskey="n" href="ch02s05.html">Next</a></td></tr></table><hr/></div><div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="gettingsolution"/> |
---|
9 | Getting Solution Information |
---|
10 | </h2></div></div><div/></div><p> |
---|
11 | Optimality can be checked through a call to <tt class="function">model.isProvenOptimal()</tt>. Also |
---|
12 | available are <tt class="function">isProvenInfeasible()</tt>, |
---|
13 | <tt class="function">isSolutionLimitReached()</tt>, |
---|
14 | <tt class="function">isNodeLimitReached()</tt> or the feared |
---|
15 | <tt class="function">isAbandoned()</tt>. There is also |
---|
16 | <tt class="function">int status()</tt> which returns 0 if finished (which includes the case when the algorithm is finished because it has been proved infeasible), 1 if stopped by user, and 2 if difficulties arose. |
---|
17 | </p><p> |
---|
18 | In addition to these <tt class="classname">CbcModel</tt> methods, solution values can be accessed via OSI methods. The OSI methods pick up the current solution in the <tt class="classname">CBCModel</tt>. The current solution will match the best solution found so far if called after <tt class="function">branchAndBound()</tt> and a solution was found. |
---|
19 | </p><div class="table"><a id="id2993738"/><p class="title"><b>Table 2.1. |
---|
20 | Methods for Getting Solution Information from OSI |
---|
21 | </b></p><table summary=" Methods for Getting Solution Information from OSI " border="0"><colgroup><col/><col/></colgroup><thead><tr><th> |
---|
22 | Purpose |
---|
23 | </th><th> |
---|
24 | Name |
---|
25 | </th><th> |
---|
26 | Notes |
---|
27 | </th></tr></thead><tbody><tr><td align="left" valign="top"> |
---|
28 | Primal column solution |
---|
29 | </td><td align="left" valign="top"><tt class="function">const double * getColSolution()</tt></td><td align="left" valign="top"> |
---|
30 | The OSI method will return the best solution found thus far, unless none has been found. It is safer to use <tt class="classname">CbcModel</tt> version, <tt class="function">CbcModel::bestSolution()</tt></td></tr><tr><td align="left" valign="top"> |
---|
31 | Dual row solution |
---|
32 | </td><td align="left" valign="top"><tt class="function">const double * getRowPrice()</tt></td><td align="left" valign="top"> |
---|
33 | Identical <tt class="classname">CbcModel</tt> version available, <tt class="function">CbcModel::getRowPrice()</tt>. |
---|
34 | </td></tr><tr><td align="left" valign="top"> |
---|
35 | Primal row solution |
---|
36 | </td><td align="left" valign="top"><tt class="function">const double * getRowActivity()</tt></td><td align="left" valign="top"> |
---|
37 | Identical <tt class="classname">CbcModel</tt> version available, <tt class="function">CbcModel::getRowActivity()</tt>. |
---|
38 | </td></tr><tr><td align="left" valign="top"> |
---|
39 | Dual column solution |
---|
40 | </td><td align="left" valign="top"><tt class="function">const double * getReducedCost()</tt></td><td align="left" valign="top"> |
---|
41 | Identical <tt class="classname">CbcModel</tt> version available, <tt class="function">CbcModel::gtReducedCost()</tt>. |
---|
42 | </td></tr><tr><td align="left" valign="top"> |
---|
43 | Number of rows in model |
---|
44 | </td><td align="left" valign="top"><tt class="function">int getNumRows()</tt></td><td align="left" valign="top"> |
---|
45 | Identical <tt class="classname">CbcModel</tt> version available, <tt class="function">CbcModel::getNumRows()</tt>. Note: the number of rows can change due to cuts. |
---|
46 | </td></tr><tr><td align="left" valign="top"> |
---|
47 | Number of columns in model |
---|
48 | </td><td align="left" valign="top"><tt class="function">int getNumCols()</tt></td><td align="left" valign="top"> |
---|
49 | Identical <tt class="classname">CbcModel</tt> version available, <tt class="function">CbcModel::getNumCols()</tt>. |
---|
50 | </td></tr></tbody></table></div></div><div class="navfooter"><hr/><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ch02s03.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="ch02.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="ch02s05.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top"> |
---|
51 | The Relationship Between OSI and CBC |
---|
52 | </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> |
---|
53 | Useful Set and Get Methods in CbcModel |
---|
54 | </td></tr></table></div></body></html> |
---|