1 | <?xml version="1.0" encoding="ISO-8859-1"?> |
---|
2 | <chapter id="clpexe"> |
---|
3 | <title> |
---|
4 | The CLP Executable |
---|
5 | </title> |
---|
6 | <section> |
---|
7 | <title>Quick Start</title> |
---|
8 | <para> |
---|
9 | The result of <userinput>make unitTest</userinput> (executed in |
---|
10 | <filename>COIN/Clp</filename>) is an executable |
---|
11 | <filename>clp</filename> as well as the CLP and COIN libraries. |
---|
12 | The executable can be used to perform various unit tests, but can also be used |
---|
13 | as a standalone solver. As the executable has a very simple solution file format, |
---|
14 | the user may wish to modify <filename>COIN/Clp/Test/ClpMain.cpp</filename>, |
---|
15 | which contains the source of the executable (modifications could even be |
---|
16 | offered as a contribution to CLP). |
---|
17 | </para> |
---|
18 | <para> |
---|
19 | The <filename>clp</filename> executable operates in command line mode or |
---|
20 | prompted mode. Entering <userinput>clp</userinput> will invoke the prompted |
---|
21 | mode, while <userinput>clp <filename></userinput> will import a problem |
---|
22 | in MPS format from <filename>filename</filename>, solve it using the dual |
---|
23 | simplex method and exit. The command |
---|
24 | <userinput>clp <filename> -primalsimplex</userinput> instructs the |
---|
25 | executable tp import a file and solve using the primal simplex method. An |
---|
26 | additional solitary dash ("<userinput>-</userinput>") starts the |
---|
27 | prompt mode once the execution of the initial command has been completed. The |
---|
28 | "<userinput>-</userinput>" is necessary as part of the command; |
---|
29 | invoking prompt mode as a separate command will result in the loss of problem |
---|
30 | information related to the initial command. So, the following sequences of commands |
---|
31 | are equivalent in the sense that both maximize a problem using the dual |
---|
32 | simplex method and write a solution to file: |
---|
33 | <filename>solfile</filename>: |
---|
34 | <blockquote> |
---|
35 | <literallayout> |
---|
36 | <prompt>$</prompt> <userinput><command>clp</command> <replaceable>filename</replaceable> -maximize -dualsimplex -solution solfile</userinput> |
---|
37 | </literallayout> |
---|
38 | </blockquote> |
---|
39 | <blockquote> |
---|
40 | <literallayout> |
---|
41 | <prompt>$</prompt> <userinput><command>clp</command> <replaceable>filename</replaceable> -maximize -</userinput> |
---|
42 | <prompt>Clp:</prompt><userinput><command>duals</command></userinput> |
---|
43 | <prompt>Clp:</prompt><userinput><command>solution</command> solfile</userinput> |
---|
44 | <prompt>Clp:</prompt><userinput><command>quit</command></userinput> |
---|
45 | </literallayout> |
---|
46 | </blockquote> |
---|
47 | </para> |
---|
48 | <para> |
---|
49 | The executable is at a very early stage of development. Comments and |
---|
50 | suggestions would be appreciated. |
---|
51 | </para> |
---|
52 | </section> |
---|
53 | <section> |
---|
54 | <title> |
---|
55 | Online Help and Basic Usage |
---|
56 | </title> |
---|
57 | <para> |
---|
58 | The executable has some command-completion functionality as well as some online |
---|
59 | help. Below is a table with some examples which summarize these capabilities. |
---|
60 | </para> |
---|
61 | <table frame="none"> |
---|
62 | <title>Command examples for the clp executable</title> |
---|
63 | <tgroup cols="2"> |
---|
64 | <thead> |
---|
65 | <row> |
---|
66 | <entry align="left"> |
---|
67 | Command |
---|
68 | </entry> |
---|
69 | <entry align="left"> |
---|
70 | Result |
---|
71 | </entry> |
---|
72 | </row> |
---|
73 | </thead> |
---|
74 | <tbody> |
---|
75 | <row> |
---|
76 | <entry> |
---|
77 | <command>?</command> |
---|
78 | </entry> |
---|
79 | <entry> |
---|
80 | Gives a list of all commands |
---|
81 | </entry> |
---|
82 | </row> |
---|
83 | <row> |
---|
84 | <entry> |
---|
85 | <command>p?</command> |
---|
86 | </entry> |
---|
87 | <entry> |
---|
88 | Gives a list of all commands which begin with <p>. |
---|
89 | </entry> |
---|
90 | </row> |
---|
91 | <row> |
---|
92 | <entry> |
---|
93 | <command>p??</command> |
---|
94 | </entry> |
---|
95 | <entry> |
---|
96 | Gives a list of all commands which begin with <p>., with a short |
---|
97 | explanation for each. |
---|
98 | </entry> |
---|
99 | </row> |
---|
100 | <row> |
---|
101 | <entry> |
---|
102 | <command>primals??</command> |
---|
103 | </entry> |
---|
104 | <entry> |
---|
105 | If is this is enough to uniquely determine a command (in this example, |
---|
106 | <command>primalS</command>, for primal simplex), a long explanation |
---|
107 | is given. |
---|
108 | </entry> |
---|
109 | </row> |
---|
110 | </tbody> |
---|
111 | </tgroup> |
---|
112 | </table> |
---|
113 | <para> |
---|
114 | In addition, matching a name without a ? will either execute the command or give |
---|
115 | the value of the corresponding parameter as follows: |
---|
116 | <userinput><command>primalw</command></userinput> will give the current value of the |
---|
117 | <parameter>primalWeight</parameter> parameter while |
---|
118 | <userinput><command>primalw 1.0e7</command></userinput> will change it to |
---|
119 | <literal>1.0e7</literal>. |
---|
120 | </para> |
---|
121 | </section> |
---|
122 | <section> |
---|
123 | <title>A Sample Session</title> |
---|
124 | <para> |
---|
125 | Below is a sample CLP executable prompt-mode session. A small problem is |
---|
126 | loaded and solved under various conditions with the primal and dual |
---|
127 | simplex methods. Note the use of the <command>allslack</command> command; it |
---|
128 | sets the basis to all slacks and resets the solution. |
---|
129 | </para> |
---|
130 | <para> |
---|
131 | <screen> |
---|
132 | <prompt>$</prompt><command>clp</command> |
---|
133 | Coin LP version 0.99.9, build Sep 14 2004 |
---|
134 | Clp takes input from arguments ( - switches to stdin) |
---|
135 | Enter ? for list of commands or help |
---|
136 | <prompt>Clp:</prompt><userinput><command>import</command><filename>../Mps/Sample/p0033.mps</filename></userinput> |
---|
137 | At line 15 NAME P0033 |
---|
138 | At line 16 ROWS |
---|
139 | At line 34 COLUMNS |
---|
140 | At line 109 RHS |
---|
141 | At line 118 BOUNDS |
---|
142 | At line 152 ENDATA |
---|
143 | Problem P0033 has 16 rows, 33 columns and 98 elements |
---|
144 | Model was imported from ./../Mps/Sample/p0033.mps in 0 seconds |
---|
145 | <prompt>Clp:</prompt><userinput><command>primals</command></userinput> |
---|
146 | Presolve 15 (-1) rows, 32 (-1) columns and 97 (-1) elements |
---|
147 | 0 Obj 0 Primal inf 27.2175 (10) Dual inf 6.42094e+11 (32) |
---|
148 | 32 Obj 2520.57 |
---|
149 | Optimal - objective value 2520.57 |
---|
150 | After Postsolve, objective 2520.57, infeasibilities - dual 0 (0), primal 0 (0) |
---|
151 | Optimal objective 2520.571739 - 32 iterations time 0.012, Presolve 0.01 |
---|
152 | <prompt>Clp:</prompt><userinput><command>max</command></userinput> |
---|
153 | <prompt>Clp:</prompt><userinput><command>primals</command></userinput> |
---|
154 | Presolve 11 (-5) rows, 25 (-8) columns and 84 (-14) elements |
---|
155 | 0 Obj 4807.92 Dual inf 1700.71 (15) |
---|
156 | End of values pass after 2 iterations |
---|
157 | 2 Obj 4921.7 Dual inf 580.637 (5) |
---|
158 | 9 Obj 5299.7 |
---|
159 | Optimal - objective value 5299.7 |
---|
160 | After Postsolve, objective 5299.7, infeasibilities - dual 643.608 (9), primal 27.0826 (10) |
---|
161 | Presolved model was optimal, full model needs cleaning up |
---|
162 | 0 Obj 5299.7 |
---|
163 | 0 Obj 5299.7 |
---|
164 | Optimal - objective value 5299.7 |
---|
165 | Optimal objective 5299.698868 - 9 iterations time 0.022, Presolve 0.02 |
---|
166 | <prompt>Clp:</prompt><userinput><command>allslack</command></userinput> |
---|
167 | <prompt>Clp:</prompt><userinput><command>duals</command></userinput> |
---|
168 | Presolve 11 (-5) rows, 25 (-8) columns and 84 (-14) elements |
---|
169 | 0 Obj 2752 Primal inf 24.4867 (6) Dual inf 4280.55 (25) |
---|
170 | 8 Obj 5299.7 |
---|
171 | Optimal - objective value 5299.7 |
---|
172 | After Postsolve, objective 5299.7, infeasibilities - dual 704.58 (8), primal 27.0792 (10) |
---|
173 | Presolved model was optimal, full model needs cleaning up |
---|
174 | 0 Obj 5299.7 |
---|
175 | 0 Obj 5299.7 |
---|
176 | Optimal - objective value 5299.7 |
---|
177 | Optimal objective 5299.698868 - 8 iterations time 0.032, Presolve 0.01 |
---|
178 | <prompt>Clp:</prompt><userinput><command>min</command></userinput> |
---|
179 | <prompt>Clp:</prompt><userinput><command>duals</command></userinput> |
---|
180 | Presolve 15 (-1) rows, 32 (-1) columns and 97 (-1) elements |
---|
181 | 0 Obj 5299.7 Dual inf 4632.26 (28) |
---|
182 | 16 Obj 2520.57 |
---|
183 | Optimal - objective value 2520.57 |
---|
184 | After Postsolve, objective 2520.57, infeasibilities - dual 2052.5 (13), primal 27.1143 (10) |
---|
185 | Presolved model was optimal, full model needs cleaning up |
---|
186 | 0 Obj 2520.57 |
---|
187 | 0 Obj 2520.57 |
---|
188 | Optimal - objective value 2520.57 |
---|
189 | Optimal objective 2520.571739 - 16 iterations time 0.012, Presolve 0.01 |
---|
190 | <prompt>Clp:</prompt><userinput><command>allslack</command></userinput> |
---|
191 | <prompt>Clp:</prompt><userinput><command>presolve off</command></userinput> |
---|
192 | <prompt>Clp:</prompt><userinput><command>primals</command></userinput> |
---|
193 | 0 Obj 0 Primal inf 27.2175 (10) Dual inf 6.39167e+11 (32) |
---|
194 | 32 Obj 2520.57 |
---|
195 | Optimal - objective value 2520.57 |
---|
196 | Optimal objective 2520.571739 - 32 iterations time 0.002 |
---|
197 | <prompt>Clp:</prompt><userinput><command>allslack</command></userinput> |
---|
198 | <prompt>Clp:</prompt><userinput><command>maxIt</command> 10</userinput> |
---|
199 | maxIterations was changed from 99999999 to 10 |
---|
200 | <prompt>Clp:</prompt><userinput><command>primals</command></userinput> |
---|
201 | 0 Obj 0 Primal inf 27.2175 (10) Dual inf 6.39167e+11 (32) |
---|
202 | Stopped - objective value 4.24664e+10 |
---|
203 | Stopped objective 4.246637759e+10 - 10 iterations time 0.002 |
---|
204 | <prompt>Clp:</prompt><userinput><command>quit</command></userinput> |
---|
205 | </screen> |
---|
206 | </para> |
---|
207 | </section> |
---|
208 | </chapter> |
---|