source: html/trunk/Cbc/ch02s03.html @ 554

Last change on this file since 554 was 554, checked in by rlh, 16 years ago

initial import of Cbc documentation

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 4.5 KB
1<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>
2  Getting at the Solution (CbcModel methods)
3  </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. 
4  Basic Model Classes
5  "><link rel="previous" href="ch02s02.html" title="
6  First Example
7  "><link rel="next" href="ch02s04.html" title="Some Useful Set and Get Methods"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">
8  Getting at the Solution (CbcModel methods)
9  </th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ch02s02.html">Prev</a> </td><th width="60%" align="center">Chapter 2. 
10  Basic Model Classes
11  </th><td width="20%" align="right"> <a accesskey="n" href="ch02s04.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 name="gettingsolution"></a>
12  Getting at the Solution (CbcModel methods)
13  </h2></div></div><div></div></div><p>
14  The OSI way to check for optimality is to call model.isProvenOptimal().  Also
15  available are <tt class="function">isProvenInfeasible()</tt>,
16  <tt class="function">isSolutionLimitReached()</tt>,
17  <tt class="function">isNodeLimitReached()</tt> or the feared
18  <tt class="function">isAbandoned()</tt>. You can also pick up
19  <tt class="function">int status()</tt> which returns 0 if finished,
20   1 if stopped by user and 2 if difficulties. (status of 0 even if proved
21   infeasible)
22  </p><p>
23  Similarly, we can pick up the solution values.  The OSI methods pick up
24  the current solution.  This will match the best solution found so far if
25  called after branchAndBound and if a solution was found.
26  </p><div class="table"><a name="id2898257"></a><p class="title"><b>Table 2.3. 
27  Methods for getting solution information from OSI solver
28  </b></p><table summary="
29  Methods for getting solution information from OSI solver
30  " border="0"><colgroup><col><col></colgroup><thead><tr><th>
31      Purpose
32      </th><th>
33      Name
34      </th><th>
35      Notes
36      </th></tr></thead><tbody><tr><td align="left" valign="top">
37      Primal column solution
38      </td><td align="left" valign="top"><tt class="function">const double * getColSolution()</tt></td><td align="left" valign="top">
39      Outside CBC will be best solution unless none found.  Safer to use
40      CbcModel::bestSolution()
41      </td></tr><tr><td align="left" valign="top">
42      Dual row solution
43      </td><td align="left" valign="top"><tt class="function">const double * getRowPrice()</tt></td><td align="left" valign="top">
44      CbcModel:: version available and identical
45      </td></tr><tr><td align="left" valign="top">
46      Primal row solution
47      </td><td align="left" valign="top"><tt class="function">const double * getRowActivity()</tt></td><td align="left" valign="top">
48      CbcModel:: version available and identical
49      </td></tr><tr><td align="left" valign="top">
50      Dual column solution
51      </td><td align="left" valign="top"><tt class="function">const double * getReducedCost()</tt></td><td align="left" valign="top"> </td></tr><tr><td align="left" valign="top">
52      Number of rows in model
53      </td><td align="left" valign="top"><tt class="function">int getNumRows()</tt></td><td align="left" valign="top">
54      CbcModel:: version available and identical
55      (but note that number of rows may change due to cuts)
56      </td></tr><tr><td align="left" valign="top">
57      Number of columns in model
58      </td><td align="left" valign="top"><tt class="function">int getNumCols()</tt></td><td align="left" valign="top">
59      CbcModel:: version available and identical
60      </td></tr></tbody></table></div><p>
61  The remainder of this chapter will show  more of the basic CBC tasks a user
62  might wish to perform.
63  </p></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ch02s02.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="ch02s04.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">
64  First Example
65   </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> Some Useful Set and Get Methods</td></tr></table></div></body></html>
Note: See TracBrowser for help on using the repository browser.