File: qpsolve.xml

package info (click to toggle)
scilab 5.2.2-9
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 334,832 kB
  • ctags: 52,586
  • sloc: xml: 526,945; ansic: 223,590; fortran: 163,080; java: 56,934; cpp: 33,840; tcl: 27,936; sh: 20,397; makefile: 9,908; ml: 9,451; perl: 1,323; cs: 614; lisp: 30
file content (266 lines) | stat: -rw-r--r-- 7,438 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
<?xml version="1.0" encoding="UTF-8"?>
<refentry version="5.0-subset Scilab" xml:id="qpsolve" xml:lang="en"
          xmlns="http://docbook.org/ns/docbook"
          xmlns:xlink="http://www.w3.org/1999/xlink"
          xmlns:svg="http://www.w3.org/2000/svg"
          xmlns:ns3="http://www.w3.org/1999/xhtml"
          xmlns:mml="http://www.w3.org/1998/Math/MathML"
          xmlns:db="http://docbook.org/ns/docbook">
  <info>
    <pubdate>March 2008</pubdate>
  </info>

  <refnamediv>
    <refname>qpsolve</refname>

    <refpurpose>linear quadratic programming solver</refpurpose>
  </refnamediv>

  <refsynopsisdiv>
    <title>Calling Sequence</title>

    <synopsis>[x [,iact [,iter [,f]]]]=qpsolve(Q,p,C,b,ci,cs,me)</synopsis>
  </refsynopsisdiv>

  <refsection>
    <title>Parameters</title>

    <variablelist>
      <varlistentry>
        <term>Q</term>

        <listitem>
          <para>real positive definite symmetric matrix (dimension <literal>n
          x n</literal>).</para>
        </listitem>
      </varlistentry>

      <varlistentry>
        <term>p</term>

        <listitem>
          <para>real (column) vector (dimension <literal> n</literal>)</para>
        </listitem>
      </varlistentry>

      <varlistentry>
        <term>C</term>

        <listitem>
          <para>real matrix (dimension <literal> (me + md) x n</literal>).
          This matrix may be dense or sparse.</para>
        </listitem>
      </varlistentry>

      <varlistentry>
        <term>b</term>

        <listitem>
          <para>RHS column vector (dimension <literal> m=(me +
          md)</literal>)</para>
        </listitem>
      </varlistentry>

      <varlistentry>
        <term>ci</term>

        <listitem>
          <para>column vector of lower-bounds (dimension
          <literal>n</literal>). If there are no lower bound constraints, put
          <literal>ci = []</literal>. If some components of
          <literal>x</literal> are bounded from below, set the other
          (unconstrained) values of <literal>ci</literal> to a very large
          negative number (e.g. <literal>ci(j) =
          -number_properties('huge')</literal>.</para>
        </listitem>
      </varlistentry>

      <varlistentry>
        <term>cs</term>

        <listitem>
          <para>column vector of upper-bounds. (Same remarks as above).</para>
        </listitem>
      </varlistentry>

      <varlistentry>
        <term>me</term>

        <listitem>
          <para>number of equality constraints (i.e. <literal>C(1:me,:)*x =
          b(1:me)</literal>)</para>
        </listitem>
      </varlistentry>

      <varlistentry>
        <term>x</term>

        <listitem>
          <para>optimal solution found.</para>
        </listitem>
      </varlistentry>

      <varlistentry>
        <term>iact</term>

        <listitem>
          <para>vector, indicator of active constraints. The first non zero
          entries give the index of the active constraints</para>
        </listitem>
      </varlistentry>

      <varlistentry>
        <term>iter</term>

        <listitem>
          <para>. 2x1 vector, first component gives the number of "main"
          iterations, the second one says how many constraints were deleted
          after they became active.</para>
        </listitem>
      </varlistentry>
    </variablelist>
  </refsection>

  <refsection>
    <title>Description</title>

    <informalequation>
      <mediaobject>
        <imageobject>
          <imagedata align="center" fileref="../mml/qld_equation_1.mml" />
        </imageobject>
      </mediaobject>
    </informalequation>

    <para>This function requires <literal>Q</literal> to be symmetric positive
    definite. If that hypothesis is not satisfied, one may use the quapro
    function, which is provided in the Scilab quapro toolbox.</para>

    <para>The qpsolve solver is implemented as a Scilab script, which calls
    the compiled qp_solve primitive. It is provided as a facility, in order to
    be a direct replacement for the former quapro solver : indeed, the qpsolve
    solver has been designed so that it provides the same interface, that is,
    the same input/output arguments. But the x0 and imp input arguments are
    available in quapro, but not in qpsolve.</para>
  </refsection>

  <refsection>
    <title>Examples</title>

    <programlisting role="example"><![CDATA[ 
//Find x in R^6 such that:
//C1*x = b1 (3 equality constraints i.e me=3)
C1= [1,-1,1,0,3,1;
    -1,0,-3,-4,5,6;
     2,5,3,0,1,0];
b1=[1;2;3];

//C2*x <= b2 (2 inequality constraints)
C2=[0,1,0,1,2,-1;
    -1,0,2,1,1,0];
b2=[-1;2.5];

//with  x between ci and cs:
ci=[-1000;-10000;0;-1000;-1000;-1000];
cs=[10000;100;1.5;100;100;1000];

//and minimize 0.5*x'*Q*x + p'*x with
p=[1;2;3;4;5;6]; Q=eye(6,6);

//No initial point is given;
C=[C1;C2];
b=[b1;b2];
me=3;
[x,iact,iter,f]=qpsolve(Q,p,C,b,ci,cs,me)
//Only linear constraints (1 to 4) are active 
 ]]></programlisting>
  </refsection>

  <refsection>
    <title>See Also</title>

    <simplelist type="inline">
      <member><link linkend="optim">optim</link></member>

      <member><link linkend="qp_solve">qp_solve</link></member>

      <member><link linkend="qld">qld</link></member>
    </simplelist>

    <para>The contributed toolbox "quapro" may also be of interest, in
    particular for singular <literal>Q</literal>.</para>
  </refsection>

  <refsection>
    <title>Memory requirements</title>

    <para>Let r be</para>

    <programlisting role = ""><![CDATA[  
r=min(m,n)
 ]]></programlisting>

    <para>Then the memory required by qpsolve during the computations
    is</para>

    <programlisting role =""><![CDATA[ 
2*n+r*(r+5)/2 + 2*m +1
 ]]></programlisting>
  </refsection>

  <refsection>
    <title>Authors</title>

    <variablelist>
      <varlistentry>
        <term>S. Steer</term>

        <listitem>
          <para>INRIA (Scilab interface)</para>
        </listitem>
      </varlistentry>

      <varlistentry>
        <term>Berwin A. Turlach</term>

        <listitem>
          <para>School of Mathematics and Statistics (M019), The University of
          Western Australia, Crawley, AUSTRALIA (solver code)</para>
        </listitem>
      </varlistentry>
    </variablelist>
  </refsection>

  <refsection>
    <title>References</title>

    <itemizedlist>
      <listitem>
        <para>Goldfarb, D. and Idnani, A. (1982). "Dual and Primal-Dual
        Methods for Solving Strictly Convex Quadratic Programs", in J.P.
        Hennart (ed.), Numerical Analysis, Proceedings, Cocoyoc, Mexico 1981,
        Vol. 909 of Lecture Notes in Mathematics, Springer-Verlag, Berlin, pp.
        226-239.</para>
      </listitem>

      <listitem>
        <para>Goldfarb, D. and Idnani, A. (1983). "A numerically stable dual
        method for solving strictly convex quadratic programs", Mathematical
        Programming 27: 1-33.</para>
      </listitem>

      <listitem>
        <para>QuadProg (Quadratic Programming Routines), Berwin A
        Turlach,<ulink
        url="http://www.maths.uwa.edu.au/~berwin/software/quadprog.html">http://www.maths.uwa.edu.au/~berwin/software/quadprog.html</ulink></para>
      </listitem>
    </itemizedlist>
  </refsection>

  <refsection>
    <title>Used Functions</title>

    <para>qpgen1.f (also named QP.solve.f) developped by Berwin A. Turlach
    according to the Goldfarb/Idnani algorithm</para>
  </refsection>
</refentry>