glpk-input-parameters.html 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. <html lang="en">
  2. <head>
  3. <title>glpk input parameters - avram - a virtual machine code interpreter</title>
  4. <meta http-equiv="Content-Type" content="text/html">
  5. <meta name="description" content="avram - a virtual machine code interpreter">
  6. <meta name="generator" content="makeinfo 4.13">
  7. <link title="Top" rel="start" href="index.html#Top">
  8. <link rel="up" href="glpk.html#glpk" title="glpk">
  9. <link rel="prev" href="glpk.html#glpk" title="glpk">
  10. <link rel="next" href="glpk-output.html#glpk-output" title="glpk output">
  11. <link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage">
  12. <meta http-equiv="Content-Style-Type" content="text/css">
  13. <style type="text/css"><!--
  14. pre.display { font-family:inherit }
  15. pre.format { font-family:inherit }
  16. pre.smalldisplay { font-family:inherit; font-size:smaller }
  17. pre.smallformat { font-family:inherit; font-size:smaller }
  18. pre.smallexample { font-size:smaller }
  19. pre.smalllisp { font-size:smaller }
  20. span.sc { font-variant:small-caps }
  21. span.roman { font-family:serif; font-weight:normal; }
  22. span.sansserif { font-family:sans-serif; font-weight:normal; }
  23. --></style>
  24. </head>
  25. <body>
  26. <div class="node">
  27. <a name="glpk-input-parameters"></a>
  28. <p>
  29. Next:&nbsp;<a rel="next" accesskey="n" href="glpk-output.html#glpk-output">glpk output</a>,
  30. Previous:&nbsp;<a rel="previous" accesskey="p" href="glpk.html#glpk">glpk</a>,
  31. Up:&nbsp;<a rel="up" accesskey="u" href="glpk.html#glpk">glpk</a>
  32. <hr>
  33. </div>
  34. <h4 class="subsection">D.4.1 <code>glpk</code> input parameters</h4>
  35. <p>The argument must be a triple of the form,
  36. <code>(</code><var>c</var><code>,(</code><var>m</var><code>,</code><var>y</var><code>))</code>, subject to the following specification.
  37. <ul>
  38. <li><var>c</var>
  39. is a list of cost function coefficients as floating point numbers (see
  40. <a href="math.html#math">math</a>). There should be one item of <var>c</var> for each variable in
  41. the linear programming problem (Note that there is no additive
  42. constant, which would require one extra).
  43. <p>The interpretation of <var>c</var> is that an assignment of non-negative
  44. values to the variables <var>x</var> is sought to make the vector inner
  45. product <var>c</var> <var>x</var> as small as possible.
  46. <li><var>m</var>
  47. is a sparse matrix represented as a list of triples in the form
  48. <a name="index-sparse-matrix-715"></a>
  49. <pre class="example"> &lt;((<var>i</var>,<var>j</var>),<var>a</var>)...&gt;
  50. </pre>
  51. <p class="noindent">where <var>i</var> and <var>j</var> are row and column indices as natural
  52. numbers starting from 0 and <var>a</var> is a non-zero floating point
  53. number. The presence of a triple <code>((</code><var>i</var><code>,</code><var>j</var><code>),</code><var>a</var><code>)</code> in
  54. the list indicates that the <var>i</var>,<var>j</var>-th entry in the matrix has
  55. a value of <var>a</var>. Missing combinations of <var>i</var> and <var>j</var>
  56. indicate that the corresponding entry is zero.
  57. <p>The interpretation of <var>m</var> is that together with <var>y</var> it
  58. specifies a system of equations the variables in the solution <var>x</var>
  59. must satisfy simultaneously, as explained below.
  60. <li><var>y</var>
  61. is a list of floating point numbers, with one number for each distinct value of
  62. <var>i</var> in <var>m</var>, above, needed to complete the equations.
  63. <p>The interpretation of <var>y</var> is that in matrix notation, the
  64. condition <var>m</var> <var>x</var> = <var>y</var> must be met by any acceptable
  65. solution <var>x</var>.
  66. <p>To put it another way, for each distinct value of <var>i</var>, the <var>i</var>-th item
  67. of <var>y</var> has to equal the sum over all <var>j</var> of <var>xj</var> <var>a</var>,
  68. where <var>a</var> is the real number appearing in the triple
  69. <code>((</code><var>i</var><code>,</code><var>j</var><code>),</code><var>a</var><code>)</code> in <var>m</var>, if any, and <var>xj</var> is
  70. the <var>j</var>-th variable of the solution.
  71. </ul>
  72. </body></html>