1 | <?xml version="1.0" encoding="ISO-8859-1" standalone="no"?> |
---|
2 | <html xmlns="http://www.w3.org/1999/xhtml"><head><title> |
---|
3 | Useful Set and Get Methods in CbcModel |
---|
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="ch02s04.html" title=" Getting Solution Information "/><link rel="next" href="ch02s06.html" title=" Impacting the Solution Process "/></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center"> |
---|
5 | Useful Set and Get Methods in CbcModel |
---|
6 | </th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ch02s04.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="ch02s06.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="setsandgets"/> |
---|
9 | Useful Set and Get Methods in <tt class="classname">CbcModel</tt> |
---|
10 | </h2></div></div><div/></div><p> |
---|
11 | Most of the parameter setting in CBC is done through <tt class="classname">CbcModel</tt> methods. The most commonly used set and get methods are listed in <a href="ch02s05.html#setGet" title="Table 2.2. Useful Set and Get Methods in CbcModel">Table 2.2</a>. |
---|
12 | </p><div class="table"><a id="setGet"/><p class="title"><b>Table 2.2. Useful Set and Get Methods in <tt class="classname">CbcModel</tt></b></p><table summary="Useful Set and Get Methods in CbcModel" border="0"><colgroup><col/><col/></colgroup><thead><tr><th> |
---|
13 | Method(s) |
---|
14 | </th><th> |
---|
15 | Description |
---|
16 | </th></tr></thead><tbody><tr><td align="left" valign="top"><tt class="function">bool setMaximumNodes(int value)</tt><br/><tt class="function">int getMaximumNodes() const</tt><br/><tt class="function">bool setMaximumSeconds(double value)</tt><br/><tt class="function">double getMaximumSeconds()</tt><br/><tt class="function">bool setMaximumSolutions(double value)</tt><br/><tt class="function">double getMaximumSolutions() const</tt></td><td align="left" valign="top"> |
---|
17 | These set methods tell CBC to stop after a given number of nodes, |
---|
18 | seconds, or solutions is reached. The get methods return the corresponding values. |
---|
19 | </td></tr><tr><td align="left" valign="top"><tt class="function">bool setIntegerTolerance(double value) const</tt><br/><tt class="function">double getIntegerTolerance() const</tt></td><td align="left" valign="top"> |
---|
20 | An integer variable is deemed to be at an integral value if it is no further than this <i class="parameter"><tt>value</tt></i> (tolerance) away. |
---|
21 | </td></tr><tr><td align="left" valign="top"><tt class="function">bool setAllowableGap(double value)</tt><br/><tt class="function">double getAllowableGap() const</tt><br/><tt class="function">bool setAllowablePercentageGap(double value)</tt><br/><tt class="function">double getAllowablePercentageGap() const</tt><br/><tt class="function">bool setAllowableFractionGap(double value)</tt><br/><tt class="function">double getAllowableFractionGap() const</tt><br/></td><td align="left" valign="top"><tt class="classname">CbcModel</tt> returns if the gap between the best known solution and the best |
---|
22 | possible solution is less than this <i class="parameter"><tt>value</tt></i>, or as a percentage, or a fraction. |
---|
23 | </td></tr><tr><td align="left" valign="top"><tt class="function">void setNumberStrong(double value) </tt><br/><tt class="function">int numberStrong() |
---|
24 | <sup>[<a id="id2994473" href="#ftn.id2994473">a</a>]</sup> const </tt></td><td align="left" valign="top"> |
---|
25 | These methods set or get the maximum number of candidates at a node to |
---|
26 | be evaluated for strong branching. |
---|
27 | </td></tr><tr><td align="left" valign="top"><tt class="function">void setPrintFrequency(int value) </tt><br/><tt class="function">int printFrequency() const</tt></td><td align="left" valign="top"> |
---|
28 | Controls the number of nodes evaluated between status prints. |
---|
29 | Print frequency has a very slight overhead, if <i class="parameter"><tt>value</tt></i> is small. |
---|
30 | </td></tr><tr><td align="left" valign="top"><tt class="function">int getNodeCount() const</tt></td><td align="left" valign="top"> |
---|
31 | Returns number of nodes evaluated in the search. |
---|
32 | </td></tr><tr><td align="left" valign="top"><tt class="function">int numberRowsAtContinuous() const</tt></td><td align="left" valign="top"> |
---|
33 | Returns number of rows in the problem when handed to the solver (i.e., before cuts where added). Commonly used in implementing heuristics. |
---|
34 | </td></tr><tr><td align="left" valign="top"><tt class="function">int numberIntegers() const</tt><br/><tt class="function">const int * integerVariable() const</tt></td><td align="left" valign="top"> |
---|
35 | Returns number of integer variables and an array specifying them. |
---|
36 | </td></tr><tr><td align="left" valign="top"><tt class="function">bool isBinary(int colIndex) const</tt><br/><tt class="function">bool isContinuous(int colIndex) const</tt><br/><tt class="function">bool isInteger(int colIndex) const</tt></td><td align="left" valign="top"> |
---|
37 | Returns information on variable <i class="parameter"><tt>colIndex</tt></i>. OSI methods |
---|
38 | can be used to set these attributes (before handing the model to <tt class="classname">CbcModel</tt>). |
---|
39 | </td></tr><tr><td align="left" valign="top"><tt class="function">double getObjValue() const</tt></td><td align="left" valign="top"> |
---|
40 | This method returns the best objective value so far. |
---|
41 | </td></tr><tr><td align="left" valign="top"><tt class="function">double getCurrentObjValue() const</tt></td><td align="left" valign="top"> |
---|
42 | This method returns the current objective value. |
---|
43 | </td></tr><tr><td align="left" valign="top"><tt class="function">const double * getObjCoefficients() const</tt><br/></td><td align="left" valign="top"> |
---|
44 | This method return the objective coefficients. |
---|
45 | </td></tr><tr><td align="left" valign="top"><tt class="function">const double * getRowLower() const</tt><br/><tt class="function">const double * getRowUpper() const</tt><br/><tt class="function">const double * getColLower() const</tt><br/><tt class="function">const double * getColUpper() const</tt><br/></td><td align="left" valign="top"> |
---|
46 | These methods return the lower and upper bounds on row and column activities. |
---|
47 | </td></tr><tr><td align="left" valign="top"><tt class="function">const CoinPackedMatrix * getMatrixByRow() const</tt></td><td align="left" valign="top"> |
---|
48 | This method returns a pointer to a row copy of matrix stored as a |
---|
49 | <tt class="classname">CoinPackedMatrix</tt> which can be further examined. |
---|
50 | </td></tr><tr><td align="left" valign="top"><tt class="function">const CoinPackedMatrix * getMatrixByCol() const</tt></td><td align="left" valign="top"> |
---|
51 | This method returns a pointer to a column copy of matrix stored as a |
---|
52 | <tt class="classname">CoinPackedMatrix</tt> which can be further examined. |
---|
53 | </td></tr><tr><td align="left" valign="top"><tt class="function">CoinBigIndex getNumElements() const</tt><sup>[<a id="id2995026" href="#ftn.id2995026">b</a>]</sup></td><td align="left" valign="top"> |
---|
54 | Returns the number of nonzero elements in the problem matrix. |
---|
55 | </td></tr><tr><td align="left" valign="top"><tt class="function">void setObjSense(double value)</tt><br/><tt class="function">double getObjSense() const</tt></td><td align="left" valign="top"> |
---|
56 | These methods set and get the objective sense. The parameter |
---|
57 | <i class="parameter"><tt>value</tt></i> should be +1 to minimize and -1 to maximize. |
---|
58 | </td></tr></tbody><tbody class="footnotes"><tr><td colspan="2"><div class="footnote"><p><sup>[<a id="ftn.id2994473" href="#id2994473">a</a>] </sup> |
---|
59 | This methods (and some of the other) do not follow the "get" convention. The convention has changed over time and there are still some inconsistencies to be cleaned up. |
---|
60 | </p></div><div class="footnote"><p><sup>[<a id="ftn.id2995026" href="#id2995026">b</a>] </sup> |
---|
61 | <span class="type">CoinBigIndex</span> is a <tt class="function">typedef</tt> which in |
---|
62 | most cases is the same as <span class="type">int</span>. |
---|
63 | </p></div></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="ch02s04.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="ch02s06.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top"> |
---|
64 | Getting Solution Information |
---|
65 | </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> |
---|
66 | Impacting the Solution Process |
---|
67 | </td></tr></table></div></body></html> |
---|