source: html/trunk/Clp/userguide/clpuserguide.html @ 974

Last change on this file since 974 was 974, checked in by jpfasano, 15 years ago
  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 105.5 KB
Line 
1<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>CLP User Guide</title><meta name="generator" content="DocBook XSL Stylesheets V1.66.1"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="book" lang="en"><div class="titlepage"><div><div><h1 class="title"><a name="clpuserguide"></a>CLP User Guide</h1></div><div><div class="authorgroup"><div class="author"><h3 class="author"><span class="firstname">
2    John
3    </span> <span class="surname">
4    Forrest
5    </span></h3><div class="affiliation"><span class="orgname">
6      IBM Research
7      <br></span></div><tt class="email">&lt;<a href="mailto:jjforre%20at%20us%20dot%20ibm%20dot%20com">jjforre at us dot ibm dot com</a>&gt;</tt></div><div class="author"><h3 class="author"><span class="firstname">
8    David
9    </span> <span class="surname">
10    de la Nuez
11    </span></h3><div class="affiliation"><span class="orgname">
12      Columbia University &amp; IBM Research
13      <br></span></div><tt class="email">&lt;<a href="mailto:dmd57%20at%20columbia%20dot%20edu">dmd57 at columbia dot edu</a>&gt;</tt></div><div class="author"><h3 class="author"><span class="firstname">
14    Robin
15    </span> <span class="surname">
16    Lougee-Heimer
17    </span></h3><div class="affiliation"><span class="orgname">
18      IBM Research
19      <br></span></div><tt class="email">&lt;<a href="mailto:robinlh%20at%20us%20dot%20ibm%20dot%20com">robinlh at us dot ibm dot com</a>&gt;</tt></div></div></div><div><p class="copyright">Copyright © 2004 IBM Coportation</p></div><div><div class="legalnotice"><a name="id4689599"></a>
20CLP and this documentation are provided under the terms of the
21<a href="http://opensource.org/licenses/cpl.php" target="_top">Common Public License
22 ("CPL")</a>.  Any use, reproduction or distribution of the programs constitutes
23the recipient's acceptance of the license.  The
24<a href="http://opensource.org/licenses/cpl.php" target="_top">CPL</a> is approved by
25the <a href="http://opensource.org/" target="_top">Open Source Initiative</a>.  IBM
26Corporation, the author of the
27<a href="http://opensource.org/licenses/cpl.php" target="_top">CPL</a>, has a
28<a href="http://www.ibm.com/developerworks/library/os-cplfaq.html" target="_top">
29CPL FAQ</a> available which is based on IBM's understanding of the
30<a href="http://opensource.org/licenses/cpl.php" target="_top">CPL</a>.
31</div></div></div><hr></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="chapter"><a href="#intro">1.
32    Introduction
33  </a></span></dt><dd><dl><dt><span class="section"><a href="#id4688972">
34  Welcome to CLP!
35  </a></span></dt><dt><span class="section"><a href="#id4689382">
36  Prerequisites
37  </a></span></dt></dl></dd><dt><span class="chapter"><a href="#basicmodelclasses">2.
38  Basic Model Classes
39  </a></span></dt><dd><dl><dt><span class="section"><a href="#hierarchy">
40  Hierarchy
41  </a></span></dt><dt><span class="section"><a href="#firstexample">
42  First Example
43  </a></span></dt><dt><span class="section"><a href="#gettingsolution">
44  Getting at the Solution
45  </a></span></dt><dt><span class="section"><a href="#buildandmodify">
46  Building and Modifying a Model
47  </a></span></dt><dt><span class="section"><a href="#tolerances">Tolerances</a></span></dt><dt><span class="section"><a href="#setsandgets">Some Useful Set and Get Methods</a></span></dt><dt><span class="section"><a href="#simplexspecific">
48  Simplex-specific Methods
49  </a></span></dt><dt><span class="section"><a href="#presolve">
50  Presolve
51  </a></span></dt><dt><span class="section"><a href="#statusarray">Status Array</a></span></dt></dl></dd><dt><span class="chapter"><a href="#notsobasic">3.
52  Not-Quite-So-Basic Model Classes
53  </a></span></dt><dd><dl><dt><span class="section"><a href="#pivotchoices">Pivot Choices</a></span></dt><dt><span class="section"><a href="#matrixclasses">Matrix Classes</a></span></dt><dt><span class="section"><a href="#messagehandling">Message Handling</a></span></dt></dl></dd><dt><span class="chapter"><a href="#moreexamples">4.
54More Samples
55</a></span></dt><dd><dl><dt><span class="section"><a href="#id4757090">CLP's Samples Directory</a></span></dt><dd><dl><dt><span class="section"><a href="#minimumcppdesc">minimum.cpp</a></span></dt><dt><span class="section"><a href="#defaultscppdesc">defaults.cpp</a></span></dt><dt><span class="section"><a href="#drivercppdesc">driver.cpp</a></span></dt><dt><span class="section"><a href="#networkcppdesc">network.cpp</a></span></dt><dt><span class="section"><a href="#testbarriercppdesc">testBarrier.cpp</a></span></dt><dt><span class="section"><a href="#id4758374">dualCuts.cpp</a></span></dt><dt><span class="section"><a href="#id4758398">decompose.cpp</a></span></dt><dt><span class="section"><a href="#id4758414">driver2.cpp</a></span></dt></dl></dd><dt><span class="section"><a href="#id4758428">Common CLP Tasks in the Samples</a></span></dt></dl></dd><dt><span class="chapter"><a href="#clpexe">5.
56  The CLP Executable
57  </a></span></dt><dd><dl><dt><span class="section"><a href="#id4760280">Quick Start</a></span></dt><dt><span class="section"><a href="#id4760804">
58  Online Help and Basic Usage
59  </a></span></dt><dt><span class="section"><a href="#id4760964">A Sample Session</a></span></dt></dl></dd><dt><span class="chapter"><a href="#messages">6.
60  Messages
61  </a></span></dt><dt><span class="appendix"><a href="#id4766717">A. FAQ</a></span></dt><dt><span class="appendix"><a href="#doxygen">B. Doxygen</a></span></dt><dt><span class="appendix"><a href="#id4768638">C. Revision History</a></span></dt></dl></div><div class="list-of-tables"><p><b>List of Tables</b></p><dl><dt>2.1. <a href="#id4752818">
62  Methods for getting solution information
63  </a></dt><dt>2.2. <a href="#id4753335">Some Useful Set and Get Methods</a></dt><dt>2.3. <a href="#id4753729">Common Simplex-specific methods</a></dt><dt>2.4. <a href="#id4754207">Possible states of a variable</a></dt><dt>4.1. <a href="#id4756483">Basic Samples</a></dt><dt>4.2. <a href="#id4757680">Advanced Samples</a></dt><dt>4.3. <a href="#id4757910">Unsupported Samples</a></dt><dt>4.4. <a href="#id4758440">Contents of the Samples directory</a></dt><dt>5.1. <a href="#id4760816">Command examples for the clp executable</a></dt><dt>6.1. <a href="#id4760092">
64  COIN Messages passed at or above logging level 1
65  </a></dt><dt>6.2. <a href="#id4762574">
66  CLP Messages passed at or above logging level 1
67  </a></dt><dt>6.3. <a href="#id4763258">
68  COIN Messages passed at or above logging level 0
69  </a></dt><dt>6.4. <a href="#id4764037">
70  CLP Messages passed at or above logging level 0
71  </a></dt></dl></div><div class="list-of-examples"><p><b>List of Examples</b></p><dl><dt>2.1. <a href="#id4752674">minimum.cpp</a></dt><dt>2.2. <a href="#id4753111">
72  Possible extension of minimum.cpp
73  </a></dt><dt>2.3. <a href="#presolveexample">Presolve code fragment</a></dt><dt>3.1. <a href="#id4756901">Sophisticated message handling</a></dt></dl></div><div class="chapter" lang="en"><div class="titlepage"><div><div><h2 class="title"><a name="intro"></a>Chapter 1. 
74    Introduction
75  </h2></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="section"><a href="#id4688972">
76  Welcome to CLP!
77  </a></span></dt><dt><span class="section"><a href="#id4689382">
78  Prerequisites
79  </a></span></dt></dl></div><div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id4688972"></a>
80  Welcome to CLP!
81  </h2></div></div></div><p>
82  The COIN  Linear Program code or CLP is an open-source simplex solver written
83  in C++.  It is primarily meant to be used as a callable library, but a
84  basic, stand-alone <a href="#clpexe" title="Chapter 5. 
85  The CLP Executable
86  ">executable</a> version is also
87  available.
88  </p><p>
89  There are a number of resources available to help new CLP users get started.
90  This document is designed to be used in conjunction with the files in the
91  Samples subdirectory of the main CLP directory (<tt class="filename">COIN/Clp/Samples</tt>).
92  The Samples illustrate how to use CLP and may also serve as useful starting points
93  for user projects.  In the rare event that either this document or the available
94  <a href="#doxygen" title="Appendix B. Doxygen">Doxygen content</a> conflicts with the observed
95  behavior of the source code, the comments in the header files, found in
96  <tt class="filename">COIN/Clp/include</tt>, are the ultimate reference.
97  </p></div><div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id4689382"></a>
98  Prerequisites
99  </h2></div></div></div><p>
100  CLP is written in C++, so it is expected that users of CLP will be writing
101  C++ programs which use CLP as a library.  Thus a working knowledge of
102  <a href="http://www.cplusplus.com/doc/tutorial/" target="_top">C++</a>, including basic
103  object-oriented programming terminology is assumed in this document.  In
104  addition, the user should be familiar with the fundamental concepts of
105  <a href="http://carbon.cudenver.edu/~hgreenbe/courseware/LPshort/intro.html" target="_top">
106  Linear Programming</a>.
107  </p></div></div><div class="chapter" lang="en"><div class="titlepage"><div><div><h2 class="title"><a name="basicmodelclasses"></a>Chapter 2. 
108  Basic Model Classes
109  </h2></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="section"><a href="#hierarchy">
110  Hierarchy
111  </a></span></dt><dt><span class="section"><a href="#firstexample">
112  First Example
113  </a></span></dt><dt><span class="section"><a href="#gettingsolution">
114  Getting at the Solution
115  </a></span></dt><dt><span class="section"><a href="#buildandmodify">
116  Building and Modifying a Model
117  </a></span></dt><dt><span class="section"><a href="#tolerances">Tolerances</a></span></dt><dt><span class="section"><a href="#setsandgets">Some Useful Set and Get Methods</a></span></dt><dt><span class="section"><a href="#simplexspecific">
118  Simplex-specific Methods
119  </a></span></dt><dt><span class="section"><a href="#presolve">
120  Presolve
121  </a></span></dt><dt><span class="section"><a href="#statusarray">Status Array</a></span></dt></dl></div><div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="hierarchy"></a>
122  Hierarchy
123  </h2></div></div></div><p>
124  The basic CLP model class hierarchy is simple.  The top three levels of the
125  hierarchy are depicted in the figure below. The first two levels  (i.e.
126  <tt class="classname">ClpModel</tt>, <tt class="classname">ClpSimplex</tt>,
127  <tt class="classname">ClpInterior</tt>) contain all the problem data which define
128  a model (that is, a problem instance). The third level contains most of the
129  algorithmic aspects of CLP.  There is a fourth level (for models with more general
130  objectives than linear ones), but a description of it is beyond the current scope
131  of this document.
132  </p><div class="mediaobject"><img src="figures/clpbasicmodelhier.gif"></div><p>
133  Most Simplex users need only concern themselves with the classes
134  <tt class="classname">ClpModel</tt> and <tt class="classname">ClpSimplex</tt>.  There
135  are algorithm-specific classes which inherit from
136  <tt class="classname">ClpSimplex</tt> (e.g. <tt class="classname">ClpSimplexDual</tt>
137  and <tt class="classname">ClpSimplexPrimal</tt>), but they have no member data and
138  rarely need be visible to the user.  These  classes are cast at algorithm
139  time.  So, for example, after instantiating an object
140  <b class="userinput"><tt>model</tt></b> of type <tt class="classname">ClpSimplex</tt>,
141  a user only need call <b class="userinput"><tt>model.dual()</tt></b> to invoke the dual
142  simplex method.
143  </p></div><div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="firstexample"></a>
144  First Example
145  </h2></div></div></div><p>
146  Below is our first CLP sample program.  It is short enough to present in full
147  (this code can be found in the CLP Samples directory, see
148  <a href="#moreexamples" title="Chapter 4. 
149More Samples
150">Chapter 4, <i>
151More Samples
152</i></a>).  Most of the remaining examples in this Guide
153  will take the form of small code fragments.
154  </p><div class="example"><a name="id4752674"></a><p class="title"><b>Example 2.1. minimum.cpp</b></p><pre class="programlisting">
155   
156// Copyright (C) 2002, International Business Machines
157// Corporation and others.  All Rights Reserved.
158
159#include "ClpSimplex.hpp"
160int main (int argc, const char *argv[])
161{
162  ClpSimplex  model;
163  int status;
164  if (argc&lt;2)
165    status=model.readMps("../../Mps/Sample/p0033.mps");
166  else
167    status=model.readMps(argv[1]);
168  if (!status) {
169    model.primal();
170  }
171  return 0;
172}
173     
174  </pre></div><p>
175  This sample program creates a  <tt class="classname">ClpSimplex</tt> model,
176  reads an MPS file, and if there are no errors, solves it using the primal
177  algorithm.  The program is easy to follow, but it is not terribly useful:
178  it does not attempt to inspect the results of the solve.  There are two main
179  kinds of results: a "status" describing what happened to the model
180  during the solve, and arrays filled with solution values.  Both will be
181  addressed in this chapter.
182  </p></div><div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="gettingsolution"></a>
183  Getting at the Solution
184  </h2></div></div></div><p>
185  It is often the case with CLP that there is more than one way to do something.
186  This is a consequence of CLP's mixed heritage as a child of
187  <a href="http://www-306.ibm.com/software/data/bi/osl/" target="_top">OSL</a>
188  and a cousin of <a href="https://projects.coin-or.org/Osi" target="_top">OSI</a>.
189  Finding the status of a model exemplifies this situation.
190  </p><p>
191  The OSI way to check for optimality is to call model.isProvenOptimal().  Also
192  available are <tt class="function">isProvenPrimalInfeasible()</tt>,
193  <tt class="function">isProvenDualInfeasible()</tt>,
194  <tt class="function">isPrimalObjectiveLimitReached()</tt>,
195  <tt class="function">isDualObjectiveLimitReached()</tt>,
196  <tt class="function">isIterationLimitReached()</tt> or the feared
197  <tt class="function">isAbandoned()</tt>.  Should one prefer the OSL way of doing
198  things, model.status() returns as it would in OSL, so 0 means optimal,
199  1 means  primal infeasible etc.
200  </p><p>
201  Similarly, to pick up the solution values, one could inhabit the virtuous
202  world of OSI, or the not-quite-so-virtuous world of OSL and "pure"
203  CLP.  By this it is meant that const and non-const forms of arrays are used,
204  respectively.  It is easier to deal with the non-const versions, so most of
205  the elaborate algorithms in CLP and its
206  <a href="#moreexamples" title="Chapter 4. 
207More Samples
208">Samples</a> use them.
209  </p><div class="table"><a name="id4752818"></a><p class="title"><b>Table 2.1. 
210  Methods for getting solution information
211  </b></p><table summary="
212  Methods for getting solution information
213  " border="0"><colgroup><col><col><col></colgroup><thead><tr><th>
214      Purpose
215      </th><th>
216      OSI-style (virtuous)
217      </th><th>
218      CLP-style (less virtuous)
219      </th></tr></thead><tbody><tr><td align="left" valign="top">
220      Primal column solution
221      </td><td align="left" valign="top">
222      <tt class="function">const double * getColSolution()</tt>
223      </td><td align="left" valign="top">
224      <tt class="function">double * primalColumnSolution()</tt>
225      </td></tr><tr><td align="left" valign="top">
226      Dual row solution
227      </td><td align="left" valign="top">
228      <tt class="function">const double * getRowPrice()</tt>
229      </td><td align="left" valign="top">
230      <tt class="function">double * dualColumnSolution()</tt>
231      </td></tr><tr><td align="left" valign="top">
232      Primal row solution
233      </td><td align="left" valign="top">
234      <tt class="function">const double * getRowActivity()</tt>
235      </td><td align="left" valign="top">
236      <tt class="function">double * primalRowSolution()</tt>
237      </td></tr><tr><td align="left" valign="top">
238      Dual row solution
239      </td><td align="left" valign="top">
240      <tt class="function">const double * getReducedCost()</tt>
241      </td><td align="left" valign="top">
242      <tt class="function">double * dualColumnSolution()</tt>
243      </td></tr><tr><td align="left" valign="top">
244      Number of rows in model
245      </td><td align="left" valign="top">
246      <tt class="function">int getNumRows()</tt>
247      </td><td align="left" valign="top">
248      <tt class="function">int numberRows()</tt>
249      </td></tr><tr><td align="left" valign="top">
250      Number of columns in model
251      </td><td align="left" valign="top">
252      <tt class="function">int getNumCols()</tt>
253      </td><td align="left" valign="top">
254      <tt class="function">int numberColumns()</tt>
255      </td></tr></tbody></table></div><p>
256  The reader  may have noted a preference for "number" over
257  "num" and "column" over "col".  This may be a
258  reaction to when one of the authors was young and 5 or 6 letters was the
259  maximum in FORTRAN for any name or to early days with OSL when seven characters
260  were allowed but the first three had to be "ekk"! 
261  </p><p>
262  Using the above-listed functions, our
263  <a href="#firstexample" title="
264  First Example
265  ">initial example</a> might be continued as follows:
266  </p><div class="example"><a name="id4753111"></a><p class="title"><b>Example 2.2. 
267  Possible extension of minimum.cpp
268  </b></p><pre class="programlisting">
269   
270  int numberRows = model.numberRows();
271  double * rowPrimal = model.primalRowSolution();
272  double * rowDual = model.dualRowSolution();
273
274  int iRow;
275
276  for (iRow=0;iRow&lt;numberRows;iRow++)       
277    printf("Row %d, primal %g, dual %g\n",iRow,
278        rowPrimal[iRow],rowDual[iRow]);
279       
280  int numberColumns = model.numberColumns();
281  double * columnPrimal = model.primalColumnSolution();
282  double * columnDual = model.dualColumnSolution();
283
284  int iColumn;
285
286  for (iColumn=0;iColumn&lt;numberColumns;iColumn++)   
287    printf("Column %d, primal %g, dual %g\n",iColumn,
288        columnPrimal[iColumn],columnDual[iColumn]);
289 
290  </pre></div><p>
291  This code sample would pretty-print information about the model's primal and
292  dual solutions.  How to additionally print row and column names is
293  illustrated in the <tt class="filename">defaults.cpp</tt> file in the
294  "Samples" directory (the Samples are properly addressed
295  in <a href="#moreexamples" title="Chapter 4. 
296More Samples
297">Chapter 4, <i>
298More Samples
299</i></a>).  This sample is also useful as it
300  explicitly performs default actions (e.g. it sets the primal feasiblility
301  tolerance value to the default value).
302  </p><p>
303  The remainder of this chapter will show  more of the basic CLP tasks a user
304  might wish to perform.  Apart from presolve we will only be looking at actions
305  which can be performed when including the single header file
306  <tt class="filename">COIN/Clp/include/ClpSimplex.hpp</tt>.
307  </p></div><div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="buildandmodify"></a>
308  Building and Modifying a Model
309  </h2></div></div></div><p>
310  Rather than reading a model from an MPS file we can load a model from arrays
311  in memory.  There are various <tt class="function">loadProblem</tt> methods which
312  are similar to those in OSI.  It is easy to add more such methods to CLP if the need arises.
313  </p><p>We can copy in integer information by
314  <tt class="function">copyInIntegerInformation(const char * array)</tt> where array
315  is 0 or 1 to say integer and we can drop existing information by
316  <tt class="function">deleteIntegerInformation()</tt>.  There are various ways of
317  changing the size of a model.  The simplest is by the use of the method
318  <tt class="function">resize(newNumberRows,newNumberColumns)</tt> - this will either
319  truncate the model or add "default" rows or columns - a default row
320  has lower bound of -infinity and upper bound of +infinity, while a default
321  column has zero cost, zero lower bound and an upper bound of +infinity.
322  </p><p>
323  Normally we would use <tt class="function">deleteRows</tt>,
324  <tt class="function">addRows</tt>, <tt class="function">deleteColumns</tt> and
325  <tt class="function">addColumns</tt>, where the <tt class="function">add</tt> methods
326  will also add in the elements.  A potentially very useful way of modifying a model is strictly a
327  constructor.  Given a large model and a list of rows and a list of columns it
328  constructs the model as a subset of the large model.  It is possible to change
329  the order of the columns/rows and to duplicate columns/rows.  So a list of
330  columns 4,4,1,0 will create a new model where the first two columns are copies
331  of column 4 in original model and the next two are the first two of original
332  model in reverse order.  This can be useful to form a model with piecewise
333  linear costs by duplicating columns and then modifying bounds and costs.
334  </p></div><div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="tolerances"></a>Tolerances</h2></div></div></div><p>
335  There are set and get methods for tolerances, for example,
336  <tt class="function">double primalTolerance()</tt> and
337  <tt class="function">setPrimalTolerance(double)</tt>.  Assuming that one has a
338  minimization problem, an individual variable is deemed primal feasible if it
339  is less than the tolerance referred to by these methods below its lower bound
340  and less than it above its upper bound.  Similarly for dual tolerances, a
341  variable is deemed to be dual feasible if its reduced cost is greater than
342  minus the tolerance or its distance to the upper bound is less than primal
343  tolerance and the reduced cost is less than plus the tolerance or the distance
344  to lower bound is less than primal tolerance.  In short, this is complementarity
345  conditions adadpted for tolerances and simple lower and upper bounds.(Note
346  that the above was stated as for minimization; signs are reversed for
347  maximization.)
348  </p></div><div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="setsandgets"></a>Some Useful Set and Get Methods</h2></div></div></div><div class="table"><a name="id4753335"></a><p class="title"><b>Table 2.2. Some Useful Set and Get Methods</b></p><table summary="Some Useful Set and Get Methods" border="0"><colgroup><col><col></colgroup><thead><tr><th>
349    Method(s)
350    </th><th>
351    Description
352    </th></tr></thead><tbody><tr><td align="left" valign="top">
353      <tt class="function">setMaximumIterations(int value)</tt><br>
354      <tt class="function">int maximumIterations()</tt><br>
355      <tt class="function">setMaximumSeconds(double value)</tt><br>
356      <tt class="function">double maximumIterations()</tt>
357      </td><td align="left" valign="top">
358      These methods tell CLP to stop after a given number of iterations or
359      seconds (and returns these values).
360      </td></tr><tr><td align="left" valign="top">
361      <tt class="function">double objectiveValue()</tt>
362      </td><td align="left" valign="top">
363      This method returns the objective value.
364      </td></tr><tr><td align="left" valign="top">
365      <tt class="function">const double * getObjCoefficients()</tt><br>
366      <tt class="function">double * objective()</tt>
367      </td><td align="left" valign="top">
368      These methods return the objective coefficients.
369      </td></tr><tr><td align="left" valign="top">
370      <tt class="function">const double * getRowLower()</tt><br>
371      <tt class="function">double * rowLower()</tt><br>
372      <tt class="function">const double * getRowUpper()</tt><br>
373      <tt class="function">double * rowUpper()</tt><br>
374      <tt class="function">const double * getColLower()</tt><br>
375      <tt class="function">double * columnLower()</tt><br>
376      <tt class="function">const double * getColUpper()</tt><br>
377      <tt class="function">double * columnUpper()</tt>
378      </td><td align="left" valign="top">
379      These methods give lower and upper bounds on row and column activities.
380      </td></tr><tr><td align="left" valign="top">
381      <tt class="function">double * infeasibilityRay()</tt><br>
382      <tt class="function">double * unboundedRay()</tt>
383      </td><td align="left" valign="top">
384      If the problem was primal or dual infeasible, these methods will give a
385      pointer to a ray proving infeasibility.
386      </td></tr><tr><td align="left" valign="top">
387      <tt class="function">CoinPackMatrix * matrix()</tt>
388      </td><td align="left" valign="top">
389      There are more options as the user has great flexibility in how the problem
390      matrix is stored, but the default matrix class is
391      <tt class="classname">CoinPackedMatrix</tt> (see
392      <a href="#matrixclasses" title="Matrix Classes">the section called &#8220;Matrix Classes&#8221;</a>).
393      So we have that this method returns a pointer to a
394      <tt class="classname">CoinPackedMatrix</tt> which can be further manipulated.
395      </td></tr><tr><td align="left" valign="top">
396      <tt class="function">CoinBigIndex getNumElements()</tt>
397      <sup>[<a name="id4753637" href="#ftn.id4753637">a</a>]</sup>
398      </td><td align="left" valign="top">
399      Returns the number of elements in the problem matrix.
400      </td></tr><tr><td align="left" valign="top">
401      <tt class="function">void setOptimizationDirection(double value)</tt><br>
402      <tt class="function">double optimizationDirection()</tt>
403      </td><td align="left" valign="top">
404      These methods set and get the objective sense.  The parameter
405      <i class="parameter"><tt>value</tt></i> should be +1 to minimize, -1 to maximize,
406      and 0 to ignore.
407      </td></tr></tbody><tbody class="footnotes"><tr><td colspan="2"><div class="footnote"><p><sup>[<a name="ftn.id4753637" href="#id4753637">a</a>] </sup>
408        <span class="type">CoinBigIndex</span> is a <tt class="function">typedef</tt> which in
409        most cases is the same as <span class="type">int</span>.
410        </p></div></td></tr></tbody></table></div></div><div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="simplexspecific"></a>
411  Simplex-specific Methods
412  </h2></div></div></div><p>
413  Some of the most commonly-used methods when working with Simplex are listed in
414  the table below.
415  </p><div class="table"><a name="id4753729"></a><p class="title"><b>Table 2.3. Common Simplex-specific methods</b></p><table summary="Common Simplex-specific methods" border="0"><colgroup><col><col></colgroup><thead><tr><th>
416    Method(s)
417    </th><th>
418    Description
419    </th></tr></thead><tbody><tr><td align="left" valign="top">
420      <tt class="function">primal(int mode=0)</tt>
421      </td><td align="left" valign="top">
422      This applies the primal algorithm. If <i class="parameter"><tt>mode</tt></i> is
423      set to the default of 0, then the method uses the status variables to
424      determine basis and solution. If <i class="parameter"><tt>mode</tt></i> is 1 then
425      the method does a values pass so variables not in basis are given their
426      current values and one pass of variables is done to clean up the basis
427      with an equal or better objective value.
428      </td></tr><tr><td align="left" valign="top">
429      <tt class="function">dual(int mode=0)</tt>
430      </td><td align="left" valign="top">
431      This applies the dual algorithm. if <i class="parameter"><tt>mode</tt></i> is set
432      to the default of 0, then the method uses the status variables to
433      determine basis and solution.  If <i class="parameter"><tt>mode</tt></i> is 1 then
434      the method uses input duals and does a values pass so one pass of basic
435      variables is done to clean up the duals with an equal or better objective
436      value.
437      </td></tr><tr><td align="left" valign="top">
438      <tt class="function">scaling(int mode=1)</tt>
439      </td><td align="left" valign="top">
440      This method toggles scaling on (<i class="parameter"><tt>mode</tt></i> set to 1)
441      and off (<i class="parameter"><tt>mode</tt></i> set to 0).
442      </td></tr><tr><td align="left" valign="top">
443      <tt class="function">int crash(double gap,int mode)</tt>
444      </td><td align="left" valign="top">
445      This method attemps to improve on an all slack basis.
446      For dual this will move variables to the dual feasible bound
447      if the gap between bounds is less than <i class="parameter"><tt>gap</tt></i>.  Setting
448      <i class="parameter"><tt>mode</tt></i> to 0 guesses which algorithm is better, while
449      a value of 1 or 2 will result in more work being done.  The return code is
450      0 if the basis was not slacks in first case, it is negative if dual is
451      preferred or positive if primal.  ±1 means an all slack basis seemed
452      best, while ±2 means some work was done.
453      </td></tr><tr><td align="left" valign="top">
454      <tt class="function">perturb(int mode)</tt>
455      </td><td align="left" valign="top">
456      This method toggles perturbation on (<i class="parameter"><tt>mode</tt></i> set to 1)
457      and off (<i class="parameter"><tt>mode</tt></i> set to 0).  It should be considered
458      a work in progress, although on some problems it gives very good results.
459      </td></tr><tr><td align="left" valign="top">
460      <tt class="function">factorizationFrequency()</tt><br>
461      <tt class="function">setFactorizationFrequency(int value)</tt>
462      </td><td align="left" valign="top">
463      These are "get" and "set" methods for the basis matrix
464      factorization frequency.  The default is to refactor every 200 iterations,
465      but it may make more sense to use something such as 100 + the number of
466      rows divided by 50.
467      </td></tr><tr><td align="left" valign="top">
468      <tt class="function">dualBound()</tt><br>
469      <tt class="function">setDualBound(double value)</tt>
470      </td><td align="left" valign="top">
471      These are "get" and "set" methods for the
472      "dual bound".  The CLP dual algorithm declares all problems
473      to be dual feasible by putting non-basic variables to correct bounds for
474      the reduced cost.  If the gap between the bounds is too big then it
475      pretends the gap is only the value specified by this set method.
476      In essence, this gives a composite dual rather than a pure
477      Phase I- Phase II method.
478      </td></tr><tr><td align="left" valign="top">
479      <tt class="function">infeasibilityCost()</tt><br>
480      <tt class="function">setInfeasibilityCost(double value)</tt>
481      </td><td align="left" valign="top">
482      These are the primal analogs to the "dual bound" methods.
483      </td></tr><tr><td align="left" valign="top">
484      <tt class="function">numberPrimalInfeasibilities()</tt><br>
485      <tt class="function">sumPrimalInfeasibilities()</tt>
486      </td><td align="left" valign="top">
487      After a solve, there may be infeasibilities.  These methods serve to
488      check for said infeasibilities.  One could check the solution explicitly
489      as well.  For a code fragement illustrating this, see
490      <a href="#presolveexample" title="Example 2.3. Presolve code fragment">Example 2.3, &#8220;Presolve code fragment&#8221;</a>.
491      </td></tr></tbody></table></div></div><div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="presolve"></a>
492  Presolve
493  </h2></div></div></div><p>
494  The header file for the use of CLP's presolve functionality is
495  <tt class="filename">COIN/Clp/include/Presolve.hpp</tt>.  The sample program below
496  illustrates some of the possibilities offered by CLP's presolve:
497  </p><div class="example"><a name="presolveexample"></a><p class="title"><b>Example 2.3. Presolve code fragment</b></p><pre class="programlisting">
498#include "ClpSimplex.hpp"
499#include "ClpPresolve.hpp"
500int main (int argc, const char *argv[])
501{
502  ClpSimplex model;
503  model.readMps("../../Mps/Sample/p0033.mps"); // initialized by readMps or whatever
504  ClpPresolve presolveInfo;
505  ClpSimplex * presolvedModel = presolveInfo.presolvedModel(model);
506  // at this point we have original model and a new model.  The  information
507  // on the operations done is in presolveInfo
508  if (presolvedModel) {
509    // was not found to be infeasible - so lets solve
510    // if presolvedModel was NULL then it was primal infeasible and ...
511    presolvedModel-&gt;dual(); // or whatever else we wish to do
512    presolveInfo.postsolve(true);  // the true updates status arrays in original       
513    /* If the presolved model was optimal then so should the
514       original be.           
515       We can use checkSolution and test feasibility */
516    model.checkSolution();         
517    if (model.numberDualInfeasibilities()||
518        model.numberPrimalInfeasibilities())
519      printf("%g dual %g(%d) Primal %g(%d)\n",
520             model.objectiveValue(),
521             model.sumDualInfeasibilities(),
522             model.numberDualInfeasibilities(),
523             model.sumPrimalInfeasibilities(),
524             model.numberPrimalInfeasibilities());
525    // Due to tolerances we can not guarantee that so you may wish to throw in
526    model.primal(1);
527  }
528}   
529  </pre></div><p>
530  Presolve has a few more options which can be found in the header file, for
531  example whether to treat as an integer problem or whether to keep row and
532  column names.
533  </p></div><div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="statusarray"></a>Status Array</h2></div></div></div><p>
534  The astute reader may have noticed that the status array has been mentioned
535  once or twice.  The beginning user will not need to look at it   Nevertheless,
536  for completeness the status of a variable can be found and set as shown below.
537  The possible state of a variable are listed in the following table (each may
538  have to be preceded by ClpSimplex::):
539  </p><div class="table"><a name="id4754207"></a><p class="title"><b>Table 2.4. Possible states of a variable</b></p><table summary="Possible states of a variable" border="0"><colgroup><col><col></colgroup><thead><tr><th>
540          <span class="type">Status</span><sup>[<a name="id4754228" href="#ftn.id4754228">a</a>]</sup>
541          </th><th>
542          Description
543          </th></tr></thead><tbody><tr><td align="left" valign="top">
544          <tt class="constant">basic</tt>
545          </td><td align="left" valign="top">
546          In basis
547          </td></tr><tr><td align="left" valign="top">
548          <tt class="constant">isFree</tt>
549          </td><td align="left" valign="top">
550          Not in basis, has infinite bounds
551          </td></tr><tr><td align="left" valign="top">
552          <tt class="constant">isFixed</tt>
553          </td><td align="left" valign="top">
554          Not in basis, bounds are equal
555          </td></tr><tr><td align="left" valign="top">
556          <tt class="constant">atUpperBound</tt>
557          </td><td align="left" valign="top">
558          At upper bound, not in basis
559          </td></tr><tr><td align="left" valign="top">
560          <tt class="constant">atLowerBound</tt>
561          </td><td align="left" valign="top">
562          At lower bound, not in basis
563          </td></tr><tr><td align="left" valign="top">
564          <tt class="constant">superBasic</tt>
565          </td><td align="left" valign="top">
566          Between bounds, but not basic or free
567          </td></tr></tbody><tbody class="footnotes"><tr><td colspan="2"><div class="footnote"><p><sup>[<a name="ftn.id4754228" href="#id4754228">a</a>] </sup><span class="type">Status</span>
568            is an enumeration.</p></div></td></tr></tbody></table></div><p>
569  To get or set the status of a variable is a simple task:
570  </p><pre class="programlisting">
571  // Get row status...
572  Status status=model.getRowStatus(sequenceNumber)
573  // ... or get column status.
574  Status status=model.getColumnStatus(sequenceNumber)
575  // Set row status to basic (for example)...
576  model.setRowStatus(sequenceNumber,ClpSimplex::basic)
577  // ... or column status to basic.
578  model.setColumnStatus(sequenceNumber,ClpSimplex::basic)
579  </pre></div></div><div class="chapter" lang="en"><div class="titlepage"><div><div><h2 class="title"><a name="notsobasic"></a>Chapter 3. 
580  Not-Quite-So-Basic Model Classes
581  </h2></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="section"><a href="#pivotchoices">Pivot Choices</a></span></dt><dt><span class="section"><a href="#matrixclasses">Matrix Classes</a></span></dt><dt><span class="section"><a href="#messagehandling">Message Handling</a></span></dt></dl></div><div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="pivotchoices"></a>Pivot Choices</h2></div></div></div><p>
582  In the dual algorithm, any infeasible basic variable may be chosen to leave the
583  basis.  Similarly in the primal algorithm, any non-basic variable with a
584  "bad" reduced cost may be chosen to enter the basis.  This choice is
585  probably the most important factor in determining the number of iterations it
586  will take to solve a problem.  Clp provides a abstract base class for each case
587  and then instances of each.  It is relatively simple for an advanced user to
588  create new instances.
589  </p><p>
590  For the dual method the base class is <tt class="function">ClpDualRowPivot</tt>.
591  The two existing instances are <tt class="function">ClpDualRowDantzig</tt> and
592  <tt class="function">ClpDualRowSteepest</tt>.  The Dantzig version implements the
593  "standard" pivot rule: choose the  most violated basic variable.  It
594  is easily dominated by the Steepest instance which should normally be used.  The
595  default is to use un-initialized weights where the initial weight for each basic
596  variable is 1.0.  If an all-slack basis is being used then these are the correct
597  weights.  To use a version which calculates the weights, create an instance and
598  pass it to ClpSimplex model as in the following code fragment:
599  </p><pre class="programlisting">
600  ClpDualRowSteepest steep(1); // 0 uninitialized, 1 compute weights
601  model.setDualRowPivotAlgorithm(steep);
602  </pre><p>Similarly for the primal method the base class is
603  <tt class="function">ClpPrimalColumnPivot</tt>.  The two existing instances are
604  <tt class="function">ClpPrimalColumnDantzig</tt> and
605  <tt class="function">ClpPrimalColumnSteepest</tt>.  The Dantzig version implements
606  "standard" pivot rule: choose the most "violated" non-basic
607  variable.  It is dominated by the Steepest instance which should normally be
608  used.  The default is to use exact Devex where the initial weight for each
609  non-basic variable is 1.0.  Unlike for the dual, this is never the same as
610  normal steepest edge.  To use a version which does steepest edge create an
611  instance and pass it to ClpSimplex model as in the following code fragment:
612  </p><pre class="programlisting">
613  ClpPrimalColumnSteepest steep(1); // 0 devex, 1 steepest
614  model.setPrimalColumnPivotAlgorithm(steep);
615  </pre><p>
616  The partial pricing scheme (for long, thin problems) currently does not
617  exist.  This could be implemented by anyone who is interested.
618  </p></div><div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="matrixclasses"></a>Matrix Classes</h2></div></div></div><p>
619  The next abstract class of interest is <tt class="function">ClpMatrixBase</tt>.
620  CLP encapsulates its knowledge of how a matrix is stored in this class.  The
621  default instance of this is the <tt class="function">ClpPackedMatrix</tt> class.
622  This is identical in format to <tt class="function">CoinPackedMatrix</tt>.  Below
623  is a diagram summarizing the hierarchy of the most important matrix classes:
624  </p><div class="mediaobject"><img src="figures/clpbasicmatrixhier.gif"></div><p>
625  The important new methods implemented are for filling a basis, checking validity
626  of elements and faster "times" and "transposeTimes" when
627  the input array is sparse and/or we have a row copy of the matrix.  Advanced
628  users should note that not all methods have to be implemented.  In particular,
629  <tt class="function">scaling</tt> need not be implemented and
630  <tt class="function">reverseOrderedCopy</tt> can return <i class="parameter"><tt>NULL</tt></i>
631  if a row copy does not make sense.
632  </p><p>
633  In addition to the default class, there are two others at present:
634  <tt class="function">ClpPlusMinusOneMatrix</tt> and
635  <tt class="function">ClpNetworkMatrix</tt>.  As the name implies, the first one is
636  useful when all elements are ±1.  In this case multiplies are not needed
637  and more importantly less memory is used and there are fewer cache misses.  A
638  class for a matrix where all elements are +1 would be trivial to create. If
639  there were fewer than 64000 rows one could even store row indices as shorts
640  etc.
641  </p><p>
642  The use of <tt class="function">ClpPlusMinusOneMatrix</tt> involves some work as one
643  cannot simply read-in an MPS file.  The key is to use
644  <tt class="function">loadProblem</tt> to pass in a matrix.  So if
645  <tt class="varname">matrix</tt> was a <tt class="function">CoinPackedMatrix</tt> one
646  could do the following:
647  </p><pre class="programlisting">
648  ClpPlusMinusOneMatrix plusMinus(matrix);
649  assert (plusMinus.getIndices()); // would be zero if not +- one
650  model.loadProblem(plusMinus,
651    lowerColumn,upperColumn,objective,
652    lower,upper);
653  </pre><p>
654  <tt class="function">ClpNetworkMatrix</tt> is similar, but represents a network,
655  thus may only have one element per column.  Fortunately, using is is very
656  easy.  Given <tt class="varname">head</tt> and <tt class="varname">tail</tt>, one could
657  do the following:
658  </p><pre class="programlisting">
659  ClpNetworkMatrix network(numberColumns,head,tail);
660  model.loadProblem(network,
661    lowerColumn,upperColumn,objective,
662    lower,upper);
663  </pre><p>
664  Actual code is in <tt class="filename">COIN/Clp/Test/unitTest.cpp</tt>.  A quick
665  glance at the output of this program shows that use of
666  <tt class="function">ClpNetworkMatrix</tt> gives much faster run times.  This is
667  not because of storage issues, but because CLP recognizes the network and uses
668  a network basis factorization which is much faster.  However, in this mode CLP
669  is not a genuine network code as it does not take full advantage of the
670  structure by combining operations but it does have the advantage of
671  flexibility.
672  </p><p>
673  Other instances are possible.  In particular, it should be possible to use the
674  abstract class for column generation or for dynamic matrices which change over
675  time.  Minor modifications may be needed but it should work quite smoothly
676  (there is already a dummy "refresh" method which would be used).
677  </p></div><div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="messagehandling"></a>Message Handling</h2></div></div></div><p>
678  Strictly speaking, message handling is a general COIN topic, but it won't hurt
679  to repeat a few important things here.
680  </p><p>
681  A simple user you may wish to turn off some output.  This is done with
682  <tt class="function">model.setLogLevel(int value)</tt>
683  where 0 gives nothing and each increase in value switches on more
684  messages. See <tt class="filename">ClpMessage.cpp</tt>,
685  <tt class="filename">CoinMessage.cpp</tt> and <a href="#messages" title="Chapter 6. 
686  Messages
687  ">Chapter 6, <i>
688  Messages
689  </i></a> to see
690  which messages are at which level.  A more sophisticated user may wish to
691  handle messages in a different way.  This is done using
692  <tt class="function">passInMessageHandler</tt> with a pointer to a handler of the
693  user's own design.  The simplest case would be to use the default handler but
694  use a constructor which writes to file.  The code would be:
695  </p><pre class="programlisting">
696  FILE * fp; // assumed open
697  CoinMessageHandler handler(fp);
698  model.passInMessageHandler(&amp;handler);
699  </pre><p>
700  A still more sophisticated use would be to write a class derived from
701  <tt class="function">CoinMessageHandler</tt> and then override the
702  <tt class="function">print</tt> method.  Below follows an example which would
703  print only a message for optimality (or infeasibility):
704  </p><div class="example"><a name="id4756901"></a><p class="title"><b>Example 3.1. Sophisticated message handling</b></p><pre class="programlisting">
705  class DerivedHandler :
706   public CoinMessageHandler {
707   public:
708     virtual int print() ;
709   };
710
711
712   int DerivedHandler::print()
713   {
714     if (currentSource()=="Clp") {
715       if (currentMessage().externalNumber()&gt;=0
716       &amp;&amp; currentMessage().externalNumber()&lt;4) {
717         // finished
718         return CoinMessageHandler::print(); // print
719       }
720     }
721     return 0;
722   }
723  </pre></div></div></div><div class="chapter" lang="en"><div class="titlepage"><div><div><h2 class="title"><a name="moreexamples"></a>Chapter 4. 
724More Samples
725</h2></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="section"><a href="#id4757090">CLP's Samples Directory</a></span></dt><dd><dl><dt><span class="section"><a href="#minimumcppdesc">minimum.cpp</a></span></dt><dt><span class="section"><a href="#defaultscppdesc">defaults.cpp</a></span></dt><dt><span class="section"><a href="#drivercppdesc">driver.cpp</a></span></dt><dt><span class="section"><a href="#networkcppdesc">network.cpp</a></span></dt><dt><span class="section"><a href="#testbarriercppdesc">testBarrier.cpp</a></span></dt><dt><span class="section"><a href="#id4758374">dualCuts.cpp</a></span></dt><dt><span class="section"><a href="#id4758398">decompose.cpp</a></span></dt><dt><span class="section"><a href="#id4758414">driver2.cpp</a></span></dt></dl></dd><dt><span class="section"><a href="#id4758428">Common CLP Tasks in the Samples</a></span></dt></dl></div><div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id4757090"></a>CLP's Samples Directory</h2></div></div></div><p>
726The CLP dsitribution includes a number of <tt class="filename">.cpp</tt> sample files.
727Users are encouraged to use them as starting points for their own CLP projects.
728The files can be found in the <tt class="filename">COIN/Clp/Samples/</tt> directory.
729For the latest information on compiling and running these samples, please see
730the file <tt class="filename">COIN/Clp/Samples/INSTALL</tt>.  Below is a list of
731some of the most useful sample files with a short description for each file.
732</p><div class="table"><a name="id4756483"></a><p class="title"><b>Table 4.1. Basic Samples</b></p><table summary="Basic Samples" border="0"><colgroup><col><col></colgroup><thead><tr><th align="left" valign="bottom">
733        Source file       
734        </th><th align="left" valign="bottom">
735        Description
736        </th></tr></thead><tbody><tr><td align="left" valign="top">
737        <a href="http://www-124.ibm.com/developerworks/opensource/cvs/coin/COIN/Clp/Samples/minimum.cpp" target="_top"><tt class="filename">minimum.cpp</tt></a>
738        </td><td align="left" valign="top">
739        This is a CLP "Hello, world" program.  It reads a problem
740        from an MPS file, and solves the problem.
741        [<a href="#minimumcppdesc" title="minimum.cpp">More...</a>]
742        </td></tr><tr><td align="left" valign="top">
743        <a href="http://www-124.ibm.com/developerworks/opensource/cvs/coin/COIN/Clp/Samples/defaults.cpp" target="_top"><tt class="filename">defaults.cpp</tt></a>
744        </td><td align="left" valign="top">
745        This is one of the simpler driver programs available.  It sets
746        tolerances to defaults and is a good place to find straightforward uses
747        of "set" and    "get" methods.  It also prints out full
748        MPS-like solutions.
749        [<a href="#defaultscppdesc" title="defaults.cpp">More...</a>]
750        </td></tr><tr><td align="left" valign="top">
751        <a href="http://www-124.ibm.com/developerworks/opensource/cvs/coin/COIN/Clp/Samples/driver.cpp" target="_top"><tt class="filename">driver.cpp</tt></a>
752        </td><td align="left" valign="top">
753        This is designed to be a file that a user could modify to get a useful
754        driver program for his or her project.  In particular, it demonstrates
755        the use of CLP's  presolve functionality.
756        [<a href="#drivercppdesc" title="driver.cpp">More...</a>]
757        </td></tr><tr><td align="left" valign="top">
758        <a href="http://www-124.ibm.com/developerworks/opensource/cvs/coin/COIN/Clp/Samples/network.cpp" target="_top"><tt class="filename">network.cpp</tt></a>
759        </td><td align="left" valign="top">
760        This shows the use of non-standard matrices and how to load a problem
761        without the use of MPS files.
762        [<a href="#networkcppdesc" title="network.cpp">More...</a>]
763        </td></tr><tr><td align="left" valign="top">
764        <a href="http://www-124.ibm.com/developerworks/opensource/cvs/coin/COIN/Clp/Samples/testBarrier.cpp" target="_top"><tt class="filename">testBarrier.cpp</tt></a>
765        </td><td align="left" valign="top">
766        This is a basic driver file for the barrier method of CLP, similar to
767        <a href="http://www-124.ibm.com/developerworks/opensource/cvs/coin/COIN/Clp/Samples/minimum.cpp" target="_top"><tt class="filename">minimum.cpp</tt></a>.  The barrier method is not currently addressed in this
768        guide.
769        [<a href="#testbarriercppdesc" title="testBarrier.cpp">More...</a>]
770        </td></tr></tbody></table></div><div class="table"><a name="id4757680"></a><p class="title"><b>Table 4.2. Advanced Samples</b></p><table summary="Advanced Samples" border="0"><colgroup><col><col></colgroup><thead><tr><th align="left" valign="bottom">
771        Source file       
772        </th><th align="left" valign="bottom">
773        Description
774        </th></tr></thead><tbody><tr><td align="left" valign="top">
775        <a href="http://www-124.ibm.com/developerworks/opensource/cvs/coin/COIN/Clp/Samples/driver2.cpp" target="_top"><tt class="filename">driver2.cpp</tt></a>
776        </td><td align="left" valign="top">
777        This sample, in addition to some tasks common to other samples, does
778        some advanced message handling and presolve.
779        </td></tr><tr><td align="left" valign="top">
780        <a href="http://www-124.ibm.com/developerworks/opensource/cvs/coin/COIN/Clp/Samples/dualCuts.cpp" target="_top"><tt class="filename">dualCuts.cpp</tt></a>
781        </td><td align="left" valign="top">
782        This sample implements a method of treating a problem as a collection
783        of cuts.
784        </td></tr><tr><td align="left" valign="top">
785        <a href="http://www-124.ibm.com/developerworks/opensource/cvs/coin/COIN/Clp/Samples/decompose.cpp" target="_top"><tt class="filename">decompose.cpp</tt></a>
786        </td><td align="left" valign="top">
787        This does full Dantzig-Wolfe decomposition.  It illustrates
788        the use of many models, adding columns, et cetera.
789        </td></tr><tr><td align="left" valign="top">
790        <a href="http://www-124.ibm.com/developerworks/opensource/cvs/coin/COIN/Clp/Samples/sprint.cpp" target="_top"><tt class="filename">sprint.cpp</tt></a>
791        </td><td align="left" valign="top">
792        This solves a long, thin problem by solving smaller subsets.  It is a
793        simplified version of work done by one of the authors on aircrew
794        scheduling problems.  It shows the use of two models and their
795        synchronization.  A more general version can be found in
796        <tt class="filename">COIN/Clp/ClpSolve.cpp</tt>
797        </td></tr><tr><td align="left" valign="top">
798        <a href="http://www-124.ibm.com/developerworks/opensource/cvs/coin/COIN/Clp/Samples/sprint2.cpp" target="_top"><tt class="filename">sprint2.cpp</tt></a>
799        </td><td align="left" valign="top">
800        This is similar to <tt class="filename">sprint.cpp</tt> but is designed for
801        solving large problems with little choice.  The idea is that if
802        relatively few variables are fixed, presolve can greatly reduce the
803        problem size so that a series of solves can get close to the optimal
804        solution much faster than would a naïve solve of the full problem.
805        </td></tr></tbody></table></div><p>
806The remaining Samples listed here are considered unsupported in that they are of
807a more esoteric nature and are sometimes contributed as a result of an
808individual's request.  The are to be found in
809<tt class="filename">COIN/Clp/Samples/Contributed</tt>.
810</p><div class="table"><a name="id4757910"></a><p class="title"><b>Table 4.3. Unsupported Samples</b></p><table summary="Unsupported Samples" border="0"><colgroup><col><col></colgroup><thead><tr><th align="left" valign="bottom">
811        Source file       
812        </th><th align="left" valign="bottom">
813        Description
814        </th></tr></thead><tbody><tr><td align="left" valign="top">
815        <a href="http://www-124.ibm.com/developerworks/opensource/cvs/coin/COIN/Clp/Samples/testBasis.cpp" target="_top"><tt class="filename">testBasis.cpp</tt></a>
816        </td><td align="left" valign="top">
817        This sample takes a problem, changes any inequality constraints to
818        equality constraints, solves the problem, and creates the optimal basis.
819        </td></tr><tr><td align="left" valign="top">
820        <a href="http://www-124.ibm.com/developerworks/opensource/cvs/coin/COIN/Clp/Samples/testGub.cpp" target="_top"><tt class="filename">testGub.cpp</tt></a>
821        </td><td align="left" valign="top">
822        This sample illustrates the use of the GUB ("Generalized Upper
823        Bound") technique.
824        </td></tr><tr><td align="left" valign="top">
825        <a href="http://www-124.ibm.com/developerworks/opensource/cvs/coin/COIN/Clp/Samples/ekk.cpp" target="_top"><tt class="filename">ekk.cpp</tt></a>
826        </td><td align="left" valign="top">
827        This sample can be used to compare CLP and OSL.  It uses an additional
828        file in the Samples directory, <tt class="filename">ekk_interface.cpp</tt>.
829        These sample files are not likely to be interesting to new CLP users
830        who do not have experience with OSL.
831        </td></tr><tr><td align="left" valign="top">
832        <a href="http://www-124.ibm.com/developerworks/opensource/cvs/coin/COIN/Clp/Samples/hello.cpp" target="_top"><tt class="filename">hello.cpp</tt></a>
833        </td><td align="left" valign="top">
834        This sample creates a text-based picture of a matrix on screen
835        (limited to an 80x80 matrix).  It's not terribly useful but it does
836        illustrate one way to step through the elements of a matrix.
837        </td></tr><tr><td align="left" valign="top">
838        <a href="http://www-124.ibm.com/developerworks/opensource/cvs/coin/COIN/Clp/Samples/piece.cpp" target="_top"><tt class="filename">piece.cpp</tt></a>
839        </td><td align="left" valign="top">
840        This sample takes a matrix read in by <tt class="classname">CoinMpsIo</tt>
841        (can be used to read in MPS files without a solver), deletes every
842        second column and solves the resulting problem.
843        </td></tr><tr><td align="left" valign="top">
844        <a href="http://www-124.ibm.com/developerworks/opensource/cvs/coin/COIN/Clp/Samples/useVolume.cpp" target="_top"><tt class="filename">useVolume.cpp</tt></a>
845        </td><td align="left" valign="top">
846        The Volume Algorithm is another solver available as part of the COIN-OR
847        distribution.  This sample shows how to use the Volume Algorithm with
848        CLP.
849        </td></tr></tbody></table></div><div class="section" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="minimumcppdesc"></a>minimum.cpp</h3></div></div></div><p>
850This sample is examined in more detail in <a href="#firstexample" title="
851  First Example
852  ">the section called &#8220;
853  First Example
854  &#8221;</a>.
855</p></div><div class="section" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="defaultscppdesc"></a>defaults.cpp</h3></div></div></div><p>
856This sample begins by reading an MPS file.  The default MPS file is
857<tt class="filename">COIN/Mps/Sample/p0033.mps</tt>; this can be over-riden by a
858command-line specification of a (path and) file name).  The sample then sets
859the pivot algorithm to be exact devex.  It "gets" the default
860infeasibility cost and "sets" it to that value (and prints it to
861standard out).  This sort of getting and setting of various parameters
862constitutes a common theme in this sample, with the purpose of illustrating
863usage of some of the more common get and set methods available in CLP.
864</p><p>
865At this point the model is solved by the primal method.  A sequence of sets,
866gets and prints is then followed by a number of calls to methods which give
867specific information about the status of the problem (for example, the code
868checks that the current solution has been proven to be optimal by
869<tt class="code">assert(model.isProvenOptimal())</tt>).
870</p><p>
871Next, a copy of the original model is made.  More sets and gets are
872performed to demonstrate the use of additional options (including
873the setting of the default message handling as well as changing of the
874"log level" (amount of output)).  The model is solved again a
875number of times between changes of the optimization direction (i.e. changing
876from min to max or vice versa).  The remaining lines of this sample serve to
877display solution and problem information in much the same way as is done in
878driver.cpp.
879</p></div><div class="section" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="drivercppdesc"></a>driver.cpp</h3></div></div></div><p>
880This sample begins by reading an MPS file.  The default MPS file is
881<tt class="filename">COIN/Mps/Sample/p0033.mps</tt>; this can be over-riden by a
882command-line specification of a (path and) file name).  A second command-line
883argument can specify that either the "primal" or "dual"
884method (or even the "barrier", see below) should be used by CLP.
885</p><p>
886Once the problem has been
887read, there are two options for how to solve it, one of which must be chosen at
888compile-time (<tt class="code">STYLE1</tt> being defined or not determines this
889choice).  The second manner is more flexible and involves more specific
890directions being given to CLP, including the ability to specify that the barrier
891method should be used.
892</p><p>
893At this point in the sample, the problem is solved by CLP, and some basic ouput
894is generated.  If more output is desired, at compile-time, an
895<tt class="code">exit(0)</tt> statement must either be removed or commented.  There are
896two levels of additional output, the first of which is suppressed  by a
897<tt class="code">#if 0</tt> directive which may be modified at compile-time if desired.
898This first level of output only involves non-zero columns, whereas the second
899provides additional information.
900</p></div><div class="section" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="networkcppdesc"></a>network.cpp</h3></div></div></div><p>
901This handy sample reads a network problem generated by
902<a href="http://www.netlib.org/lp/generators/netgen" target="_top">netgen</a>, converts
903it to an LP using CLP's network matrix type, and solves.  This entirely avoids
904the use of an MPS file, as the LP is built in memory from the network data file
905created by netgen.  Also, the factorization frequency is changed, and the
906problem is solved more than once (demonstrating the change of optimization sense
907as well as switching from dual to primal methods).
908</p></div><div class="section" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="testbarriercppdesc"></a>testBarrier.cpp</h3></div></div></div><p>
909This straightfoward sample begins by reading a problem from an MPS file.  It
910then chooses a Cholesky factorization and solves the problem using the
911predictor corrector barrier method.  It then copies the problem and performs a
912crossover to a simplex solution in the new copy.
913</p></div><div class="section" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id4758374"></a>dualCuts.cpp</h3></div></div></div><p>
914This sample begins with only the equality constraints of a problem.  The
915inequalities are considered to be part of a pool of available cuts in much the
916same way as is done in integer programming.  However, in this case, the cuts are
917not "generated", they are simply the inequalities of the problem.
918</p></div><div class="section" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id4758398"></a>decompose.cpp</h3></div></div></div><p>
919More on this sample coming soon!
920</p></div><div class="section" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id4758414"></a>driver2.cpp</h3></div></div></div><p>
921More on this sample coming soon!
922</p></div></div><div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id4758428"></a>Common CLP Tasks in the Samples</h2></div></div></div><p>
923Below is a listing of a number of common CLP tasks, such as loading a problem
924from an MPS file, matched with a list of each Sample file which illustrates the
925performance of a given task.
926</p><div class="table"><a name="id4758440"></a><p class="title"><b>Table 4.4. Contents of the Samples directory</b></p><table summary="Contents of the Samples directory" border="0"><colgroup><col><col><col></colgroup><thead><tr><th align="left" valign="bottom">
927        CLP Task(s)
928        </th><th>
929        Method(s)
930        </th><th align="left" valign="bottom">
931        Sample(s)
932        </th></tr></thead><tbody><tr><td>
933        Read problem from MPS file
934        </td><td>
935        <div class="literallayout"><p><tt class="function">int readMps(const char *filename)</tt></p></div>
936        </td><td>
937        <a href="http://www-124.ibm.com/developerworks/opensource/cvs/coin/COIN/Clp/Samples/defaults.cpp" target="_top"><tt class="filename">defaults.cpp</tt></a>, <a href="http://www-124.ibm.com/developerworks/opensource/cvs/coin/COIN/Clp/Samples/driver.cpp" target="_top"><tt class="filename">driver.cpp</tt></a>, <a href="http://www-124.ibm.com/developerworks/opensource/cvs/coin/COIN/Clp/Samples/minimum.cpp" target="_top"><tt class="filename">minimum.cpp</tt></a>
938        </td></tr><tr><td>
939        Solve by primal method
940        </td><td>
941        <div class="literallayout"><p><tt class="function">int primal()</tt></p></div>
942        </td><td>
943        <a href="http://www-124.ibm.com/developerworks/opensource/cvs/coin/COIN/Clp/Samples/driver.cpp" target="_top"><tt class="filename">driver.cpp</tt></a>
944        </td></tr><tr><td>
945        Choose pivot rule
946        </td><td>
947        <div class="literallayout"><p><tt class="function">void setPrimalColumnPivotAlgorithm(ClpPrimalColumnPivot &amp;choice)</tt><br>
948        <tt class="function">void setDualRowPivotAlgorithm(ClpDualRowPivot &amp;choice)</tt></p></div>
949        </td><td>
950        <a href="http://www-124.ibm.com/developerworks/opensource/cvs/coin/COIN/Clp/Samples/defaults.cpp" target="_top"><tt class="filename">defaults.cpp</tt></a>
951        </td></tr><tr><td>
952        Get/set infeasibility cost
953        </td><td>
954        <div class="literallayout"><p><tt class="function">void setInfeasibilityCost(double value)</tt><br>
955        <tt class="function">void setInfeasibilityCost(double value)</tt></p></div>
956        </td><td>
957        <a href="http://www-124.ibm.com/developerworks/opensource/cvs/coin/COIN/Clp/Samples/defaults.cpp" target="_top"><tt class="filename">defaults.cpp</tt></a>
958        </td></tr><tr><td>
959        Get string/"double"/integer information
960        </td><td>
961        <div class="literallayout"><p><tt class="function">bool getStrParam(ClpStrParam key, std::string &amp;value) const</tt><br>
962        <tt class="function">bool getDblParam(ClpDblParam key, double &amp;value) const</tt><br>
963        <tt class="function">bool  getIntParam (ClpIntParam key, int &amp;value) const </tt></p></div>
964        </td><td>
965        <a href="http://www-124.ibm.com/developerworks/opensource/cvs/coin/COIN/Clp/Samples/defaults.cpp" target="_top"><tt class="filename">defaults.cpp</tt></a>
966        </td></tr><tr><td>
967        Set maximum number of iterations
968        </td><td>
969        <div class="literallayout"><p><tt class="function">void setMaximumIterations(int value)</tt></p></div>
970        </td><td>
971        <a href="http://www-124.ibm.com/developerworks/opensource/cvs/coin/COIN/Clp/Samples/defaults.cpp" target="_top"><tt class="filename">defaults.cpp</tt></a>
972        </td></tr><tr><td>
973        Check solution status
974        </td><td>
975        <div class="literallayout"><p><tt class="function">int status() const</tt><br>
976        <tt class="function">bool isAbandoned() const</tt><br>
977        <tt class="function">bool isProvenOptimal() const</tt><br>
978        <tt class="function">bool isProvenPrimalInfeasible() const</tt><br>
979        <tt class="function">bool isProvenDualInfeasible() const</tt><br>
980        <tt class="function">bool isPrimalObjectiveLimitReached() const</tt><br>
981        <tt class="function">bool isDualObjectiveLimitReached() const</tt><br>
982        <tt class="function">bool isIterationLimitReached() const</tt><br>
983        <tt class="function"></tt><br>
984        <tt class="function"></tt></p></div>
985        </td><td>
986       
987        </td></tr><tr><td>
988       
989        </td><td>
990       
991        </td><td>
992       
993        </td></tr><tr><td>
994       
995        </td><td>
996       
997        </td><td>
998       
999        </td></tr><tr><td>
1000       
1001        </td><td>
1002       
1003        </td><td>
1004       
1005        </td></tr><tr><td>
1006       
1007        </td><td>
1008       
1009        </td><td>
1010       
1011        </td></tr><tr><td>
1012       
1013        </td><td>
1014       
1015        </td><td>
1016       
1017        </td></tr></tbody></table></div></div></div><div class="chapter" lang="en"><div class="titlepage"><div><div><h2 class="title"><a name="clpexe"></a>Chapter 5. 
1018  The CLP Executable
1019  </h2></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="section"><a href="#id4760280">Quick Start</a></span></dt><dt><span class="section"><a href="#id4760804">
1020  Online Help and Basic Usage
1021  </a></span></dt><dt><span class="section"><a href="#id4760964">A Sample Session</a></span></dt></dl></div><div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id4760280"></a>Quick Start</h2></div></div></div><p>
1022  The result of <b class="userinput"><tt>make unitTest</tt></b> (executed in
1023  <tt class="filename">COIN/Clp</tt>) is an executable
1024  <tt class="filename">clp</tt> as well as the CLP and COIN libraries.
1025  The executable can be used to perform various unit tests, but can also be used
1026  as a standalone solver.  As the executable has a very simple solution file format,
1027  the user may wish to modify <tt class="filename">COIN/Clp/Test/ClpMain.cpp</tt>,
1028  which contains the source of the executable (modifications could even be
1029  offered as a contribution to CLP).
1030  </p><p>
1031  The <tt class="filename">clp</tt> executable operates in command line mode or
1032  prompted mode.  Entering <b class="userinput"><tt>clp</tt></b> will invoke the prompted
1033  mode, while <b class="userinput"><tt>clp &lt;filename&gt;</tt></b> will import a problem
1034  in MPS format from <tt class="filename">filename</tt>, solve it using the dual
1035  simplex method and exit. The command
1036  <b class="userinput"><tt>clp &lt;filename&gt; -primalsimplex</tt></b> instructs the
1037  executable tp import a file and solve using the primal simplex method.  An
1038  additional solitary dash ("<b class="userinput"><tt>-</tt></b>") starts the
1039  prompt mode once the execution of the initial command has been completed.  The
1040  "<b class="userinput"><tt>-</tt></b>" is necessary as part of the command;
1041  invoking prompt mode as a separate command will result in the loss of problem
1042  information related to the initial command.  So, the following sequences of commands
1043  are equivalent in the sense that both maximize a problem using the dual
1044  simplex method and write a solution to file:
1045  <tt class="filename">solfile</tt>:
1046  </p><div class="blockquote"><blockquote class="blockquote"><div class="literallayout"><p><br>
1047    <tt class="prompt">$</tt> <b class="userinput"><tt><span><b class="command">clp</b></span> <i class="replaceable"><tt>filename</tt></i> -maximize -dualsimplex -solution solfile</tt></b><br>
1048    </p></div></blockquote></div><p>
1049  </p><div class="blockquote"><blockquote class="blockquote"><div class="literallayout"><p><br>
1050    <tt class="prompt">$</tt> <b class="userinput"><tt><span><b class="command">clp</b></span> <i class="replaceable"><tt>filename</tt></i> -maximize -</tt></b><br>
1051    <tt class="prompt">Clp:</tt><b class="userinput"><tt><span><b class="command">duals</b></span></tt></b><br>
1052    <tt class="prompt">Clp:</tt><b class="userinput"><tt><span><b class="command">solution</b></span> solfile</tt></b><br>
1053    <tt class="prompt">Clp:</tt><b class="userinput"><tt><span><b class="command">quit</b></span></tt></b><br>
1054    </p></div></blockquote></div><p>
1055  </p><p>
1056  The executable is at a very early stage of development.  Comments and
1057  suggestions would be appreciated.
1058  </p></div><div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id4760804"></a>
1059  Online Help and Basic Usage
1060  </h2></div></div></div><p>
1061  The executable has some command-completion functionality as well as some online
1062  help.  Below is a table with some examples which summarize these capabilities.
1063  </p><div class="table"><a name="id4760816"></a><p class="title"><b>Table 5.1. Command examples for the clp executable</b></p><table summary="Command examples for the clp executable" border="0"><colgroup><col><col></colgroup><thead><tr><th align="left">
1064        Command    
1065        </th><th align="left">
1066        Result
1067        </th></tr></thead><tbody><tr><td>
1068        <span><b class="command">?</b></span>
1069        </td><td>
1070        Gives a list of all  commands
1071        </td></tr><tr><td>
1072        <span><b class="command">p?</b></span>
1073        </td><td>
1074        Gives a list of all commands which begin with &lt;p&gt;.
1075        </td></tr><tr><td>
1076        <span><b class="command">p??</b></span>
1077        </td><td>
1078        Gives a list of all commands which begin with &lt;p&gt;., with a short
1079        explanation for each.
1080        </td></tr><tr><td>
1081        <span><b class="command">primals??</b></span>
1082        </td><td>
1083        If is this is enough to uniquely determine a command (in this example,
1084        <span><b class="command">primalS</b></span>, for primal simplex), a long explanation
1085        is given.
1086        </td></tr></tbody></table></div><p>
1087  In addition, matching a name without a ? will either execute the command or give
1088  the value of the corresponding parameter as follows:
1089  <b class="userinput"><tt><span><b class="command">primalw</b></span></tt></b> will give the current value of  the
1090  <i class="parameter"><tt>primalWeight</tt></i> parameter while
1091  <b class="userinput"><tt><span><b class="command">primalw 1.0e7</b></span></tt></b> will change it to
1092  <tt class="literal">1.0e7</tt>.
1093  </p></div><div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id4760964"></a>A Sample Session</h2></div></div></div><p>
1094  Below is a sample CLP executable prompt-mode session.  A small problem is
1095  loaded and solved under various conditions with the primal and dual
1096  simplex methods.  Note the use of the <span><b class="command">allslack</b></span> command; it
1097  sets the basis to all slacks and resets the solution.
1098  </p><p>
1099    </p><pre class="screen">
1100    <tt class="prompt">$</tt><span><b class="command">clp</b></span>
1101    Coin LP version 0.99.9, build Sep 14 2004
1102    Clp takes input from arguments ( - switches to stdin)
1103    Enter ? for list of commands or help
1104    <tt class="prompt">Clp:</tt><b class="userinput"><tt><span><b class="command">import</b></span><tt class="filename">../Mps/Sample/p0033.mps</tt></tt></b>
1105    At line 15 NAME          P0033
1106    At line 16 ROWS
1107    At line 34 COLUMNS
1108    At line 109 RHS
1109    At line 118 BOUNDS
1110    At line 152 ENDATA
1111    Problem P0033 has 16 rows, 33 columns and 98 elements
1112    Model was imported from ./../Mps/Sample/p0033.mps in 0 seconds
1113    <tt class="prompt">Clp:</tt><b class="userinput"><tt><span><b class="command">primals</b></span></tt></b>
1114    Presolve 15 (-1) rows, 32 (-1) columns and 97 (-1) elements
1115    0  Obj 0 Primal inf 27.2175 (10) Dual inf 6.42094e+11 (32)
1116    32  Obj 2520.57
1117    Optimal - objective value 2520.57
1118    After Postsolve, objective 2520.57, infeasibilities - dual 0 (0), primal 0 (0)
1119    Optimal objective 2520.571739 - 32 iterations time 0.012, Presolve 0.01
1120    <tt class="prompt">Clp:</tt><b class="userinput"><tt><span><b class="command">max</b></span></tt></b>
1121    <tt class="prompt">Clp:</tt><b class="userinput"><tt><span><b class="command">primals</b></span></tt></b>
1122    Presolve 11 (-5) rows, 25 (-8) columns and 84 (-14) elements
1123    0  Obj 4807.92 Dual inf 1700.71 (15)
1124    End of values pass after 2 iterations
1125    2  Obj 4921.7 Dual inf 580.637 (5)
1126    9  Obj 5299.7
1127    Optimal - objective value 5299.7
1128    After Postsolve, objective 5299.7, infeasibilities - dual 643.608 (9), primal 27.0826 (10)
1129    Presolved model was optimal, full model needs cleaning up
1130    0  Obj 5299.7
1131    0  Obj 5299.7
1132    Optimal - objective value 5299.7
1133    Optimal objective 5299.698868 - 9 iterations time 0.022, Presolve 0.02
1134    <tt class="prompt">Clp:</tt><b class="userinput"><tt><span><b class="command">allslack</b></span></tt></b>
1135    <tt class="prompt">Clp:</tt><b class="userinput"><tt><span><b class="command">duals</b></span></tt></b>
1136    Presolve 11 (-5) rows, 25 (-8) columns and 84 (-14) elements
1137    0  Obj 2752 Primal inf 24.4867 (6) Dual inf 4280.55 (25)
1138    8  Obj 5299.7
1139    Optimal - objective value 5299.7
1140    After Postsolve, objective 5299.7, infeasibilities - dual 704.58 (8), primal 27.0792 (10)
1141    Presolved model was optimal, full model needs cleaning up
1142    0  Obj 5299.7
1143    0  Obj 5299.7
1144    Optimal - objective value 5299.7
1145    Optimal objective 5299.698868 - 8 iterations time 0.032, Presolve 0.01
1146    <tt class="prompt">Clp:</tt><b class="userinput"><tt><span><b class="command">min</b></span></tt></b>
1147    <tt class="prompt">Clp:</tt><b class="userinput"><tt><span><b class="command">duals</b></span></tt></b>
1148    Presolve 15 (-1) rows, 32 (-1) columns and 97 (-1) elements
1149    0  Obj 5299.7 Dual inf 4632.26 (28)
1150    16  Obj 2520.57
1151    Optimal - objective value 2520.57
1152    After Postsolve, objective 2520.57, infeasibilities - dual 2052.5 (13), primal 27.1143 (10)
1153    Presolved model was optimal, full model needs cleaning up
1154    0  Obj 2520.57
1155    0  Obj 2520.57
1156    Optimal - objective value 2520.57
1157    Optimal objective 2520.571739 - 16 iterations time 0.012, Presolve 0.01
1158    <tt class="prompt">Clp:</tt><b class="userinput"><tt><span><b class="command">allslack</b></span></tt></b>
1159    <tt class="prompt">Clp:</tt><b class="userinput"><tt><span><b class="command">presolve off</b></span></tt></b>
1160    <tt class="prompt">Clp:</tt><b class="userinput"><tt><span><b class="command">primals</b></span></tt></b>
1161    0  Obj 0 Primal inf 27.2175 (10) Dual inf 6.39167e+11 (32)
1162    32  Obj 2520.57
1163    Optimal - objective value 2520.57
1164    Optimal objective 2520.571739 - 32 iterations time 0.002
1165    <tt class="prompt">Clp:</tt><b class="userinput"><tt><span><b class="command">allslack</b></span></tt></b>
1166    <tt class="prompt">Clp:</tt><b class="userinput"><tt><span><b class="command">maxIt</b></span> 10</tt></b>
1167    maxIterations was changed from 99999999 to 10
1168    <tt class="prompt">Clp:</tt><b class="userinput"><tt><span><b class="command">primals</b></span></tt></b>
1169    0  Obj 0 Primal inf 27.2175 (10) Dual inf 6.39167e+11 (32)
1170    Stopped - objective value 4.24664e+10
1171    Stopped objective 4.246637759e+10 - 10 iterations time 0.002
1172    <tt class="prompt">Clp:</tt><b class="userinput"><tt><span><b class="command">quit</b></span></tt></b>
1173    </pre><p>
1174  </p></div></div><div class="chapter" lang="en"><div class="titlepage"><div><div><h2 class="title"><a name="messages"></a>Chapter 6. 
1175  Messages
1176  </h2></div></div></div><p>
1177  Some of the more common messages and codes passed by CLP are listed in the
1178  tables below.  This is list is not meant to exhaustive.  The notation is as
1179  for printf from "C":
1180  </p><div class="itemizedlist"><ul type="disc"><li>
1181    <tt class="computeroutput">%s</tt> is a string
1182    </li><li>
1183    <tt class="computeroutput">%d</tt> is an integer
1184    </li><li>
1185    <tt class="computeroutput">%g</tt> or <tt class="computeroutput">%f</tt>
1186    is a floating point value
1187    </li></ul></div><div class="table"><a name="id4760092"></a><p class="title"><b>Table 6.1. 
1188  COIN Messages passed at or above logging level 1
1189  </b></p><table summary="
1190  COIN Messages passed at or above logging level 1
1191  " border="0"><colgroup><col><col><col><col></colgroup><thead><tr><th align="center">
1192      Code
1193      </th><th align="center">
1194      Area
1195      </th><th align="left">
1196      </th><th align="left">
1197      Text and notes
1198      </th></tr></thead><tbody><tr><td align="left">
1199      1
1200      </td><td align="center">
1201      MPSREAD
1202      </td><td align="left">
1203      </td><td align="left">
1204      <tt class="computeroutput">At line %d %s</tt>
1205      </td></tr><tr><td colspan="3" align="left">
1206      </td><td align="left">
1207      <p>
1208      This just prints out NAME line, ROW line, etc
1209      </p>
1210      </td></tr><tr><td align="left">
1211      2
1212      </td><td align="center">
1213      MPSREAD
1214      </td><td align="left">
1215      </td><td align="left">
1216      <tt class="computeroutput">Problem %s has %d rows, %d columns and %d elements
1217      </tt>
1218      </td></tr><tr><td colspan="3" align="left">
1219      </td><td align="left">
1220      <p>
1221      This gives statistics after reading an MPS file
1222      </p>
1223      </td></tr><tr><td align="left">
1224      8
1225      </td><td align="center">
1226      MPSREAD
1227      </td><td align="left">
1228      </td><td align="left">
1229      <tt class="computeroutput">%s read with %d errors
1230      </tt>
1231      </td></tr><tr><td colspan="3" align="left">
1232      </td><td align="left">
1233      <p>
1234      This gives error statistics for file
1235      </p>
1236      </td></tr><tr><td align="left">
1237      505
1238      </td><td align="center">
1239      PRESOLVE
1240      </td><td align="left">
1241      </td><td align="left">
1242      <tt class="computeroutput">
1243      Presolved poblem not optimal, resolve after postsolve
1244      </tt>
1245      </td></tr><tr><td colspan="3" align="left">
1246      </td><td align="left">
1247      <p>
1248      This could be because it was not feasible or because of maximum
1249      iterations.  If this message occurs then consider using primal clean up
1250      </p>
1251      </td></tr><tr><td align="left">
1252      506
1253      </td><td align="center">
1254      PRESOLVE
1255      </td><td align="left">
1256      </td><td align="left">
1257      <tt class="computeroutput">
1258      Presolve %d (%d) rows, %d (%d) columns and %d (%d) elements
1259      </tt>
1260      </td></tr><tr><td colspan="3" align="left">
1261      </td><td align="left">
1262      <p>
1263      The first number is the number after presolve and the number
1264      in parentheses is amount of reduction
1265      </p>
1266      </td></tr><tr><td align="left">
1267      510
1268      </td><td align="center">
1269      PRESOLVE
1270      </td><td align="left">
1271      </td><td align="left">
1272      <tt class="computeroutput">
1273      Presolve is modifying %d integer bounds and re-presolving
1274      </tt>
1275      </td></tr><tr><td colspan="3" align="left">
1276      </td><td align="left">
1277      <p>
1278      If presolve determines at the end that an integer variable have its bounds
1279      changed then it will repeat the entrire presolve
1280      </p>
1281      </td></tr><tr><td align="left">
1282      511
1283      </td><td align="center">
1284      PRESOLVE
1285      </td><td align="left">
1286      </td><td align="left">
1287      <tt class="computeroutput">
1288      After Postsolve, objective %g, infeasibilities - dual %g (%d),
1289      primal %g (%d)
1290      </tt>
1291      </td></tr><tr><td colspan="3" align="left">
1292      </td><td align="left">
1293      <p>
1294      This gives the state after postsolve - this gives the objective value
1295      and the sum of dual and primal infeasibilities with the number of
1296      infeasibilities in parentheses.  Hopefully these should be zero
1297      </p>
1298      </td></tr><tr><td align="left">
1299      512
1300      </td><td align="center">
1301      PRESOLVE
1302      </td><td align="left">
1303      </td><td align="left">
1304      <tt class="computeroutput">
1305      Presolved model was optimal, full model needs cleaning up
1306      </tt>
1307      </td></tr><tr><td colspan="3" align="left">
1308      </td><td align="left">
1309      <p>
1310      If the numbers in previous message (511) were large then maybe we need to
1311      know, if small then that's life
1312      </p>
1313      </td></tr></tbody></table></div><div class="table"><a name="id4762574"></a><p class="title"><b>Table 6.2. 
1314  CLP Messages passed at or above logging level 1
1315  </b></p><table summary="
1316  CLP Messages passed at or above logging level 1
1317  " border="0"><colgroup><col><col><col><col></colgroup><thead><tr><th align="center">
1318      Code
1319      </th><th align="center">
1320      Area
1321      </th><th align="left">
1322      </th><th align="left">
1323      Text and notes
1324      </th></tr></thead><tbody><tr><td align="left">
1325      1
1326      </td><td align="center">
1327      SIMPLEX
1328      </td><td align="left">
1329      </td><td align="left">
1330      <tt class="computeroutput">
1331      Primal infeasible - objective value %g
1332      </tt>
1333      </td></tr><tr><td colspan="3" align="left">
1334      </td><td align="left">
1335      <p>
1336      You may need to look at previous messages or use methods.  Such as
1337      sumPrimalInfeasibilities() to find cause
1338      </p>
1339      </td></tr><tr><td align="left">
1340      2
1341      </td><td align="center">
1342      SIMPLEX
1343      </td><td align="left">
1344      </td><td align="left">
1345      <tt class="computeroutput">
1346      Dual infeasible - objective value %g
1347      </tt>
1348      </td></tr><tr><td colspan="3" align="left">
1349      </td><td align="left">
1350      <p>
1351      You may need to look at previous messages or use methods.  Such as
1352      sumDualInfeasibilities() to find cause
1353      </p>
1354      </td></tr><tr><td align="left">
1355      3
1356      </td><td align="center">
1357      SIMPLEX
1358      </td><td align="left">
1359      </td><td align="left">
1360      <tt class="computeroutput">
1361      Stopped - objective value %g
1362      </tt>
1363      </td></tr><tr><td colspan="3" align="left">
1364      </td><td align="left">
1365      <p>
1366      The algorithm stopped as requested by the user.
1367      </p>
1368      </td></tr><tr><td align="left">
1369      4
1370      </td><td align="center">
1371      SIMPLEX
1372      </td><td align="left">
1373      </td><td align="left">
1374      <tt class="computeroutput">
1375      Stopped due to errors - objective value %g
1376      </tt>
1377      </td></tr><tr><td colspan="3" align="left">
1378      </td><td align="left">
1379      <p>
1380      Switch on log level 2 to see information on size of elements etc.  If they
1381      look reasonable then maybe we need to know.
1382      </p>
1383      </td></tr><tr><td align="left">
1384      5
1385      </td><td align="center">
1386      SIMPLEX
1387      </td><td align="left">
1388      </td><td align="left">
1389      <tt class="computeroutput">
1390      %d Obj %g Primal inf %g (%d) Dual inf %g (%d)
1391      </tt>
1392      </td></tr><tr><td colspan="3" align="left">
1393      </td><td align="left">
1394      <p>
1395      At each re-factorization this gives the number of iterations and the value
1396      of the objective function.  If there are primal infeasibilities then the
1397      sum and number are given and similarly for dual infeasibilities.
1398      (This is a simplified form of message.)
1399      </p>
1400      </td></tr><tr><td align="left">
1401      14
1402      </td><td align="center">
1403      SIMPLEX
1404      </td><td align="left">
1405      </td><td align="left">
1406      <tt class="computeroutput">
1407      Perturbing problem by %g % of %g
1408      </tt>
1409      </td></tr><tr><td colspan="3" align="left">
1410      </td><td align="left">
1411      <p>
1412      There is more to this message but if the user sees this then s/he has
1413      chosen to perturb the problem or the algorithm has decided to do so.
1414      If the numbers look too large the user may wish to think again.
1415      </p>
1416      </td></tr><tr><td align="left">
1417      19
1418      </td><td align="center">
1419      SIMPLEX
1420      </td><td align="left">
1421      </td><td align="left">
1422      <tt class="computeroutput">
1423      %d variables/rows fixed as scaled bounds too close
1424      </tt>
1425      </td></tr><tr><td colspan="3" align="left">
1426      </td><td align="left">
1427      <p>
1428      If this occurs look carefully at your input data
1429      </p>
1430      </td></tr><tr><td align="left">
1431      24
1432      </td><td align="center">
1433      SIMPLEX
1434      </td><td align="left">
1435      </td><td align="left">
1436      <tt class="computeroutput">
1437      Matrix will be packed to eliminate small elements
1438      </tt>
1439      </td></tr><tr><td colspan="3" align="left">
1440      </td><td align="left">
1441      <p>
1442      If this occurs the user should look carefully at data.
1443      </p>
1444      </td></tr><tr><td align="left">
1445      26
1446      </td><td align="center">
1447      SIMPLEX
1448      </td><td align="left">
1449      </td><td align="left">
1450      <tt class="computeroutput">
1451      Matrix will be packed to eliminate %d duplicate elements
1452      </tt>
1453      </td></tr><tr><td colspan="3" align="left">
1454      </td><td align="left">
1455      <p>
1456      If this occurs the user should look carefully at data.
1457      </p>
1458      </td></tr><tr><td align="left">
1459      28
1460      </td><td align="center">
1461      SIMPLEX
1462      </td><td align="left">
1463      </td><td align="left">
1464      <tt class="computeroutput">
1465      Crash put %d variables in basis, %d dual infeasibilities
1466      </tt>
1467      </td></tr><tr><td colspan="3" align="left">
1468      </td><td align="left">
1469      <p>
1470     
1471      </p>
1472      </td></tr><tr><td align="left">
1473      29
1474      </td><td align="center">
1475      SIMPLEX
1476      </td><td align="left">
1477      </td><td align="left">
1478      <tt class="computeroutput">
1479      End of values pass after %d iterations
1480      </tt>
1481      </td></tr><tr><td colspan="3" align="left">
1482      </td><td align="left">
1483      <p>
1484      ??? If primal(1) or dual(1) the a sweep through model is made and this
1485      signals end of pass.
1486      </p>
1487      </td></tr></tbody></table></div><div class="table"><a name="id4763258"></a><p class="title"><b>Table 6.3. 
1488  COIN Messages passed at or above logging level 0
1489  </b></p><table summary="
1490  COIN Messages passed at or above logging level 0
1491  " border="0"><colgroup><col><col><col><col></colgroup><thead><tr><th align="center">
1492      Code
1493      </th><th align="center">
1494      Area
1495      </th><th align="left">
1496      </th><th align="left">
1497      Text and notes
1498      </th></tr></thead><tbody><tr><td align="left">
1499      3001
1500      </td><td align="center">
1501      MPSREAD
1502      </td><td align="left">
1503      </td><td align="left">
1504      <tt class="computeroutput">
1505      Illegal value for %s of %g
1506      </tt>
1507      </td></tr><tr><td colspan="3" align="left">
1508      </td><td align="left">
1509      <p>
1510      String will be "infinity" if setInfinity passed bad value,
1511      or "default integer bound" if setDefaultBound passed bad value.
1512      </p>
1513      </td></tr><tr><td align="left">
1514      3002
1515      </td><td align="center">
1516      MPSREAD
1517      </td><td align="left">
1518      </td><td align="left">
1519      <tt class="computeroutput">
1520      Bad image at line %d &lt; %s &gt;
1521      </tt>
1522      </td></tr><tr><td colspan="3" align="left">
1523      </td><td align="left">
1524      <p>
1525      This gives line number and the offending line
1526      </p>
1527      </td></tr><tr><td align="left">
1528      3003
1529      </td><td align="center">
1530      MPSREAD
1531      </td><td align="left">
1532      </td><td align="left">
1533      <tt class="computeroutput">
1534      Duplicate objective at line %d &lt; %s &gt;
1535      </tt>
1536      </td></tr><tr><td colspan="3" align="left">
1537      </td><td align="left">
1538      <p>
1539      An objective row appears twice in one column
1540      </p>
1541      </td></tr><tr><td align="left">
1542      3004
1543      </td><td align="center">
1544      MPSREAD
1545      </td><td align="left">
1546      </td><td align="left">
1547      <tt class="computeroutput">
1548      Duplicate row %s at line %d %s
1549      </tt>
1550      </td></tr><tr><td colspan="3" align="left">
1551      </td><td align="left">
1552      <p>
1553      The named row appears twice in one column.
1554      </p>
1555      </td></tr><tr><td align="left">
1556      3005
1557      </td><td align="center">
1558      MPSREAD
1559      </td><td align="left">
1560      </td><td align="left">
1561      <tt class="computeroutput">
1562      No match for row %s at line %d &lt; %s &gt;
1563      </tt>
1564      </td></tr><tr><td colspan="3" align="left">
1565      </td><td align="left">
1566      <p>
1567      The named row did not appear in ROWS section.
1568      </p>
1569      </td></tr><tr><td align="left">
1570      3006
1571      </td><td align="center">
1572      MPSREAD
1573      </td><td align="left">
1574      </td><td align="left">
1575      <tt class="computeroutput">
1576      No match for column at line %d &lt; %s &gt;
1577      </tt>
1578      </td></tr><tr><td colspan="3" align="left">
1579      </td><td align="left">
1580      <p>
1581      The named column (in BOUNDS section) did not appear in COLUMNS section.
1582      </p>
1583      </td></tr><tr><td align="left">
1584      6001
1585      </td><td align="center">
1586      MPSREAD
1587      </td><td align="left">
1588      </td><td align="left">
1589      <tt class="computeroutput">
1590      Unable to open mps input file %s
1591      </tt>
1592      </td></tr><tr><td colspan="3" align="left">
1593      </td><td align="left">
1594      <p>
1595     
1596      </p>
1597      </td></tr><tr><td align="left">
1598      6002
1599      </td><td align="center">
1600      MPSREAD
1601      </td><td align="left">
1602      </td><td align="left">
1603      <tt class="computeroutput">
1604      Unknown image %s at line %d of file %s
1605      </tt>
1606      </td></tr><tr><td colspan="3" align="left">
1607      </td><td align="left">
1608      <p>
1609      The Mps reader could not make sense of the image file specified.
1610      </p>
1611      </td></tr><tr><td align="left">
1612      6003
1613      </td><td align="center">
1614      MPSREAD
1615      </td><td align="left">
1616      </td><td align="left">
1617      <tt class="computeroutput">
1618      Consider the possibility of a compressed file which zlib is unable to read.
1619      </tt>
1620      </td></tr><tr><td colspan="3" align="left">
1621      </td><td align="left">
1622      <p>
1623      Some .gz files can not be read by zlib.  Using gunzip and then gzip
1624      normally cures problem.
1625      </p>
1626      </td></tr><tr><td align="left">
1627      6004
1628      </td><td align="center">
1629      MPSREAD
1630      </td><td align="left">
1631      </td><td align="left">
1632      <tt class="computeroutput">
1633      EOF on file %s
1634      </tt>
1635      </td></tr><tr><td colspan="3" align="left">
1636      </td><td align="left">
1637      <p>
1638      The Mps reader did not find expected section marker.     
1639      </p>
1640      </td></tr><tr><td align="left">
1641      6005
1642      </td><td align="center">
1643      MPSREAD
1644      </td><td align="left">
1645      </td><td align="left">
1646      <tt class="computeroutput">
1647      Returning as too many errors
1648      </tt>
1649      </td></tr><tr><td colspan="3" align="left">
1650      </td><td align="left">
1651      <p>
1652      The reader has put out 100 messages and is giving up.
1653      </p>
1654      </td></tr><tr><td align="left">
1655      507
1656      </td><td align="center">
1657      PRESOLVE
1658      </td><td align="left">
1659      </td><td align="left">
1660      <tt class="computeroutput">
1661      Presolve determined that the problem is infeasible with tolerance of %g
1662      </tt>
1663      </td></tr><tr><td colspan="3" align="left">
1664      </td><td align="left">
1665      <p>
1666      If you want you can try with a larger tolerance
1667      </p>
1668      </td></tr><tr><td align="left">
1669      508
1670      </td><td align="center">
1671      PRESOLVE
1672      </td><td align="left">
1673      </td><td align="left">
1674      <tt class="computeroutput">
1675      Presolve thinks problem is unbounded
1676      </tt>
1677      </td></tr><tr><td colspan="3" align="left">
1678      </td><td align="left">
1679      <p>
1680      Perhaps the user should maximize if initially minimizing or vice versa.
1681      </p>
1682      </td></tr><tr><td align="left">
1683      509
1684      </td><td align="center">
1685      PRESOLVE
1686      </td><td align="left">
1687      </td><td align="left">
1688      <tt class="computeroutput">
1689      Presolve thinks problem is infeasible AND unbounded???
1690      </tt>
1691      </td></tr><tr><td colspan="3" align="left">
1692      </td><td align="left">
1693      <p>
1694      If you get this message we want to know
1695      </p>
1696      </td></tr></tbody></table></div><div class="table"><a name="id4764037"></a><p class="title"><b>Table 6.4. 
1697  CLP Messages passed at or above logging level 0
1698  </b></p><table summary="
1699  CLP Messages passed at or above logging level 0
1700  " border="0"><colgroup><col><col><col><col></colgroup><thead><tr><th align="center">
1701      Code
1702      </th><th align="center">
1703      Area
1704      </th><th align="left">
1705      </th><th align="left">
1706      Text and notes
1707      </th></tr></thead><tbody><tr><td align="left">
1708      3002
1709      </td><td align="center">
1710      SIMPLEX
1711      </td><td align="left">
1712      </td><td align="left">
1713      <tt class="computeroutput">
1714      Not solving empty problem - %d rows, %d columns and %d elements
1715      </tt>
1716      </td></tr><tr><td colspan="3" align="left">
1717      </td><td align="left">
1718      <p>
1719      Test problem size before solving.
1720      </p>
1721      </td></tr><tr><td align="left">
1722      6002
1723      </td><td align="center">
1724      SIMPLEX
1725      </td><td align="left">
1726      </td><td align="left">
1727      <tt class="computeroutput">
1728      %d bad bound pairs or bad objectives were found
1729      </tt>
1730      </td></tr><tr><td colspan="3" align="left">
1731      </td><td align="left">
1732      <p>
1733      Either the value in the objective was too large or a lower bound was
1734      greater than an upper bound.
1735      </p>
1736      </td></tr><tr><td align="left">
1737      6003
1738      </td><td align="center">
1739      SIMPLEX
1740      </td><td align="left">
1741      </td><td align="left">
1742      <tt class="computeroutput">
1743      Matrix has %d large values, first at column %d, row %d is %g
1744      </tt>
1745      </td></tr><tr><td colspan="3" align="left">
1746      </td><td align="left">
1747      <p>
1748      Some of the values in matrix are ridiculous.
1749      </p>
1750      </td></tr><tr><td align="left">
1751      6004
1752      </td><td align="center">
1753      SIMPLEX
1754      </td><td align="left">
1755      </td><td align="left">
1756      <tt class="computeroutput">
1757      Can't get out of loop ...
1758      </tt>
1759      </td></tr><tr><td colspan="3" align="left">
1760      </td><td align="left">
1761      <p>
1762     
1763      </p>
1764      </td></tr></tbody></table></div><p>
1765  There are also messages available at log level 2 (the most likely useful relate
1766  to scaling), and will be addressed in a future version of this User Guide.
1767  </p></div><div class="appendix" lang="en"><div class="titlepage"><div><div><h2 class="title"><a name="id4766717"></a>Appendix A. FAQ</h2></div></div></div><div class="qandaset"><dl><dt>Q: <a href="#id4766796">
1768  What is CLP?
1769  </a></dt><dt>Q: <a href="#id4766755">
1770  What are some of the features of CLP?
1771  </a></dt><dt>Q: <a href="#id4767748">
1772  How do I obtain and install CLP?
1773  </a></dt><dt>Q: <a href="#id4767784">
1774  Is CLP reliable?
1775  </a></dt><dt>Q: <a href="#id4767816">
1776  On which platforms does CLP run?   
1777  </a></dt><dt>Q: <a href="#id4767867">
1778  Is there any documentation for CLP? 
1779  </a></dt><dt>Q: <a href="#id4767905">
1780  Is CLP as fast as OSL?
1781  </a></dt><dt>Q: <a href="#id4767926">
1782  When will version 1.0 of CLP be available? 
1783  </a></dt><dt>Q: <a href="#id4767958">
1784  The barrier method sounds interesting, what are some of the details?
1785  </a></dt><dt>Q: <a href="#id4767983">
1786  Which Cholesky factorizations codes are supported by CLP's barrier method?
1787  </a></dt><dt>Q: <a href="#id4768047">
1788  When will CLP have a good native ordering?
1789  </a></dt><dt>Q: <a href="#id4768068">
1790  Is the barrier code as mature as the simplex code?
1791  </a></dt><dt>Q: <a href="#id4768093">
1792  Which algorithm should I use for quadratic programming and should I keep an
1793  eye open for any issues?
1794  </a></dt><dt>Q: <a href="#id4768125">
1795  What can the community do to help?
1796  </a></dt></dl><table border="0" summary="Q and A Set"><col align="left" width="1%"><tbody><tr class="question"><td align="left" valign="top"><a name="id4766796"></a><a name="id4766799"></a><b>Q:</b></td><td align="left" valign="top"><p>
1797  What is <a href="http://www.coin-or.org/Clp/" target="_top">CLP</a>?
1798  </p></td></tr><tr class="answer"><td align="left" valign="top"><b>A:</b></td><td align="left" valign="top"><p>
1799  (DN 08/27/04) The <a href="http://www.coin-or.org/" target="_top">COIN-OR</a> LP code
1800  is designed to be a high quality Simplex code provided under the terms of the
1801  <a href="http://opensource.org/licenses/cpl.php" target="_top">Common Public License</a>.
1802  CLP is written in C++, and is primarily intended to be used as a callable
1803  library (though a rudimentary stand-alone executable exists).
1804  The first release was version .90.  The current release is version .99.9.
1805  </p></td></tr><tr class="question"><td align="left" valign="top"><a name="id4766755"></a><a name="id4766757"></a><b>Q:</b></td><td align="left" valign="top"><p>
1806  What are some of the features of CLP?
1807  </p></td></tr><tr class="answer"><td align="left" valign="top"><b>A:</b></td><td align="left" valign="top"><p>
1808  (DN 08/27/04) CLP includes primal and dual Simplex solvers.  Both dual and primal algorithms
1809  can use matrix storage methods provided by the user (0-1 and network matrices
1810  are already supported in addition to the default sparse matrix). The dual algorithm
1811  has Dantzig and Steepest edge row pivot choices; new ones may be provided by
1812  the user. The same is true for the column pivot choice of the primal algorithm.
1813  The primal can also use a non linear cost which should work for piecewise
1814  linear convex functions.  CLP also includes a barrier method for solving LPs.
1815  </p></td></tr><tr class="question"><td align="left" valign="top"><a name="id4767748"></a><a name="id4767750"></a><b>Q:</b></td><td align="left" valign="top"><p>
1816  How do I obtain and install CLP?
1817  </p></td></tr><tr class="answer"><td align="left" valign="top"><b>A:</b></td><td align="left" valign="top"><p>
1818  (DN 08/27/04) Please see the
1819  <a href="http://www.coin-or.org/faqs.html" target="_top">COIN-OR FAQ</a>
1820  for details on how to
1821  <a href="http://www.coin-or.org/faqs.html#ObtainSrcCode" target="_top">obtain</a>
1822  and
1823  <a href="http://www.coin-or.org/faqs.html#BuildCode" target="_top">install</a>
1824  COIN-OR modules.
1825  </p></td></tr><tr class="question"><td align="left" valign="top"><a name="id4767784"></a><a name="id4767786"></a><b>Q:</b></td><td align="left" valign="top"><p>
1826  Is CLP reliable?
1827  </p></td></tr><tr class="answer"><td align="left" valign="top"><b>A:</b></td><td align="left" valign="top"><p>
1828  (DN 09/07/04) CLP has been tested on many problems of up to 1.5 million
1829  constraints and has shown itself as reliable as OSL. It is also being tested
1830  in the context of
1831  SBB
1832  ("Simple Branch and Bound", which is used to solve integer
1833  programs), but more testing is needed before it can get to version 1.0.
1834  SBB has been replaced by <a href="https://projects.coin-or.org/Cbc">Cbc</a>.
1835  </p></td></tr><tr class="question"><td align="left" valign="top"><a name="id4767816"></a><a name="id4767818"></a><b>Q:</b></td><td align="left" valign="top"><p>
1836  On which platforms does CLP run?   
1837  </p></td></tr><tr class="answer"><td align="left" valign="top"><b>A:</b></td><td align="left" valign="top"><p>
1838  (DN 08/27/04) CLP compiles and has been tested (to varying degrees) on the following
1839  platforms:
1840  </p><div class="itemizedlist"><ul type="disc"><li><p>
1841  Linux using g++ version 3.1.1 (or later)
1842  </p></li><li><p>
1843  Windows using Microsoft Visual C++ 6
1844  </p></li><li><p>
1845  Windows using cygwin
1846  </p></li><li><p>
1847  AIX using xIC (not supported in the current Makefile)
1848  </p></li></ul></div></td></tr><tr class="question"><td align="left" valign="top"><a name="id4767867"></a><a name="id4767869"></a><b>Q:</b></td><td align="left" valign="top"><p>
1849  Is there any documentation for CLP? 
1850  </p></td></tr><tr class="answer"><td align="left" valign="top"><b>A:</b></td><td align="left" valign="top"><p>
1851  (DN 09/16/04) An early release of a User Guide is available on the
1852  <a href="http://www.coin-or.org/Clp/documentation.html" target="_top">CLP documentation webpage</a>.
1853  Also available is a list of
1854  <a href="http://www.coin-or.org/Doxygen/Clp/" target="_top">CLP class descriptions</a> generated
1855  by <a href="http://www.doxygen.org" target="_top">Doxygen</a>.
1856  </p></td></tr><tr class="question"><td align="left" valign="top"><a name="id4767905"></a><a name="id4767907"></a><b>Q:</b></td><td align="left" valign="top"><p>
1857  Is CLP as fast as OSL?
1858  </p></td></tr><tr class="answer"><td align="left" valign="top"><b>A:</b></td><td align="left" valign="top"><p>
1859   (DN 08/27/04) CLP uses sparse matrix techniques designed for very large
1860   problems. The design criteria were for it not to be too slow. Some speed
1861   has been sacrificed to make the code less opaque OSL (not difficult!).
1862  </p></td></tr><tr class="question"><td align="left" valign="top"><a name="id4767926"></a><a name="id4767928"></a><b>Q:</b></td><td align="left" valign="top"><p>
1863  When will version 1.0 of CLP be available? 
1864  </p></td></tr><tr class="answer"><td align="left" valign="top"><b>A:</b></td><td align="left" valign="top"><p>
1865  (DN 08/27/04) It is expected that version 1.0 will be released in time for the 2004
1866  <a href="http://www.informs.org" target="_top">INFORMS</a>
1867  <a href="http://www.informs.org/Conf/Denver2004/" target="_top">Annual Meeting</a>
1868  (24-27 October, 2004).
1869  </p></td></tr><tr class="question"><td align="left" valign="top"><a name="id4767958"></a><a name="id4767960"></a><b>Q:</b></td><td align="left" valign="top"><p>
1870  The barrier method sounds interesting, what are some of the details?
1871  </p></td></tr><tr class="answer"><td align="left" valign="top"><b>A:</b></td><td align="left" valign="top"><p>
1872  (DN 08/30/04) The CLP barrier method solves convex QPs as well as LPs. In
1873  general, a barrier method requires implementation of the algorithm, as
1874  well as a fast Cholesky factorization.  CLP provides the algorithm, and is
1875  expected to have a reasonable factorization implementation by the release of
1876  CLP version 1.0.  However, the sparse factorization requires a good ordering
1877  algorithm, which the user is expected to provide (perhaps a better
1878  factorization code as well).
1879  </p></td></tr><tr class="question"><td align="left" valign="top"><a name="id4767983"></a><a name="id4767985"></a><b>Q:</b></td><td align="left" valign="top"><p>
1880  Which Cholesky factorizations codes are supported by CLP's barrier method?
1881  </p></td></tr><tr class="answer"><td align="left" valign="top"><b>A:</b></td><td align="left" valign="top"><p>
1882  (DN 09/16/04) The Cholesky interface is flexible enough so that a variety of Cholesky
1883  ordering and factorization codes can be used.  Interfaces are provided to each
1884  of the following:
1885  </p><div class="itemizedlist"><ul type="disc"><li><p>
1886  Anshul Gupta's WSSMP parallel enabled ordering and factorization code
1887  </p></li><li><p>
1888  Sivan Toledo's TAUCS parallel enabled factorization code (the package includes
1889  third party ordering codes)
1890  </p></li><li><p>
1891  University of Florida's Approximate Minimum Degree (AMD) ordering code (the
1892  CLP native factorization code is used with this ordering code)
1893  </p></li><li><p>
1894  CLP native code: very weak ordering but competitive nonparallel factorization
1895  </p></li><li><p>
1896  Fast dense factorization
1897  </p></li></ul></div><p>
1898  </p></td></tr><tr class="question"><td align="left" valign="top"><a name="id4768047"></a><a name="id4768049"></a><b>Q:</b></td><td align="left" valign="top"><p>
1899  When will CLP have a good native ordering?
1900  </p></td></tr><tr class="answer"><td align="left" valign="top"><b>A:</b></td><td align="left" valign="top"><p>
1901  (DN 09/16/04) The best outcome would be to have an existing ordering code available as part
1902  of the COIN distribution under the CPL.  However, if this is not possible, the
1903  native ordering will be made respectable.
1904  </p></td></tr><tr class="question"><td align="left" valign="top"><a name="id4768068"></a><a name="id4768070"></a><b>Q:</b></td><td align="left" valign="top"><p>
1905  Is the barrier code as mature as the simplex code?
1906  </p></td></tr><tr class="answer"><td align="left" valign="top"><b>A:</b></td><td align="left" valign="top"><p>
1907  (DN 09/16/04) The simplex code has been exposed to user testing for more than a year and
1908  and the principal author, John Forrest, knows more about simplex algorithms
1909  than interior point algorithms, so the answer is "no".  However, it
1910  performs well on test sets and seems to be more reliable than some
1911  commercially available codes (including OSL).
1912  </p></td></tr><tr class="question"><td align="left" valign="top"><a name="id4768093"></a><a name="id4768095"></a><b>Q:</b></td><td align="left" valign="top"><p>
1913  Which algorithm should I use for quadratic programming and should I keep an
1914  eye open for any issues?
1915  </p></td></tr><tr class="answer"><td align="left" valign="top"><b>A:</b></td><td align="left" valign="top"><p>
1916  (DN 09/16/04) The interior point algorithm for quadratic programming is much more elegant
1917  and normally much faster than the quadratic simplex code.  Caution is
1918  suggested with the presolve as not all bugs have been found and squashed when
1919  a quadratic objective is used.  One may wish to switch off the crossover to a
1920  basic feasible solution as the simplex code can be slow.  The sequential
1921  linear code is useful as a "crash" to the simplex code; its
1922  convergence is poor but, say, 100 iterations could set up the problem well for
1923  the simplex code.
1924  </p></td></tr><tr class="question"><td align="left" valign="top"><a name="id4768125"></a><a name="id4768127"></a><b>Q:</b></td><td align="left" valign="top"><p>
1925  What can the community do to help?
1926  </p></td></tr><tr class="answer"><td align="left" valign="top"><b>A:</b></td><td align="left" valign="top"><p>
1927  (DN 09/09/04) A lot!  A good first step would be to join the CLP
1928  <a href="http://www.coin-or.org/mail.html" target="_top">mailing lists</a>.  Some
1929  other possibilities:
1930  </p><div class="itemizedlist"><ul type="disc"><li><p>
1931  Comment on the design
1932  </p></li><li><p>
1933  Break the code, or better yet, mend it.
1934  </p></li><li><p>
1935  Add non-English language support in your own favo(u)rite language.
1936  </p></li><li><p>
1937  Improve the CLP executable.  In particular it would be nice to be able to link
1938  the executable's online help system with the existing CLP Samples (e.g. entering
1939  <b class="userinput"><tt>presol???</tt></b> would give the user references to all
1940  CLP Sample files which use presolve).
1941  </p></li><li><p>
1942  Implement a dual Simplex method for QPs (quadratic programs)
1943  </p></li><li><p>
1944  Implement a parametric Simplex method
1945  </p></li><li><p>
1946  Implement a true network Simplex method (network matrix and factorization
1947  are already in place, but the method is not)
1948  </p></li><li><p>
1949  Fill the holes in the barrier method mentioned above.
1950  </p></li></ul></div></td></tr></tbody></table></div></div><div class="appendix" lang="en"><div class="titlepage"><div><div><h2 class="title"><a name="doxygen"></a>Appendix B. Doxygen</h2></div></div></div><p>
1951There is <a href="http://www.doxygen.org" target="_top">Doxygen</a>
1952content for CLP available online at
1953<a href="http://www.coin-or.org/Doxygen/Clp/index.html" target="_top">
1954http://www.coin-or.org/Doxygen/Clp/index.html</a>.  A local version of the
1955Doxygen content can be generated from the CLP distribution.  To do so, in the
1956directory <tt class="filename">COIN/Clp</tt>, enter <b class="userinput"><tt>make doc</tt></b>.
1957The Doxygen content will be created in the directory
1958<tt class="filename">COIN/Clp/Doc/html</tt>.  The same can be done for
1959the COIN core, from the <tt class="filename">COIN/Coin</tt> directory.
1960</p></div><div class="appendix" lang="en"><div class="titlepage"><div><div><h2 class="title"><a name="id4768638"></a>Appendix C. Revision History</h2></div></div></div><div class="revhistory"><table border="0" width="100%" summary="Revision history"><tr><th align="left" valign="top" colspan="3"><b>Revision History</b></th></tr><tr><td align="left">Revision 0.4</td><td align="left">18 Oct 2004</td><td align="left">DdlN</td></tr><tr><td align="left" colspan="3">Second official release, including some corrections,
1961  clarifications, and several improvements (better treatment of clp
1962  executable and Samples).
1963  </td></tr><tr><td align="left">Revision 0.3</td><td align="left">19 Aug 2004</td><td align="left">DdlN</td></tr><tr><td align="left" colspan="3">Major overhaul, including transition from MS Word to DocBook
1964    XML.
1965  </td></tr><tr><td align="left">Revision 0.2</td><td align="left">23 Feb 2004</td><td align="left">RLH</td></tr><tr><td align="left" colspan="3">Revisions to make it clearer to the non-author reader.</td></tr><tr><td align="left">Revision 0.1</td><td align="left">Nov 2003</td><td align="left">JF</td></tr><tr><td align="left" colspan="3">First draft</td></tr></table></div></div></div></body></html>
Note: See TracBrowser for help on using the repository browser.