Ignore:
Timestamp:
Oct 17, 2004 6:45:07 PM (15 years ago)
Author:
ddelanu
Message:

Update for INFORMS server, not necessarily release version

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Docs/moresamples.xml

    r443 r479  
    99The CLP dsitribution includes a number of <filename>.cpp</filename> sample files.
    1010Users are encouraged to use them as starting points for their own CLP projects.
    11 The files can be found in the <filename>COIN/Clp/Samples</filename> directory.
     11The files can be found in the <filename>&clpsamplesdir;</filename> directory.
    1212For the latest information on compiling and running these samples, please see
    13 the file <filename>COIN/Clp/Samples/INSTALL</filename>.  Below is a list of
     13the file <filename>&clpsamplesdir;INSTALL</filename>.  Below is a list of
    1414some of the most useful sample files with a short description for each file.
    1515</para>
    1616<table frame="none">
    17   <title>Contents of the Samples directory</title>
     17  <title>Basic Samples</title>
    1818  <tgroup cols="2">
    1919    <thead>
    2020      <row>
    2121        <entry align="left" valign="bottom">
    22         Filename&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
     22        Source file&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    2323        </entry>
    2424        <entry align="left" valign="bottom">
     
    3030      <row>
    3131        <entry align="left" valign="top">
    32         <ulink url="&cvsweb;&clpsamplesdir;minimum.cpp"><filename>minimum.cpp</filename></ulink>
    33         </entry>
    34         <entry align="left" valign="top">
    35         This is a CLP &quot;Hello, world&quot; program.  It reads an MPS file,
    36         and solves the problem.
    37         </entry>
    38       </row>
    39       <row>
    40         <entry align="left" valign="top">
    41         <ulink url="&cvsweb;&clpsamplesdir;defaults.cpp"><filename>defaults.cpp</filename></ulink>
     32        &minimumcpp;
     33        </entry>
     34        <entry align="left" valign="top">
     35        This is a CLP &quot;Hello, world&quot; program.  It reads a problem
     36        from an MPS file, and solves the problem.
     37        [<link linkend="minimumcppdesc">More...</link>]
     38        </entry>
     39      </row>
     40      <row>
     41        <entry align="left" valign="top">
     42        &defaultscpp;
    4243        </entry>
    4344        <entry align="left" valign="top">
     
    4647        of &quot;set&quot; and  &quot;get&quot; methods.  It also prints out full
    4748        MPS-like solutions.
    48         </entry>
    49       </row>
    50       <row>
    51         <entry align="left" valign="top">
    52         <ulink url="&cvsweb;&clpsamplesdir;driver.cpp"><filename>driver.cpp</filename></ulink>
     49        [<link linkend="defaultscppdesc">More...</link>]
     50        </entry>
     51      </row>
     52      <row>
     53        <entry align="left" valign="top">
     54        &drivercpp;
    5355        </entry>
    5456        <entry align="left" valign="top">
     
    5658        driver program for his or her project.  In particular, it demonstrates
    5759        the use of CLP's  presolve functionality.
    58         </entry>
    59       </row>
    60       <row>
    61         <entry align="left" valign="top">
    62         <ulink url="&cvsweb;&clpsamplesdir;piece.cpp"><filename>piece.cpp</filename></ulink>
    63         </entry>
    64         <entry align="left" valign="top">
    65         This simple example takes a matrix read in by
    66         <classname>CoinMpsIo</classname> (can be used to read in MPS files
    67         without a solver), deletes every second column and solves the
    68         resulting problem.
    69         </entry>
    70       </row>
    71       <row>
    72         <entry align="left" valign="top">
    73         <ulink url="&cvsweb;&clpsamplesdir;network.cpp"><filename>network.cpp</filename></ulink>
     60        [<link linkend="drivercppdesc">More...</link>]
     61        </entry>
     62      </row>
     63      <row>
     64        <entry align="left" valign="top">
     65        &networkcpp;
    7466        </entry>
    7567        <entry align="left" valign="top">
    7668        This shows the use of non-standard matrices and how to load a problem
    7769        without the use of MPS files.
    78         </entry>
    79       </row>
    80       <row>
    81         <entry align="left" valign="top">
    82         <ulink url="&cvsweb;&clpsamplesdir;decompose.cpp"><filename>decompose.cpp</filename></ulink>
     70        [<link linkend="networkcppdesc">More...</link>]
     71        </entry>
     72      </row>
     73      <row>
     74        <entry align="left" valign="top">
     75        &testbarriercpp;
     76        </entry>
     77        <entry align="left" valign="top">
     78        This is a basic driver file for the barrier method of CLP, similar to
     79        &minimumcpp;.  The barrier method is not currently addressed in this
     80        guide.
     81        [<link linkend="testbarriercppdesc">More...</link>]
     82        </entry>
     83      </row>
     84    </tbody>
     85  </tgroup>
     86</table>
     87<table frame="none">
     88  <title>Advanced Samples</title>
     89  <tgroup cols="2">
     90    <thead>
     91      <row>
     92        <entry align="left" valign="bottom">
     93        Source file&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
     94        </entry>
     95        <entry align="left" valign="bottom">
     96        Description
     97        </entry>
     98      </row>
     99    </thead>
     100    <tbody>
     101      <row>
     102        <entry align="left" valign="top">
     103        &driver2cpp;
     104        </entry>
     105        <entry align="left" valign="top">
     106        This sample, in addition to some tasks common to other samples, does
     107        some advanced message handling and presolve.
     108        </entry>
     109      </row>
     110      <row>
     111        <entry align="left" valign="top">
     112        &dualcutscpp;
     113        </entry>
     114        <entry align="left" valign="top">
     115        This sample implements a method of treating a problem as a collection
     116        of cuts.
     117        </entry>
     118      </row>
     119      <row>
     120        <entry align="left" valign="top">
     121        &decomposecpp;
    83122        </entry>
    84123        <entry align="left" valign="top">
     
    89128      <row>
    90129        <entry align="left" valign="top">
    91         <ulink url="&cvsweb;&clpsamplesdir;sprint.cpp"><filename>sprint.cpp</filename></ulink>
     130        &sprintcpp;
    92131        </entry>
    93132        <entry align="left" valign="top">
     
    101140      <row>
    102141        <entry align="left" valign="top">
    103         <ulink url="&cvsweb;&clpsamplesdir;sprint2.cpp"><filename>sprint2.cpp</filename></ulink>
     142        &sprint2cpp;
    104143        </entry>
    105144        <entry align="left" valign="top">
     
    114153  </tgroup>
    115154</table>
     155<para>
     156The remaining Samples listed here are considered unsupported in that they are of
     157a more esoteric nature and are sometimes contributed as a result of an
     158individual's request.  The are to be found in
     159<filename>&clpsamplesdir;Contributed</filename>.
     160</para>
     161<table frame="none">
     162  <title>Unsupported Samples</title>
     163  <tgroup cols="2">
     164    <thead>
     165      <row>
     166        <entry align="left" valign="bottom">
     167        Source file&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
     168        </entry>
     169        <entry align="left" valign="bottom">
     170        Description
     171        </entry>
     172      </row>
     173    </thead>
     174    <tbody>
     175      <row>
     176        <entry align="left" valign="top">
     177        &testbasiscpp;
     178        </entry>
     179        <entry align="left" valign="top">
     180        This sample takes a problem, changes any inequality constraints to
     181        equality constraints, solves the problem, and creates the optimal basis.
     182        </entry>
     183      </row>
     184      <row>
     185        <entry align="left" valign="top">
     186        &testgubcpp;
     187        </entry>
     188        <entry align="left" valign="top">
     189        This sample illustrates the use of the GUB (&quot;Generalized Upper
     190        Bound&quot;) technique.
     191        </entry>
     192      </row>
     193      <row>
     194        <entry align="left" valign="top">
     195        &ekkcpp;
     196        </entry>
     197        <entry align="left" valign="top">
     198        This sample can be used to compare CLP and OSL.  It uses an additional
     199        file in the Samples directory, <filename>ekk_interface.cpp</filename>.
     200        These sample files are not likely to be interesting to new CLP users
     201        who do not have experience with OSL.
     202        </entry>
     203      </row>
     204      <row>
     205        <entry align="left" valign="top">
     206        &hellocpp;
     207        </entry>
     208        <entry align="left" valign="top">
     209        This sample creates a text-based picture of a matrix on screen
     210        (limited to an 80x80 matrix).  It's not terribly useful but it does
     211        illustrate one way to step through the elements of a matrix.
     212        </entry>
     213      </row>
     214      <row>
     215        <entry align="left" valign="top">
     216        &piececpp;
     217        </entry>
     218        <entry align="left" valign="top">
     219        This sample takes a matrix read in by <classname>CoinMpsIo</classname>
     220        (can be used to read in MPS files without a solver), deletes every
     221        second column and solves the resulting problem.
     222        </entry>
     223      </row>
     224      <row>
     225        <entry align="left" valign="top">
     226        &usevolumecpp;
     227        </entry>
     228        <entry align="left" valign="top">
     229        The Volume Algorithm is another solver available as part of the COIN-OR
     230        distribution.  This sample shows how to use the Volume Algorithm with
     231        CLP.
     232        </entry>
     233      </row>
     234    </tbody>
     235  </tgroup>
     236</table>
     237<!-- subsection -->
     238<section id="minimumcppdesc">
     239<title>minimum.cpp</title>
     240<para>
     241This sample is examined in more detail in <xref linkend="firstexample"/>.
     242</para>
     243</section>
     244<!-- end subsection -->
     245<!-- subsection -->
     246<section id="defaultscppdesc">
     247<title>defaults.cpp</title>
     248<para>
     249This sample begins by reading an MPS file.  The default MPS file is
     250<filename>COIN/Mps/Sample/p0033.mps</filename>; this can be over-riden by a
     251command-line specification of a (path and) file name).  The sample then sets
     252the pivot algorithm to be exact devex.  It &quot;gets&quot; the default
     253infeasibility cost and &quot;sets&quot; it to that value (and prints it to
     254standard out).  This sort of getting and setting of various parameters
     255constitutes a common theme in this sample, with the purpose of illustrating
     256usage of some of the more common get and set methods available in CLP.
     257</para>
     258<para>
     259At this point the model is solved by the primal method.  A sequence of sets,
     260gets and prints is then followed by a number of calls to methods which give
     261specific information about the status of the problem (for example, the code
     262checks that the current solution has been proven to be optimal by
     263<code>assert(model.isProvenOptimal())</code>).
     264</para>
     265<para>
     266Next, a copy of the original model is made.  More sets and gets are
     267performed to demonstrate the use of additional options (including
     268the setting of the default message handling as well as changing of the
     269&quot;log level&quot; (amount of output)).  The model is solved again a
     270number of times between changes of the optimization direction (i.e. changing
     271from min to max or vice versa).  The remaining lines of this sample serve to
     272display solution and problem information in much the same way as is done in
     273driver.cpp.
     274</para>
     275</section>
     276<!-- subsection -->
     277<section id="drivercppdesc">
     278<title>driver.cpp</title>
     279<para>
     280This sample begins by reading an MPS file.  The default MPS file is
     281<filename>COIN/Mps/Sample/p0033.mps</filename>; this can be over-riden by a
     282command-line specification of a (path and) file name).  A second command-line
     283argument can specify that either the &quot;primal&quot; or &quot;dual&quot;
     284method (or even the &quot;barrier&quot;, see below) should be used by CLP.
     285</para>
     286<para>
     287Once the problem has been
     288read, there are two options for how to solve it, one of which must be chosen at
     289compile-time (<code>STYLE1</code> being defined or not determines this
     290choice).  The second manner is more flexible and involves more specific
     291directions being given to CLP, including the ability to specify that the barrier
     292method should be used.
     293</para>
     294<para>
     295At this point in the sample, the problem is solved by CLP, and some basic ouput
     296is generated.  If more output is desired, at compile-time, an
     297<code>exit(0)</code> statement must either be removed or commented.  There are
     298two levels of additional output, the first of which is suppressed  by a
     299<code>#if 0</code> directive which may be modified at compile-time if desired.
     300This first level of output only involves non-zero columns, whereas the second
     301provides additional information.
     302</para>
     303</section>
     304<!-- end subsection -->
     305<!-- subsection -->
     306<section id="networkcppdesc">
     307<title>network.cpp</title>
     308<para>
     309This handy sample reads a network problem generated by
     310<ulink url="http://www.netlib.org/lp/generators/netgen">netgen</ulink>, converts
     311it to an LP using CLP's network matrix type, and solves.  This entirely avoids
     312the use of an MPS file, as the LP is built in memory from the network data file
     313created by netgen.  Also, the factorization frequency is changed, and the
     314problem is solved more than once (demonstrating the change of optimization sense
     315as well as switching from dual to primal methods).
     316</para>
     317</section>
     318<!-- end subsection -->
     319<!-- subsection -->
     320<section id="testbarriercppdesc">
     321<title>testBarrier.cpp</title>
     322<para>
     323This straightfoward sample begins by reading a problem from an MPS file.  It
     324then chooses a Cholesky factorization and solves the problem using the
     325predictor corrector barrier method.  It then copies the problem and performs a
     326crossover to a simplex solution in the new copy.
     327</para>
     328</section>
     329<!-- end subsection -->
     330<!-- subsection -->
     331<section>
     332<title>dualCuts.cpp</title>
     333<para>
     334This sample begins with only the equality constraints of a problem.  The
     335inequalities are considered to be part of a pool of available cuts in much the
     336same way as is done in integer programming.  However, in this case, the cuts are
     337not &quot;generated&quot;, they are simply the inequalities of the problem.
     338</para>
     339</section>
     340<!-- end subsection -->
     341<!-- subsection -->
     342<section>
     343<title>decompose.cpp</title>
     344<para>
     345More on this sample coming soon!
     346</para>
     347</section>
     348<!-- end subsection -->
     349<!-- subsection -->
     350<section>
     351<title>driver2.cpp</title>
     352<para>
     353More on this sample coming soon!
     354</para>
     355</section>
     356<!-- end subsection -->
    116357</section>
    117358<section>
     
    128369      <row>
    129370        <entry align="left" valign="bottom">
    130         CLP Task&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
     371        CLP Task(s)
    131372        </entry>
    132373        <entry>
     
    144385        </entry>
    145386        <entry>
    146         readMps
     387        <literallayout><function>int readMps(const char *filename)</function></literallayout>
     388        </entry>
     389        <entry>
     390        &defaultscpp;, &drivercpp;, &minimumcpp;
     391        </entry>
     392      </row>
     393      <row>
     394        <entry>
     395        Solve by primal method
     396        </entry>
     397        <entry>
     398        <literallayout><function>int primal()</function></literallayout>
     399        </entry>
     400        <entry>
     401        &drivercpp;
     402        </entry>
     403      </row>
     404      <row>
     405        <entry>
     406        Choose pivot rule
     407        </entry>
     408        <entry>
     409        <literallayout><function>void setPrimalColumnPivotAlgorithm(ClpPrimalColumnPivot &amp;choice)</function>
     410        <function>void setDualRowPivotAlgorithm(ClpDualRowPivot &amp;choice)</function></literallayout>
     411        </entry>
     412        <entry>
     413        &defaultscpp;
     414        </entry>
     415      </row>
     416      <row>
     417        <entry>
     418        Get/set infeasibility cost
     419        </entry>
     420        <entry>
     421        <literallayout><function>void setInfeasibilityCost(double value)</function>
     422        <function>void setInfeasibilityCost(double value)</function></literallayout>
     423        </entry>
     424        <entry>
     425        &defaultscpp;
     426        </entry>
     427      </row>
     428      <row>
     429        <entry>
     430        Get string/&quot;double&quot;/integer information
     431        </entry>
     432        <entry>
     433        <literallayout><function>bool getStrParam(ClpStrParam key, std::string &amp;value) const</function>
     434        <function>bool getDblParam(ClpDblParam key, double &amp;value) const</function>
     435        <function>bool  getIntParam (ClpIntParam key, int &amp;value) const </function></literallayout>
     436        </entry>
     437        <entry>
     438        &defaultscpp;
     439        </entry>
     440      </row>
     441      <row>
     442        <entry>
     443        Set maximum number of iterations
     444        </entry>
     445        <entry>
     446        <literallayout><function>void setMaximumIterations(int value)</function></literallayout>
     447        </entry>
     448        <entry>
     449        &defaultscpp;
     450        </entry>
     451      </row>
     452      <row>
     453        <entry>
     454        Check solution status
     455        </entry>
     456        <entry>
     457        <literallayout><function>int status() const</function>
     458        <function>bool isAbandoned() const</function>
     459        <function>bool isProvenOptimal() const</function>
     460        <function>bool isProvenPrimalInfeasible() const</function>
     461        <function>bool isProvenDualInfeasible() const</function>
     462        <function>bool isPrimalObjectiveLimitReached() const</function>
     463        <function>bool isDualObjectiveLimitReached() const</function>
     464        <function>bool isIterationLimitReached() const</function>
     465        <function></function>
     466        <function></function></literallayout>
     467        </entry>
     468        <entry>
     469       
     470        </entry>
     471      </row>
     472      <row>
     473        <entry>
     474       
     475        </entry>
     476        <entry>
     477       
     478        </entry>
     479        <entry>
     480       
     481        </entry>
     482      </row>
     483      <row>
     484        <entry>
     485       
     486        </entry>
     487        <entry>
     488       
     489        </entry>
     490        <entry>
     491       
     492        </entry>
     493      </row>
     494      <row>
     495        <entry>
     496       
     497        </entry>
     498        <entry>
     499       
     500        </entry>
     501        <entry>
     502       
     503        </entry>
     504      </row>
     505      <row>
     506        <entry>
     507       
     508        </entry>
     509        <entry>
     510       
    147511        </entry>
    148512        <entry>
Note: See TracChangeset for help on using the changeset viewer.