source: branches/gh-pages/clpexe.md @ 2412

Last change on this file since 2412 was 2412, checked in by stefan, 9 months ago

cleanup clpexe

  • Property svn:eol-style set to native
File size: 5.4 KB
Line 
1The CLP Executable
2==================
3
4Quick Start
5===========
6
7The result of `make unitTest` (executed in the build directory) is an executable
8`clp` as well as the CLP and COIN-OR libraries. The executable can be used
9to perform various unit tests, but can also be used as a standalone
10solver. As the executable has a very simple solution file format, the
11user may wish to modify `ClpMain.cpp`, which contains the
12source of the executable (modifications could even be offered as a
13contribution to CLP).
14
15The `clp` executable operates in command line mode or prompted mode.
16Entering `clp` will invoke the prompted mode, while `clp <filename>`
17will import a problem in MPS format from `filename`, solve it using the
18dual simplex method and exit. The command
19`clp <filename> -primalsimplex` instructs the executable tp import a
20file and solve using the primal simplex method. An additional solitary
21dash ("`-`") starts the prompt mode once the execution of the initial
22command has been completed. The "`-`" is necessary as part of the
23command; invoking prompt mode as a separate command will result in the
24loss of problem information related to the initial command. So, the
25following sequences of commands are equivalent in the sense that both
26maximize a problem using the dual simplex method and write a solution to
27file: `solfile`:
28```
29$ clp filename -maximize -dualsimplex -solution solfile
30```
31
32```
33$ clp filename -maximize -
34Clp:duals
35Clp:solution solfile
36Clp:quit
37```
38
39The executable is at a very early stage of development. Comments and
40suggestions would be appreciated.
41
42Online Help and Basic Usage
43===========================
44
45The executable has some command-completion functionality as well as some
46online help. Below is a table with some examples which summarize these
47capabilities.
48
49| Command      | Result
50|--------------|-------------------------------------------------------------------------------------------------------------------------------------
51| `?`          | Gives a list of all commands |
52| `p?`         | Gives a list of all commands which begin with `p`. |
53| `p??`        | Gives a list of all commands which begin with `p`, with a short explanation for each. |
54| `primals??`  | If is this is enough to uniquely determine a command (in this example, `primalS`, for primal simplex), a long explanation is given. |
55
56In addition, matching a name without a `?` will either execute the command
57or give the value of the corresponding parameter as follows: `primalw`
58will give the current value of the `primalWeight` parameter while
59`primalw 1.0e7` will change it to `1.0e7`.
60
61A Sample Session
62================
63
64Below is a sample CLP executable prompt-mode session. A small problem is
65loaded and solved under various conditions with the primal and dual
66simplex methods. Note the use of the `allslack` command; it sets the
67basis to all slacks and resets the solution.
68
69```
70$ clp
71Coin LP version 0.99.9, build Sep 14 2004
72Clp takes input from arguments ( - switches to stdin)
73Enter ? for list of commands or help
74Clp:import../Data/Sample/p0033.mps
75At line 15 NAME  P0033
76At line 16 ROWS
77At line 34 COLUMNS
78At line 109 RHS
79At line 118 BOUNDS
80At line 152 ENDATA
81Problem P0033 has 16 rows, 33 columns and 98 elements
82Model was imported from ./../Data/Sample/p0033.mps in 0 seconds
83Clp:primals
84Presolve 15 (-1) rows, 32 (-1) columns and 97 (-1) elements
850  Obj 0 Primal inf 27.2175 (10) Dual inf 6.42094e+11 (32)
8632  Obj 2520.57
87Optimal - objective value 2520.57
88After Postsolve, objective 2520.57, infeasibilities - dual 0 (0), primal 0 (0)
89Optimal objective 2520.571739 - 32 iterations time 0.012, Presolve 0.01
90Clp:max
91Clp:primals
92Presolve 11 (-5) rows, 25 (-8) columns and 84 (-14) elements
930  Obj 4807.92 Dual inf 1700.71 (15)
94End of values pass after 2 iterations
952  Obj 4921.7 Dual inf 580.637 (5)
969  Obj 5299.7
97Optimal - objective value 5299.7
98After Postsolve, objective 5299.7, infeasibilities - dual 643.608 (9), primal 27.0826 (10)
99Presolved model was optimal, full model needs cleaning up
1000  Obj 5299.7
1010  Obj 5299.7
102Optimal - objective value 5299.7
103Optimal objective 5299.698868 - 9 iterations time 0.022, Presolve 0.02
104Clp:allslack
105Clp:duals
106Presolve 11 (-5) rows, 25 (-8) columns and 84 (-14) elements
1070  Obj 2752 Primal inf 24.4867 (6) Dual inf 4280.55 (25)
1088  Obj 5299.7
109Optimal - objective value 5299.7
110After Postsolve, objective 5299.7, infeasibilities - dual 704.58 (8), primal 27.0792 (10)
111Presolved model was optimal, full model needs cleaning up
1120  Obj 5299.7
1130  Obj 5299.7
114Optimal - objective value 5299.7
115Optimal objective 5299.698868 - 8 iterations time 0.032, Presolve 0.01
116Clp:min
117Clp:duals
118Presolve 15 (-1) rows, 32 (-1) columns and 97 (-1) elements
1190  Obj 5299.7 Dual inf 4632.26 (28)
12016  Obj 2520.57
121Optimal - objective value 2520.57
122After Postsolve, objective 2520.57, infeasibilities - dual 2052.5 (13), primal 27.1143 (10)
123Presolved model was optimal, full model needs cleaning up
1240  Obj 2520.57
1250  Obj 2520.57
126Optimal - objective value 2520.57
127Optimal objective 2520.571739 - 16 iterations time 0.012, Presolve 0.01
128Clp:allslack
129Clp:presolve off
130Clp:primals
1310  Obj 0 Primal inf 27.2175 (10) Dual inf 6.39167e+11 (32)
13232  Obj 2520.57
133Optimal - objective value 2520.57
134Optimal objective 2520.571739 - 32 iterations time 0.002
135Clp:allslack
136Clp:maxIt 10
137maxIterations was changed from 99999999 to 10
138Clp:primals
1390  Obj 0 Primal inf 27.2175 (10) Dual inf 6.39167e+11 (32)
140Stopped - objective value 4.24664e+10
141Stopped objective 4.246637759e+10 - 10 iterations time 0.002
142Clp:quit
143```
Note: See TracBrowser for help on using the repository browser.