source: trunk/Docs/cbcmodelclass.xml @ 113

Last change on this file since 113 was 113, checked in by rlh, 15 years ago

* empty log message *

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 26.5 KB
Line 
1<?xml version="1.0" encoding="ISO-8859-1"?>
2  <chapter id="cbcmodelclass">
3  <title>
4  Basic Model Classes
5  </title>
6  <section id="hierarchy">
7  <title>
8  Hierarchy and list of classes
9  </title>
10  <para>
11  The class that controls CBC is <classname>CbcModel</classname>.  This class is where most
12  of the parameter setting is done. The absolute minimum number of actions for <classname>CbcModel</classname> is two:
13
14    <itemizedlist>
15    <listitem>
16    <simpara>
17    <function>CbcModel(OsiSolverInterface &amp; linearSolver)</function> as constructor, and
18    </simpara>
19    </listitem>
20    <listitem>
21    <simpara>
22    <function>branchAndBound()</function> for solving the problem.   
23    </simpara>
24    </listitem>
25    </itemizedlist>
26  </para>
27
28<para>
29<classname>CbcModel</classname> uses other classes, some of which are virtual and may have multiple instances. Details on the more useful classes used by <classname>CbcModel</classname> will be given later. <!-- where? --> The two tables below list the classes within <classname>CbcModel</classname> that are of most interest and of least interest.
30</para>
31    <table frame="none">
32  <title>Classes Used by CbcModel - Most Useful</title>
33    <tgroup cols="3">
34    <thead>
35    <row>
36    <entry>
37    Class name
38    </entry>
39    <entry>
40    Description
41    </entry>
42    <entry>
43    Notes
44    </entry>
45    </row>
46    </thead>
47    <tbody>
48    <row>
49      <entry align="left" valign="top">
50      <classname>CbcCompareBase</classname>
51      </entry>
52      <entry align="left" valign="top">
53      Controls which node on tree is selected
54      </entry>
55      <entry align="left" valign="top">
56      The default is <classname>CbcCompareDefault</classname>. Other comparison classes in <filename>CbcCompareActual.hpp</filename> include
57      <classname>CbcCompareDepth</classname> and <classname>CbcCompareObjective</classname>. It is very easy for user to
58      experiment with different comparisons.
59      </entry>
60    </row>
61    <row>
62      <entry align="left" valign="top">
63      <classname>CbcCutGenerator</classname>
64      </entry>
65      <entry align="left" valign="top">
66      A wrapper for <classname>CglCutGenerator</classname> with additional data to control when the cut generator is used.
67      </entry>
68      <entry align="left" valign="top">
69      Other than knowing how to add a cut generator to <classname>CbcModel</classname>, there is not much the average user needs to know about this class. <!-- what's the default? -->
70      </entry>
71    </row>
72    <row>
73      <entry align="left" valign="top">
74      <classname>CbcHeuristic</classname>
75      </entry>
76      <entry align="left" valign="top">
77      Heuristic that attempts to generate valid solutions
78      </entry>
79      <entry align="left" valign="top">
80      Users can get a lot of value out of coding specialized heuristics.  There can be
81      as many different heuristics as you like. <!-- What's the default? -->
82      </entry>
83    </row>
84    <row>
85      <entry align="left" valign="top">
86      <classname>CbcObject</classname>
87      </entry>
88      <entry align="left" valign="top">
89      Defines what it means for a variable to be satisfied.
90      </entry>
91      <entry align="left" valign="top">
92      Virtual class. The branching model used in CBC is based on the idea of an "object". An object has (i) feasible region, (ii) can be evaluated for infeaibility, (iii) can be branched on, e.g., a method of generating a branching object, which defines an up branch and a down branch and (iv) allows comparsion of the effect of branching. Instances include simple integer, simple integer with pseudocosts, SOS (type 1 and 2), and lotsizing (see CbcBranch....hpp).
93      </entry>
94    </row>
95    <row>
96      <entry align="left" valign="top">
97      <classname>OsiSolverInterface</classname>
98      </entry>
99      <entry align="left" valign="top">
100      Defines the LP solver being used and the LP model. Normally
101      a pointer to the desired <classname>OsiSolverInteface</classname> is passed to <classname>CbcModel</classname> before branch and cut.
102      </entry>
103      <entry align="left" valign="top">
104      Virtual class. The user instantiates the solver interface of their choice, e.g.,
105      <classname>OsiClpSolverInterface</classname>.
106      </entry>
107    </row>
108    </tbody>
109  </tgroup>
110  </table>
111
112There is not much in these classes the average user needs to know about.
113    <table frame="none">
114  <title>Classes Used by CbcModel - Least Useful</title>
115    <tgroup cols="3">
116    <thead>
117    <row>
118    <entry>
119    Class name
120    </entry>
121    <entry>
122    Description
123    </entry>
124    <entry>
125    Notes
126    </entry>
127    </row>
128    </thead>
129    <tbody>
130    <row>
131      <entry align="left" valign="top">
132      <classname>CbcBranchDecision</classname>
133      </entry>
134      <entry align="left" valign="top">
135      Used in choosing which variable to branch on, however, most of
136      the work is done by the definitions in <classname>CbcObject</classname>.
137      </entry>
138      <entry align="left" valign="top">
139      Defaults to <classname>CbcBranchDefaultDecision</classname>.
140      </entry>
141    </row>
142    <row>
143      <entry align="left" valign="top">
144      <classname>CbcCountRowCut</classname>
145      </entry>
146      <entry align="left" valign="top">
147      Interface to <classname>OsiRowCut</classname>. It counts the usage so cuts can gracefully vanish.
148      </entry>
149      <entry align="left" valign="top">
150      See <classname>OsiRowCut</classname> for more details. <!-- Default? -->
151      </entry>
152    </row>
153    <row>
154      <entry align="left" valign="top">
155      <classname>CbcNode</classname>
156      </entry>
157      <entry align="left" valign="top">
158      Controls which variable/entity is selected to be branch on.
159      </entry>
160      <entry align="left" valign="top">
161      Controlled via <classname>CbcModel</classname> parameters.  <!-- Default? -->
162      </entry>
163    </row>
164    <row>
165      <entry align="left" valign="top">
166      <classname>CbcNodeInfo</classname>
167      </entry>
168      <entry align="left" valign="top">
169      Contains data on bounds, basis, etc. for one node of the search tree.
170      </entry>
171      <entry align="left" valign="top">
172      Header is located in <filename>CbcNode.hpp</filename>. <!-- Defaults? -->
173      </entry>
174    </row>
175    <row>
176      <entry align="left" valign="top">
177      <classname>CbcTree</classname>
178      </entry>
179      <entry align="left" valign="top">
180      Defines how the search tree is stored.
181      </entry>
182      <entry align="left" valign="top">
183      This class can be changed but it is not likely to be modified.<!-- Defaults? -->
184      </entry>
185    </row>
186    <row>
187      <entry align="left" valign="top">
188      <classname>CoinMessageHandler</classname>
189      </entry>
190      <entry align="left" valign="top">
191      Deals with message handling
192      </entry>
193      <entry align="left" valign="top">
194      The user can inherit from <classname>CoinMessageHandler</classname> to specialize message handling. 
195      <!-- Defaults? -->
196      </entry>
197    </row>
198    <row>
199      <entry align="left" valign="top">
200      <classname>CoinWarmStartBasis</classname>
201      </entry>
202      <entry align="left" valign="top">
203      Basis representation to be used by solver
204      </entry>
205      <entry align="left" valign="top">
206      <!-- Defaults? -->
207      </entry>
208    </row>
209    </tbody>
210  </tgroup>
211  </table>
212  </section>
213
214  <section id="firstexample">
215  <title>
216  First Example
217  </title>
218  <para>
219  Below is our first CBC sample program.  It is short enough to present in full.
220  This code can be found in the CBC Samples directory, see
221  <xref linkend="moreexamples"/>.  Most of the remaining examples in this Guide
222  will take the form of small code fragments.
223  </para>
224  <example>
225  <title>minimum.cpp</title>
226  <programlisting>
227  <![CDATA[ 
228// Copyright (C) 2005, International Business Machines
229// Corporation and others.  All Rights Reserved.
230
231#include "CbcModel.hpp"
232
233// Using CLP as the solver
234#include "OsiClpSolverInterface.hpp"
235
236int main (int argc, const char *argv[])
237{
238  OsiClpSolverInterface solver1;
239
240  // Read in example model in MPS file format
241  // and assert that it is a clean model
242  int numMpsReadErrors = solver1.readMps("../../Mps/Sample/p0033.mps","");
243  assert(numMpsReadErrors==0);
244
245  // Pass the solver (with the problem data) to CbcModel
246  CbcModel model(solver1);
247
248  // Do complete search
249  model.branchAndBound();
250
251  /* Print the solution.  CbcModel clones solver so we
252     need to get current copy from the CbcModel */
253  int numberColumns = model.solver()->getNumCols();
254   
255  const double * solution = model.solver()->getColSolution();
256   
257  for (int iColumn=0;iColumn<numberColumns;iColumn++) {
258    double value=solution[iColumn];
259    if (fabs(value)>1.0e-7&&model.solver()->isInteger(iColumn))
260      printf("%d has value %g\n",iColumn,value);
261   }
262  return 0;
263}   
264  ]]>   
265  </programlisting>
266  </example>
267  <!-- Clone comment  needs more explaination. What info is safe? When do you need to do a refresh?? -->
268  <!-- printf vs cout  -->
269
270  <para>
271  This sample program creates a <classname>OsiClpSolverInterface</classname> solver interface,
272  and reads an MPS file. If there are no errors, the program passes the solver to <classname>CbcModel</classname>
273  which solves it  using the branch-and-bound algorithm.  The part of the program which solves the problem
274  is very small (one line!) but before that one line, the LP solver had to be created and populated with data and
275  after that one line the results were printed out.
276 </para>
277
278<para> 
279  This example illustrates the dependency of CBC on 
280  the <classname>OsiSolverInterface</classname> methods.
281  All the OSI methods used in <filename>minimum.cpp</filename> have identical methods in <classname>CbcModel</classname>. <!-- why? --> 
282  But there are many methods in OSI which are not present in CBC. For example, suppose the program produces a lot of out  put so one might add
283</para>
284<programlisting>
285  model.solver()->setHintParam(OsiDoReducePrint,true,OsiHintTry);
286</programlisting>
287<para> 
288  <!-- model.solver() returns an OSISolverInterface? -->
289  to reduce the amount. That improves things a lot but we still get one message per node
290  so we could add
291</para>
292  <programlisting>
293   model.setLogLevel(1);
294  </programlisting>
295<para> 
296  The following section gives many of the ways of getting information from the
297  model or underlying solver.
298  </para>
299  </section>
300  <section id="gettingsolution">
301  <title>
302  Getting at the Solution (<classname>CbcModel</classname> methods)
303  </title>
304  <para>
305  The OSI way to check for optimality is to call <function>model.isProvenOptimal()</function>.  Also
306  available are <function>isProvenInfeasible()</function>,
307  <function>isSolutionLimitReached()</function>,
308  <function>isNodeLimitReached()</function> or the feared
309  <function>isAbandoned()</function>. You can also pick up
310  <function>int&nbsp;status()</function> which returns 0 if finished,
311   1 if stopped by user and 2 if difficulties. (status of 0 even if proved
312   infeasible)
313  </para>
314  <para>
315  Similarly, we can pick up the solution values.  The OSI methods pick up
316  the current solution.  This will match the best solution found so far if
317  called after <function>branchAndBound()</function> and if a solution was found.
318  </para>
319  <table frame="none">
320  <title>
321  Methods for getting solution information from OSI
322  </title>
323  <tgroup cols="2">
324  <thead>
325    <row>
326      <entry>
327      Purpose
328      </entry>
329      <entry>
330      Name
331      </entry>
332      <entry>
333      Notes
334      </entry>
335    </row>
336  </thead>
337  <tbody>
338    <row>
339      <entry align="left" valign="top">
340      Primal column solution
341      </entry>
342      <entry align="left" valign="top">
343      <function>const double * getColSolution()</function>
344      </entry>
345      <entry align="left" valign="top">
346      Outside <classname>CbcModel</classname> will be best solution unless none found.  Safer to use <classname>CbcModel</classname> version,
347      <function>CbcModel::bestSolution()</function>
348      </entry>
349    </row>
350    <row>
351      <entry align="left" valign="top">
352      Dual row solution
353      </entry>
354      <entry align="left" valign="top">
355      <function>const double * getRowPrice()</function>
356      </entry>
357      <entry align="left" valign="top">
358      Identical <classname>CbcModel</classname> version available, <function>CbcModel::getRowPrice()</function>.
359      </entry>
360    </row>
361    <row>
362      <entry align="left" valign="top">
363      Primal row solution
364      </entry>
365      <entry align="left" valign="top">
366      <function>const double * getRowActivity()</function>
367      </entry>
368      <entry align="left" valign="top">
369      Identical <classname>CbcModel</classname> version available, <function>CbcModel::getRowActivity()</function>.
370      </entry>
371    </row>
372    <row>
373      <entry align="left" valign="top">
374      Dual column solution
375      </entry>
376      <entry align="left" valign="top">
377      <function>const double * getReducedCost()</function>
378      </entry>
379     <entry align="left" valign="top">
380      Identical <classname>CbcModel</classname> version available, <function>CbcModel::gtReducedCost()</function>.
381      </entry>
382    </row>
383    <row>
384      <entry align="left" valign="top">
385      Number of rows in model
386      </entry>
387      <entry align="left" valign="top">
388      <function>int getNumRows()</function>
389      </entry>
390      <entry align="left" valign="top">
391      Identical <classname>CbcModel</classname> version available, <function>CbcModel::getNumRows()</function>, but note that the number of rows may change due to cuts.
392      </entry>
393    </row>
394    <row>
395      <entry align="left" valign="top">
396      Number of columns in model
397      </entry>
398      <entry align="left" valign="top">
399      <function>int getNumCols()</function>
400      </entry>
401      <entry align="left" valign="top">
402      Identical <classname>CbcModel</classname> version available, <function>CbcModel::getNumCols()</function>.
403      </entry>
404    </row>
405  </tbody>
406  </tgroup>
407  </table>
408  <para>
409  The remainder of this chapter will show more of the basic CBC tasks a user
410  might wish to perform.
411  </para>
412  </section>
413
414  <section id="setsandgets">
415  <title>Useful Set and Get Methods</title>
416  <table frame="none">
417  <title>Useful Set and Get Methods</title>
418    <tgroup cols="2">
419    <thead>
420    <row>
421    <entry>
422    Method(s)
423    </entry>
424    <entry>
425    Description
426    </entry>
427    </row>
428    </thead>
429    <tbody>
430    <row>
431      <entry align="left" valign="top">
432      <function>bool&nbsp;setMaximumNodes(int value)</function><sbr/>
433      <function>int&nbsp;getMaximumNodes() const</function><sbr/>
434      <function>bool&nbsp;setMaximumSeconds(double value)</function><sbr/>
435
436      <function>double&nbsp;getMaximumSeconds()</function><sbr/>
437      <function>bool&nbsp;setMaximumSolutions(double value)</function><sbr/>
438      <function>double&nbsp;getMaximumSolutions() const</function>
439      </entry>
440      <entry align="left" valign="top">
441      These methods tell CBC to stop after a given number of nodes or
442      seconds or solutions (and returns these values).
443      </entry>
444    </row>
445    <row>
446      <entry align="left" valign="top">
447      <function>bool&nbsp;setIntegerTolerance(double value) const</function><sbr/>
448      <function>double&nbsp;getIntegerTolerance() const</function>
449      </entry>
450      <entry align="left" valign="top">
451      An integer variable
452      is deemed to be at an integral value if it is no further than this tolerance
453      away.
454      </entry>
455    </row>
456    <row>
457      <entry align="left" valign="top">
458      <function>bool&nbsp;setAllowableGap(double value)</function><sbr/>
459      <function>double&nbsp;getAllowableGap() const</function><sbr/>
460      <function>bool&nbsp;setAllowablePercentageGap(double value)</function><sbr/>
461      <function>double&nbsp;getAllowablePercentageGap() const</function><sbr/>
462      <function>bool&nbsp;setAllowableFractionGap(double value)</function><sbr/>
463      <function>double&nbsp;getAllowableFractionGap() const</function><sbr/>
464      </entry>
465      <entry align="left" valign="top">
466      <classname>CbcModel</classname> returns if the gap between the best known solution and the best
467      possible solution is less than this (or as a percentage or fraction).
468      </entry>
469    </row>
470    <row>
471      <entry align="left" valign="top">
472      <function>void&nbsp;setNumberStrong(double value) </function><sbr/>
473      <function>int&nbsp;numberStrong() const </function>
474      </entry>
475      <entry align="left" valign="top">
476      Get or set the maximum number of candidates at a node to
477      be evaluated for strong branching.
478      </entry>
479    </row>
480    <row>
481      <entry align="left" valign="top">
482      <function>void&nbsp;setPrintFrequency(int value) </function><sbr/>
483      <function>int&nbsp;printFrequency() const</function>
484      </entry>
485      <entry align="left" valign="top">
486      Controls the number of nodes evaluated between status prints.
487      Print frequency has very slight overhead if small.
488      </entry>
489    </row>
490    <row>
491      <entry align="left" valign="top">
492      <function>int&nbsp;getNodeCount() const</function>
493      </entry>
494      <entry align="left" valign="top">
495      Returns number of nodes search took
496      </entry>
497    </row>
498    <row>
499      <entry align="left" valign="top">
500      <function>int&nbsp;numberRowsAtContinuous() const</function>
501      </entry>
502      <entry align="left" valign="top">
503      Returns number of rows at continuous
504      </entry>
505    </row>
506    <row>
507      <entry align="left" valign="top">
508      <function>int &nbsp;numberIntegers() const</function><sbr/>
509      <function>const int&nbsp;*&nbsp;integerVariable() const</function>
510      </entry>
511      <entry align="left" valign="top">
512      Returns number of integers and an array giving which ones
513      </entry>
514    </row>
515    <row>
516      <entry align="left" valign="top">
517      <function>bool&nbsp;isBinary(int colIndex) const</function><sbr/>
518      <function>bool&nbsp;isContinuous(int colIndex) const</function><sbr/>
519      <function>bool&nbsp;isInteger(int colIndex) const</function>
520      </entry>
521      <entry align="left" valign="top">
522      Returns information on a variable.  You can use OSI methods
523      to set these attributes (before handing to <classname>CbcModel</classname>)
524      </entry>
525    </row>
526    <row>
527      <entry align="left" valign="top">
528      <function>double&nbsp;getObjValue() const</function>
529      </entry>
530      <entry align="left" valign="top">
531      This method returns the best objective value so far.
532      </entry>
533    </row>
534    <row>
535      <entry align="left" valign="top">
536      <function>double&nbsp;getCurrentObjValue() const</function>
537      </entry>
538      <entry align="left" valign="top">
539      This method returns the current objective value.
540      </entry>
541    </row>
542    <row>
543      <entry align="left" valign="top">
544      <function>const&nbsp;double&nbsp;*&nbsp;getObjCoefficients() const</function><sbr/>
545    <!--  <function>double&nbsp;*&nbsp;objective()</function> where? -->
546      </entry>
547      <entry align="left" valign="top">
548      This method return the objective coefficients.
549      </entry>
550    </row>
551    <row>
552      <entry align="left" valign="top">
553      <function>const&nbsp;double&nbsp;*&nbsp;getRowLower() const</function><sbr/>
554    <!--  <function>double&nbsp;*&nbsp;rowLower()</function><sbr/> where? -->
555      <function>const&nbsp;double&nbsp;*&nbsp;getRowUpper() const</function><sbr/>
556   <!--  <function>double&nbsp;*&nbsp;rowUpper()</function><sbr/> where? -->
557      <function>const&nbsp;double&nbsp;*&nbsp;getColLower() const</function><sbr/>
558   <!--  <function>double&nbsp;*&nbsp;columnLower()</function><sbr/> where? -->
559      <function>const&nbsp;double&nbsp;*&nbsp;getColUpper() const</function><sbr/>
560    <!--  <function>double&nbsp;*&nbsp;columnUpper()</function> where? -->
561      </entry>
562      <entry align="left" valign="top">
563      These methods give lower and upper bounds on row and column activities.
564      </entry>
565    </row>
566    <row>
567      <entry align="left" valign="top">
568      <function>const&nbsp;CoinPackMatrix&nbsp;*&nbsp;getMatrixByRow() const</function>
569      </entry>
570      <entry align="left" valign="top">
571      This method returns a pointer to a row copy of matrix
572      <classname>CoinPackedMatrix</classname> which can be further examined.
573      </entry>
574    </row>
575    <row>
576      <entry align="left" valign="top">
577      <function>const CoinPackMatrix * getMatrixByCol() const</function>
578      </entry>
579      <entry align="left" valign="top">
580      This method returns a pointer to a column copy of matrix
581      <classname>CoinPackedMatrix</classname> which can be further examined.
582      </entry>
583    </row>
584    <row>
585      <entry align="left" valign="top">
586      <function>int&nbsp;getNumElements() const</function>
587<!--  <function>CoinBigIndex&nbsp;getNumElements() const</function> what? -->
588<!--     <footnote> -->
589<!--      <para> -->
590<!--    <type>CoinBigIndex</type> is a <function>typedef</function> which in -->
591<!--    most cases is the same as <type>int</type>. -->
592<!--    </para> -->
593<!--    </footnote> -->
594      </entry>
595      <entry align="left" valign="top">
596      Returns the number of elements in the problem matrix.
597      </entry>
598    </row>
599    <row>
600      <entry align="left" valign="top">
601      <function>void setObjSense(double&nbsp;value)</function><sbr/>
602      <function>double getObjSense() const</function> 
603      </entry>
604      <entry align="left" valign="top">
605      These methods set and get the objective sense.  The parameter
606      <parameter>value</parameter> should be +1 to minimize and -1 to maximize.
607      </entry>
608    </row>
609    </tbody>
610  </tgroup>
611  </table>
612  </section>
613  <section id="majormethods">
614  <title>
615  Methods which have a Major Impact on Solution Process
616  </title>
617  <para>
618  These are important methods which will impact search e.g, adding a cut
619  generator.  The description here may not give all parameters if they are exotic.
620  More details can be found under the class description column in Table Major Methods.
621  </para>
622  <table frame="none">
623  <title>Major Methods</title>
624    <tgroup cols="2">
625    <thead>
626    <row>
627    <entry>
628    Method(s)
629    </entry>
630    <entry>
631    Description
632    </entry>
633    </row>
634    </thead>
635    <tbody>
636    <row>
637      <entry align="left" valign="top">
638      <function>passInPriorities(const int * priorities, bool ifNotSimpleIntegers,
639                        int defaultValue=1000)</function>
640      </entry>
641      <entry align="left" valign="top">
642      Normally this is a list of priorities (1 being highest) and the other
643      <parameter>ifNotSimpleIntegers</parameter> being false which set priorities for all integer
644      variables.  If two variables are unsatisfied and one has a higher priority
645      then it is always preferred whatever its value.  This can be very powerful
646      but also see PseudoCosts in <classname>CbcObject</classname> discussion.
647      </entry>
648    </row>
649    <row>
650      <entry align="left" valign="top">
651      <function>addCutGenerator(CglCutGenerator *,int howOften, const char * name)</function>
652      </entry>
653      <entry align="left" valign="top">
654      This is used to add a cut generator to <classname>CbcModel</classname>.  Any cut generator in CGL can be used. If <parameter>howOften</parameter> &gt; 0 then <parameter>name</parameter> will be called at root node and again every <parameter>howOften</parameter> nodes. There is an option to override and to call <parameter>name</parameter> depth 0,k,2k, etc.  If <parameter>howOften</parameter> = -1 then the code determines how effective <parameter>name</parameter>is at root node and dynamically sets <parameter>howOften</parameter>. If <parameter>howOften</parameter> = -99 then <parameter>name></parameter> is just used at root node.
655      There is also a redundant <parameter>howOften</parameter> = -100 setting which switches <parameter>name</parameter> off. This parameter setting is useful for testing.  For usage see <filename>sample2.cpp</filename> in the <filename>COIN/Cbc/Samples</filename> directory <xref linkend="moreexamples"/> which uses the most common cut generators.
656      </entry>
657    </row>
658    <row>
659      <entry align="left" valign="top">
660      <function>addHeuristic(CbcHeuristic *)</function>
661      </entry>
662      <entry align="left" valign="top">
663      This adds one heuristic to <classname>CbcModel</classname>.See the section on <classname>CbcHeuristic</classname>  to obtain
664      a list of available heuristics and a guide as to building new ones.
665      </entry>
666    </row>
667    <row>
668      <entry align="left" valign="top">
669      <function>addObjects(int&nbsp;number,CbcObject&nbsp;**&nbsp;objects) </function>
670      </entry>
671      <entry align="left" valign="top">
672      This adds members of the base class <classname>CbcObject</classname> to <classname>CbcModel</classname>.  See the section
673      on <classname>CbcObject</classname> for detailed nformation.  The <parameter>objects</parameter> are cloned by the code so the
674      user should delete them after the call to <function>addObjects</function>.  There are two
675      main cases.  The first is when the originally created objects are left and
676      new ones added (maybe with a higher priority);  this might be used when
677      simple integer objects exist and Special Ordered Sets of type 1 are going
678      to be added, which while not necessary will give extra power in branching.
679      The second case is when the old ones are being deleted. 
680      For usage see <filename>sos.cpp</filename> in the <filename>COIN/Cbc/Samples</filename> directory <xref linkend="moreexamples"/>.
681      </entry>
682    </row>
683    <row>
684      <entry align="left" valign="top">
685      <function>CglPreProcess::preProcess(OsiSolverInterface &amp;)</function>
686      </entry>
687      <entry align="left" valign="top">
688      This is not really part of CBC and can be used by other mixed integer
689      solvers but it can be a useful tool.  It tries to fix variables and
690      strengthen coefficients and also do a normal presolve.  Owing to the
691      odd nature of integer programming it may not always reduce the time
692      taken but is definitely worth trying.  For an example of using
693      <function>CglPreProcess()</function> (and <function>CglPostProcess()</function>) see <filename>sample2.cpp</filename> in the CBC Samples
694      directory <xref linkend="moreexamples"/>.
695      </entry>
696    </row>
697    <row>
698      <entry align="left" valign="top">
699      <function>setNodeComparison(CbcCompareBase&nbsp;*)</function>
700      </entry>
701      <entry align="left" valign="top">
702       This is used to invoke a non-default node comparisons
703       in determining the next node on tree to explore. The order a tree is explored
704       can make a large difference in runtime. Specialized comparisons are easy to implement.
705       See the section on <classname>CbcCompare</classname>.
706      </entry>
707    </row>
708    </tbody>
709  </tgroup>
710  </table>
711  </section>
712  </chapter>
Note: See TracBrowser for help on using the repository browser.