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

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

add markdown conversion of Clp user's guide docbook source (from trunk)

  • Property svn:eol-style set to native
File size: 6.1 KB
Line 
1The CLP Executable {#clpexe}
2==================
3
4Quick Start
5===========
6
7The result of `make unitTest` (executed in `COIN/Clp`) is an executable
8`clp` as well as the CLP and COIN 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 `COIN/Clp/Test/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>         $ clp filename -maximize -
33>         Clp:duals
34>         Clp:solution solfile
35>         Clp:quit
36>         
37
38The executable is at a very early stage of development. Comments and
39suggestions would be appreciated.
40
41Online Help and Basic Usage
42===========================
43
44The executable has some command-completion functionality as well as some
45online help. Below is a table with some examples which summarize these
46capabilities.
47
48  Command       Result
49  ------------- -------------------------------------------------------------------------------------------------------------------------------------
50  `?`           Gives a list of all commands
51  `p?`          Gives a list of all commands which begin with \<p\>.
52  `p??`         Gives a list of all commands which begin with \<p\>., with a short explanation for each.
53  `primals??`   If is this is enough to uniquely determine a command (in this example, `primalS`, for primal simplex), a long explanation is given.
54
55  : Command examples for the clp executable
56
57In addition, matching a name without a ? will either execute the command
58or give the value of the corresponding parameter as follows: `primalw`
59will give the current value of the `primalWeight` parameter while
60`primalw 1.0e7` will change it to `1.0e7`.
61
62A Sample Session
63================
64
65Below is a sample CLP executable prompt-mode session. A small problem is
66loaded and solved under various conditions with the primal and dual
67simplex methods. Note the use of the `allslack` command; it sets the
68basis to all slacks and resets the solution.
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../Mps/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 ./../Mps/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       
Note: See TracBrowser for help on using the repository browser.