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