lapack-calling-conventions.html 9.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146
  1. <html lang="en">
  2. <head>
  3. <title>lapack calling conventions - 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="lapack.html#lapack" title="lapack">
  9. <link rel="prev" href="lapack.html#lapack" title="lapack">
  10. <link rel="next" href="lapack-exceptions.html#lapack-exceptions" title="lapack exceptions">
  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="lapack-calling-conventions"></a>
  28. <p>
  29. Next:&nbsp;<a rel="next" accesskey="n" href="lapack-exceptions.html#lapack-exceptions">lapack exceptions</a>,
  30. Previous:&nbsp;<a rel="previous" accesskey="p" href="lapack.html#lapack">lapack</a>,
  31. Up:&nbsp;<a rel="up" accesskey="u" href="lapack.html#lapack">lapack</a>
  32. <hr>
  33. </div>
  34. <h4 class="subsection">D.10.1 <code>lapack</code> calling conventions</h4>
  35. <p>A table describing the inputs and outputs to the <code>lapack</code> library
  36. functions listed by their function names is given in this
  37. section. Some general points related to most of the functions are
  38. mentioned first.
  39. <ul>
  40. <li>References to vectors, matrices, and packed matrices should be
  41. understood as their list representations explained in <a href="Type-Conversions.html#Type-Conversions">Type Conversions</a>. Although <code>LAPACK</code> internally uses column order
  42. arrays, the virtual code library interface exhibits a matrix as a list
  43. of lists with one inner list for each row.
  44. <li>Some functions require a symmetric matrix as an input parameter. Any
  45. <a name="index-symmetric-matrices-750"></a>input parameter that is required to be a symmetric matrix may be
  46. specified optionally either in square form or in triangular form as
  47. <a name="index-triangular-matrices-751"></a>described in <a href="Two-dimensional-arrays.html#Two-dimensional-arrays">Two dimensional arrays</a>. If a square matrix form is
  48. used, symmetry is not checked and the lower triangular portion is
  49. ignored.
  50. <li>Some function names are listed in pairs differing only in the first
  51. letter. Function names beginning with <code>d</code> pertain to vectors or
  52. matrices of real numbers (<a href="math.html#math">math</a>), and function names beginning
  53. with <code>z</code> pertain to complex numbers (<a href="complex.html#complex">complex</a>). The
  54. specifications of similarly named functions are otherwise identical.
  55. </ul>
  56. <dl>
  57. <dt><code>dgesvx</code><br><dt><code>zgesvx</code><dd>These library functions take a pair <code>(</code><var>a</var><code>,</code><var>b</var><code>)</code> where
  58. <var>a</var> is an <var>n</var> by <var>n</var> matrix and <var>b</var> is a vector of
  59. length <var>n</var>. If <var>a</var> is non-singular, they return a
  60. vector <var>x</var> such that <var>a</var> <var>x</var><code> = </code><var>b</var>.
  61. Otherwise they return an empty list.
  62. <br><dt><code>dgelsd</code><br><dt><code>zgelsd</code><dd>These functions generalize those above by taking a pair
  63. <code>(</code><var>a</var><code>,</code><var>b</var><code>)</code> where <var>a</var> is an <var>m</var> by <var>n</var> matrix
  64. and <var>b</var> is a vector of length <var>m</var>, with <var>m</var> greater than
  65. <var>n</var>. They return a vector <var>x</var> of length <var>n</var> to minimize
  66. the magnitude of <var>b</var><code> - </code><var>a</var> <var>x</var>.
  67. <br><dt><code>dgesdd</code><br><dt><code>zgesdd</code><dd>These functions take a list of <var>m</var> time series (i.e., vectors)
  68. each of length <var>n</var> and return a list of basis vectors each of
  69. length <var>n</var>. The basis vectors span the set of time series in the
  70. <a name="index-singular-value-decomposition-752"></a>given list according to the singular value decomposition (i.e., with
  71. the basis vectors forming a series in order of decreasing
  72. significance). The number of basis vectors is at most
  73. <var>min</var><code>(</code><var>m</var><code>,</code><var>n</var><code>)</code> but could be less if the input time
  74. series aren't linearly independent. An empty list could be returned
  75. due to lack of convergence.
  76. <br><dt><code>dgeevx</code><br><dt><code>zgeevx</code><dd>These functions take a non-symmetric square matrix and
  77. return a pair <code>(</code><var>e</var><code>,</code><var>v</var><code>)</code> where <var>e</var> is a list of
  78. eigenvectors and <var>v</var> is a list of eigenvalues, both of which will
  79. <a name="index-eigenvectors-753"></a>contain only complex numbers. (N.B., both functions return complex
  80. results even though <code>dgeevx</code> takes real input.) They could also
  81. return <code>nil</code> due to a lack of convergence.
  82. <br><dt><code>dpptrf</code><br><dt><code>zpptrf</code><dd>These functions take a symmetric square matrix and
  83. return one of the Cholesky factors. The Cholesky factors are a pair
  84. <a name="index-Cholesky-decomposition-754"></a>of triangular matrices, each equal to the transpose of the other,
  85. whose product is the original matrix.
  86. <ul>
  87. <li>If the input matrix is specified in lower triangular form, the lower
  88. triangular Cholesky factor is returned.
  89. <li>If the input matrix is specified in square or upper triangular form,
  90. the upper triangular Cholesky factor is returned.
  91. <li>In either case, the result is returned in triangular form.
  92. </ul>
  93. <br><dt><code>dggglm</code><br><dt><code>zggglm</code><dd>The input is a pair of matrices and a vector
  94. <a name="index-generalized-least-squares-755"></a><a name="index-least-squares-756"></a><code>((</code><var>A</var><code>,</code><var>B</var><code>),</code><var>d</var><code>)</code>. The output is a pair of vectors
  95. <code>(</code><var>x</var><code>,</code><var>y</var><code>)</code> satisfying <var>A</var><var>x</var><code> +
  96. </code><var>B</var><var>y</var><code> = </code><var>d</var> for which the magnitude of <var>y</var> is
  97. minimal. The dimensions all have to be consistent, which means
  98. the number of rows in <var>A</var> and <var>B</var> is the length of <var>d</var>,
  99. the number of columns in <var>A</var> is the length of <var>x</var>, and
  100. the number of columns in <var>B</var> is the length of <var>y</var>.
  101. <br><dt><code>dgglse</code><br><dt><code>zgglse</code><dd>The input is of the form <code>((</code><var>A</var><code>,</code><var>c</var><code>),(</code><var>B</var><code>,</code><var>d</var><code>))</code>
  102. where <var>A</var> and <var>B</var> are matrices and <var>c</var> and <var>d</var> are
  103. vectors. The output is a vector <var>x</var> to minimize the magnitude of
  104. <var>A</var><var>x</var><code> - </code><var>c</var> subject to the constraint that
  105. <var>B</var><var>x</var><code> = </code><var>d</var>. The dimensions have to be consistent,
  106. which means <var>A</var> has <var>m</var> rows, <var>c</var> has length <var>m</var>,
  107. <var>B</var> has <var>p</var> rows, <var>d</var> has length <var>p</var>, both <var>A</var> and
  108. <var>B</var> have <var>n</var> columns, and the output <var>x</var> has length
  109. <var>n</var>. It is also a requirement that <var>p</var><code> &lt;= </code><var>n</var><code> &lt;=
  110. </code><var>m</var><code> + </code><var>p</var>.
  111. <br><dt><code>dsyevr</code><dd>This function takes a symmetric real matrix and returns a pair
  112. <code>(</code><var>e</var><code>,</code><var>v</var><code>)</code> where <var>e</var> is a list of eigenvectors and
  113. <var>v</var> is a list of eigenvalues. Both contain only real numbers.
  114. This function is fast and accurate but not as storage efficient as
  115. possible. If there is insufficient memory, it automatically invokes
  116. <code>dspev</code>.
  117. <br><dt><code>dspev</code><dd>This function takes a symmetric real matrix and returns a pair
  118. <code>(</code><var>e</var><code>,</code><var>v</var><code>)</code> where <var>e</var> is a list of eigenvectors and
  119. <var>v</var> is a list of eigenvalues. Both contain only real numbers. It
  120. uses roughly half the memory of <code>dsyevr</code> but is not as fast or
  121. accurate.
  122. <br><dt><code>zheevr</code><dd>This function takes a complex Hermitian matrix and returns a pair
  123. <a name="index-Hermitian-matrix-757"></a><code>(</code><var>e</var><code>,</code><var>v</var><code>)</code> where <var>e</var> is a list of eigenvectors and
  124. <var>v</var> is a list of eigenvalues. The eigenvectors are complex but the
  125. eigenvalues are real.
  126. <ul>
  127. <li>A Hermitian matrix has <var>Aij</var> equal to the complex conjugate of
  128. <var>Aji</var>.
  129. <li>Although not exactly symmetric, a Hermitian matrix may nevertheless
  130. be given in either upper or lower triangular form.
  131. <li>This function is faster but less storage efficient than <code>zhpev</code>,
  132. and calls it automatically if it runs out of memory.
  133. </ul>
  134. <br><dt><code>zhpev</code><dd>This function has the same inputs and approximate outputs as
  135. <code>zheevr</code> but is slower and more memory efficient because it uses
  136. only packed matrices.
  137. </dl>
  138. </body></html>