kinsol-input-parameters.html 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. <html lang="en">
  2. <head>
  3. <title>kinsol 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="kinsol.html#kinsol" title="kinsol">
  9. <link rel="prev" href="kinsol.html#kinsol" title="kinsol">
  10. <link rel="next" href="kinsol-output.html#kinsol-output" title="kinsol 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="kinsol-input-parameters"></a>
  28. <p>
  29. Next:&nbsp;<a rel="next" accesskey="n" href="kinsol-output.html#kinsol-output">kinsol output</a>,
  30. Previous:&nbsp;<a rel="previous" accesskey="p" href="kinsol.html#kinsol">kinsol</a>,
  31. Up:&nbsp;<a rel="up" accesskey="u" href="kinsol.html#kinsol">kinsol</a>
  32. <hr>
  33. </div>
  34. <h4 class="subsection">D.9.1 <code>kinsol</code> input parameters</h4>
  35. <p>Functions whose names are of the form <var>x</var><code>d_</code><var>zzzzz</var>
  36. take an argument of the form
  37. <code>(</code><var>f</var><code>,(</code><var>i</var><code>,</code><var>o</var><code>))</code>,
  38. and functions whose names are of the form <var>x</var><code>j_</code><var>zzzzz</var>
  39. take an argument of the form
  40. <code>((</code><var>f</var><code>,</code><var>j</var><code>),(</code><var>i</var><code>,</code><var>o</var><code>))</code>.
  41. The parameters have these interpretations.
  42. <ul>
  43. <li><var>f</var> is a function to be optimized, expressed in virtual machine
  44. code. It takes a list of real numbers as input and returns a list of
  45. real numbers as output. The numbers must be in floating point format
  46. as described in <a href="math.html#math">math</a>.
  47. <li><var>j</var> is a function in virtual machine code that computes the
  48. Jacobian or partial derivatives of <var>f</var> for a given list of input
  49. <a name="index-Jacobian-741"></a>numbers. The exact calling convention for <var>j</var> depends on the
  50. optimization algorithm selected, as explained below.
  51. <li><var>i</var> is a list of real numbers suitable as an input for <var>f</var>.
  52. The exact values of the numbers in <var>i</var> are not crucial but the
  53. length of <var>i</var> is taken as an indication of the required length for
  54. any input list to <var>f</var>. In the case of constrained optimization
  55. problems (i.e., functions with names beginning with <code>c</code>), <var>i</var> must
  56. consist entirely of non-negative numbers.
  57. <li><var>o</var> is a list numbers indicating the &ldquo;optimal&rdquo; output from
  58. <var>f</var> in the sense described below (<a href="kinsol-output.html#kinsol-output">kinsol output</a>). Its length
  59. is taken to indicate the usual length of an output returned by
  60. <var>f</var>.
  61. </ul>
  62. <p>If the optimization problem is being solved by either the
  63. <code>cj_dense</code> or the <code>uj_dense</code> method, the Jacobian parameter
  64. <var>j</var> is expected to take a list <var>v</var> of real numbers the length
  65. of <var>i</var> as input and return a list of lists of reals as output. The
  66. numbers are represented as described in <a href="math.html#math">math</a>. The outer list in
  67. the output from <var>j</var> is required to be the length of <var>o</var>, while
  68. each inner list is required to be the length of <var>i</var>.
  69. <p>The output from <var>j</var> is interpreted as a matrix of the form
  70. described in <a href="Two-dimensional-arrays.html#Two-dimensional-arrays">Two dimensional arrays</a>. The entry in row <var>m</var>
  71. and column <var>n</var> is the partial derivative (evaluated at <var>v</var>) of
  72. the <var>m</var>-th component of the output of <var>f</var> with respect to the
  73. <var>n</var>-th item of the input list.
  74. <p>For optimization problems being solved by the methods of
  75. <var>x</var><code>j_gmres</code>, <var>x</var><code>j_bicgs</code>, or
  76. <var>x</var><code>j_tfqmr</code>, (i.e., where <var>x</var> is either <code>c</code> or
  77. <code>u</code>) the Jacobian function <var>j</var> follows a different convention
  78. that is meant to be more memory efficient. Given an argument of the
  79. form <code>(</code><var>m</var><code>,</code><var>v</var><code>)</code>, it returns only the <var>m</var>-th row of
  80. the matrix described above instead of the whole thing. The parameter
  81. <var>m</var> is a natural number less than the length of <var>o</var>, and
  82. <var>v</var> is a list of real numbers the length of <var>i</var> the same as
  83. above. The number <var>m</var> is encoded as described in
  84. <a href="Representation-of-Numeric-and-Textual-Data.html#Representation-of-Numeric-and-Textual-Data">Representation of Numeric and Textual Data</a>.
  85. </body></html>