PageRenderTime 72ms CodeModel.GetById 25ms RepoModel.GetById 1ms app.codeStats 1ms

/src/lib/libqt/lapack_intfc.cc

https://gitlab.com/y-shao/psi4public
C++ | 12343 lines | 893 code | 121 blank | 11329 comment | 0 complexity | 5f62f5e55b7d33b0f1c546d75ddc1322 MD5 | raw file

Large files files are truncated, but you can click here to view the full file

  1. /*
  2. *@BEGIN LICENSE
  3. *
  4. * PSI4: an ab initio quantum chemistry software package
  5. *
  6. * This program is free software; you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License as published by
  8. * the Free Software Foundation; either version 2 of the License, or
  9. * (at your option) any later version.
  10. *
  11. * This program is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. * GNU General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU General Public License along
  17. * with this program; if not, write to the Free Software Foundation, Inc.,
  18. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  19. *
  20. *@END LICENSE
  21. */
  22. /**!
  23. ** \file
  24. ** \brief Interface to all LAPACK routines
  25. ** \ingroup QT
  26. **
  27. ** Autogenerated by Rob Parrish on 1/23/2011
  28. **
  29. */
  30. #include "qt.h"
  31. #include "lapack_intfc_mangle.h"
  32. extern "C" {
  33. extern int F_DBDSDC(char*, char*, int*, double*, double*, double*, int*, double*, int*, double*, int*, double*, int*, int*);
  34. extern int F_DBDSQR(char*, int*, int*, int*, int*, double*, double*, double*, int*, double*, int*, double*, int*, double*, int*);
  35. extern int F_DDISNA(char*, int*, int*, double*, double*, int*);
  36. extern int F_DGBBRD(char*, int*, int*, int*, int*, int*, double*, int*, double*, double*, double*, int*, double*, int*, double*, int*, double*, int*);
  37. extern int F_DGBCON(char*, int*, int*, int*, double*, int*, int*, double*, double*, double*, int*, int*);
  38. extern int F_DGBEQU(int*, int*, int*, int*, double*, int*, double*, double*, double*, double*, double*, int*);
  39. extern int F_DGBRFS(char*, int*, int*, int*, int*, double*, int*, double*, int*, int*, double*, int*, double*, int*, double*, double*, double*, int*, int*);
  40. extern int F_DGBSV(int*, int*, int*, int*, double*, int*, int*, double*, int*, int*);
  41. extern int F_DGBSVX(char*, char*, int*, int*, int*, int*, double*, int*, double*, int*, int*, char*, double*, double*, double*, int*, double*, int*, double*, double*, double*, double*, int*, int*);
  42. extern int F_DGBTRF(int*, int*, int*, int*, double*, int*, int*, int*);
  43. extern int F_DGBTRS(char*, int*, int*, int*, int*, double*, int*, int*, double*, int*, int*);
  44. extern int F_DGEBAK(char*, char*, int*, int*, int*, double*, int*, double*, int*, int*);
  45. extern int F_DGEBAL(char*, int*, double*, int*, int*, int*, double*, int*);
  46. extern int F_DGEBRD(int*, int*, double*, int*, double*, double*, double*, double*, double*, int*, int*);
  47. extern int F_DGECON(char*, int*, double*, int*, double*, double*, double*, int*, int*);
  48. extern int F_DGEEQU(int*, int*, double*, int*, double*, double*, double*, double*, double*, int*);
  49. extern int F_DGEES(char*, char*, int*, double*, int*, int*, double*, double*, double*, int*, double*, int*, int*);
  50. extern int F_DGEESX(char*, char*, char*, int*, double*, int*, int*, double*, double*, double*, int*, double*, double*, double*, int*, int*, int*, int*);
  51. extern int F_DGEEV(char*, char*, int*, double*, int*, double*, double*, double*, int*, double*, int*, double*, int*, int*);
  52. extern int F_DGEEVX(char*, char*, char*, char*, int*, double*, int*, double*, double*, double*, int*, double*, int*, int*, int*, double*, double*, double*, double*, double*, int*, int*, int*);
  53. extern int F_DGEGS(char*, char*, int*, double*, int*, double*, int*, double*, double*, double*, double*, int*, double*, int*, double*, int*, int*);
  54. extern int F_DGEGV(char*, char*, int*, double*, int*, double*, int*, double*, double*, double*, double*, int*, double*, int*, double*, int*, int*);
  55. extern int F_DGEHRD(int*, int*, int*, double*, int*, double*, double*, int*, int*);
  56. extern int F_DGELQF(int*, int*, double*, int*, double*, double*, int*, int*);
  57. extern int F_DGELS(char*, int*, int*, int*, double*, int*, double*, int*, double*, int*, int*);
  58. extern int F_DGELSD(int*, int*, int*, double*, int*, double*, int*, double*, double*, int*, double*, int*, int*, int*);
  59. extern int F_DGELSS(int*, int*, int*, double*, int*, double*, int*, double*, double*, int*, double*, int*, int*);
  60. extern int F_DGELSX(int*, int*, int*, double*, int*, double*, int*, int*, double*, int*, double*, int*);
  61. extern int F_DGELSY(int*, int*, int*, double*, int*, double*, int*, int*, double*, int*, double*, int*, int*);
  62. extern int F_DGEQLF(int*, int*, double*, int*, double*, double*, int*, int*);
  63. extern int F_DGEQP3(int*, int*, double*, int*, int*, double*, double*, int*, int*);
  64. extern int F_DGEQPF(int*, int*, double*, int*, int*, double*, double*, int*);
  65. extern int F_DGEQRF(int*, int*, double*, int*, double*, double*, int*, int*);
  66. extern int F_DGERFS(char*, int*, int*, double*, int*, double*, int*, int*, double*, int*, double*, int*, double*, double*, double*, int*, int*);
  67. extern int F_DGERQF(int*, int*, double*, int*, double*, double*, int*, int*);
  68. extern int F_DGESDD(char*, int*, int*, double*, int*, double*, double*, int*, double*, int*, double*, int*, int*, int*);
  69. extern int F_DGESV(int*, int*, double*, int*, int*, double*, int*, int*);
  70. extern int F_DGESVX(char*, char*, int*, int*, double*, int*, double*, int*, int*, char*, double*, double*, double*, int*, double*, int*, double*, double*, double*, double*, int*, int*);
  71. extern int F_DGETRF(int*, int*, double*, int*, int*, int*);
  72. extern int F_DGETRI(int*, double*, int*, int*, double*, int*, int*);
  73. extern int F_DGETRS(char*, int*, int*, double*, int*, int*, double*, int*, int*);
  74. extern int F_DGGBAK(char*, char*, int*, int*, int*, double*, double*, int*, double*, int*, int*);
  75. extern int F_DGGBAL(char*, int*, double*, int*, double*, int*, int*, int*, double*, double*, double*, int*);
  76. extern int F_DGGES(char*, char*, char*, int*, double*, int*, double*, int*, int*, double*, double*, double*, double*, int*, double*, int*, double*, int*, int*);
  77. extern int F_DGGESX(char*, char*, char*, char*, int*, double*, int*, double*, int*, int*, double*, double*, double*, double*, int*, double*, int*, double*, double*, double*, int*, int*, int*, int*);
  78. extern int F_DGGEV(char*, char*, int*, double*, int*, double*, int*, double*, double*, double*, double*, int*, double*, int*, double*, int*, int*);
  79. extern int F_DGGEVX(char*, char*, char*, char*, int*, double*, int*, double*, int*, double*, double*, double*, double*, int*, double*, int*, int*, int*, double*, double*, double*, double*, double*, double*, double*, int*, int*, int*);
  80. extern int F_DGGGLM(int*, int*, int*, double*, int*, double*, int*, double*, double*, double*, double*, int*, int*);
  81. extern int F_DGGHRD(char*, char*, int*, int*, int*, double*, int*, double*, int*, double*, int*, double*, int*, int*);
  82. extern int F_DGGLSE(int*, int*, int*, double*, int*, double*, int*, double*, double*, double*, double*, int*, int*);
  83. extern int F_DGGQRF(int*, int*, int*, double*, int*, double*, double*, int*, double*, double*, int*, int*);
  84. extern int F_DGGRQF(int*, int*, int*, double*, int*, double*, double*, int*, double*, double*, int*, int*);
  85. extern int F_DGGSVD(char*, char*, char*, int*, int*, int*, int*, int*, double*, int*, double*, int*, double*, double*, double*, int*, double*, int*, double*, int*, double*, int*, int*);
  86. extern int F_DGGSVP(char*, char*, char*, int*, int*, int*, double*, int*, double*, int*, double*, double*, int*, int*, double*, int*, double*, int*, double*, int*, int*, double*, double*, int*);
  87. extern int F_DGTCON(char*, int*, double*, double*, double*, double*, int*, double*, double*, double*, int*, int*);
  88. extern int F_DGTRFS(char*, int*, int*, double*, double*, double*, double*, double*, double*, double*, int*, double*, int*, double*, int*, double*, double*, double*, int*, int*);
  89. extern int F_DGTSV(int*, int*, double*, double*, double*, double*, int*, int*);
  90. extern int F_DGTSVX(char*, char*, int*, int*, double*, double*, double*, double*, double*, double*, double*, int*, double*, int*, double*, int*, double*, int*);
  91. extern int F_DGTTRF(int*, double*, double*, double*, double*, int*, int*);
  92. extern int F_DGTTRS(char*, int*, int*, double*, double*, double*, double*, int*, double*, int*, int*);
  93. extern int F_DHGEQZ(char*, char*, char*, int*, int*, int*, double*, int*, double*, int*, double*, double*, double*, double*, int*, double*, int*, double*, int*, int*);
  94. extern int F_DHSEIN(char*, char*, char*, int*, double*, int*, double*, double*, double*, int*, double*, int*, int*, int*, double*, int*, int*, int*);
  95. extern int F_DHSEQR(char*, char*, int*, int*, int*, double*, int*, double*, double*, double*, int*, double*, int*, int*);
  96. extern int F_DOPGTR(char*, int*, double*, double*, double*, int*, double*, int*);
  97. extern int F_DOPMTR(char*, char*, char*, int*, int*, double*, double*, double*, int*, double*, int*);
  98. extern int F_DORGBR(char*, int*, int*, int*, double*, int*, double*, double*, int*, int*);
  99. extern int F_DORGHR(int*, int*, int*, double*, int*, double*, double*, int*, int*);
  100. extern int F_DORGLQ(int*, int*, int*, double*, int*, double*, double*, int*, int*);
  101. extern int F_DORGQL(int*, int*, int*, double*, int*, double*, double*, int*, int*);
  102. extern int F_DORGQR(int*, int*, int*, double*, int*, double*, double*, int*, int*);
  103. extern int F_DORGRQ(int*, int*, int*, double*, int*, double*, double*, int*, int*);
  104. extern int F_DORGTR(char*, int*, double*, int*, double*, double*, int*, int*);
  105. extern int F_DORMBR(char*, char*, char*, int*, int*, int*, double*, int*, double*, double*, int*, double*, int*, int*);
  106. extern int F_DORMHR(char*, char*, int*, int*, int*, int*, double*, int*, double*, double*, int*, double*, int*, int*);
  107. extern int F_DORMLQ(char*, char*, int*, int*, int*, double*, int*, double*, double*, int*, double*, int*, int*);
  108. extern int F_DORMQL(char*, char*, int*, int*, int*, double*, int*, double*, double*, int*, double*, int*, int*);
  109. extern int F_DORMQR(char*, char*, int*, int*, int*, double*, int*, double*, double*, int*, double*, int*, int*);
  110. extern int F_DORMR3(char*, char*, int*, int*, int*, int*, double*, int*, double*, double*, int*, double*, int*);
  111. extern int F_DORMRQ(char*, char*, int*, int*, int*, double*, int*, double*, double*, int*, double*, int*, int*);
  112. extern int F_DORMRZ(char*, char*, int*, int*, int*, int*, double*, int*, double*, double*, int*, double*, int*, int*);
  113. extern int F_DORMTR(char*, char*, char*, int*, int*, double*, int*, double*, double*, int*, double*, int*, int*);
  114. extern int F_DPBCON(char*, int*, int*, double*, int*, double*, double*, double*, int*, int*);
  115. extern int F_DPBEQU(char*, int*, int*, double*, int*, double*, double*, double*, int*);
  116. extern int F_DPBRFS(char*, int*, int*, int*, double*, int*, double*, int*, double*, int*, double*, int*, double*, double*, double*, int*, int*);
  117. extern int F_DPBSTF(char*, int*, int*, double*, int*, int*);
  118. extern int F_DPBSV(char*, int*, int*, int*, double*, int*, double*, int*, int*);
  119. extern int F_DPBSVX(char*, char*, int*, int*, int*, double*, int*, double*, int*, char*, double*, double*, int*, double*, int*, double*, double*, double*, double*, int*, int*);
  120. extern int F_DPBTRF(char*, int*, int*, double*, int*, int*);
  121. extern int F_DPBTRS(char*, int*, int*, int*, double*, int*, double*, int*, int*);
  122. extern int F_DPOCON(char*, int*, double*, int*, double*, double*, double*, int*, int*);
  123. extern int F_DPOEQU(int*, double*, int*, double*, double*, double*, int*);
  124. extern int F_DPORFS(char*, int*, int*, double*, int*, double*, int*, double*, int*, double*, int*, double*, double*, double*, int*, int*);
  125. extern int F_DPOSV(char*, int*, int*, double*, int*, double*, int*, int*);
  126. extern int F_DPOSVX(char*, char*, int*, int*, double*, int*, double*, int*, char*, double*, double*, int*, double*, int*, double*, double*, double*, double*, int*, int*);
  127. extern int F_DPOTRF(char*, int*, double*, int*, int*);
  128. extern int F_DPOTRI(char*, int*, double*, int*, int*);
  129. extern int F_DPOTRS(char*, int*, int*, double*, int*, double*, int*, int*);
  130. extern int F_DPPCON(char*, int*, double*, double*, double*, double*, int*, int*);
  131. extern int F_DPPEQU(char*, int*, double*, double*, double*, double*, int*);
  132. extern int F_DPPRFS(char*, int*, int*, double*, double*, double*, int*, double*, int*, double*, double*, double*, int*, int*);
  133. extern int F_DPPSV(char*, int*, int*, double*, double*, int*, int*);
  134. extern int F_DPPSVX(char*, char*, int*, int*, double*, double*, char*, double*, double*, int*, double*, int*, double*, double*, double*, double*, int*, int*);
  135. extern int F_DPPTRF(char*, int*, double*, int*);
  136. extern int F_DPPTRI(char*, int*, double*, int*);
  137. extern int F_DPPTRS(char*, int*, int*, double*, double*, int*, int*);
  138. extern int F_DPTCON(int*, double*, double*, double*, double*, double*, int*);
  139. extern int F_DPTEQR(char*, int*, double*, double*, double*, int*, double*, int*);
  140. extern int F_DPTRFS(int*, int*, double*, double*, double*, double*, double*, int*, double*, int*, double*, double*, double*, int*);
  141. extern int F_DPTSV(int*, int*, double*, double*, double*, int*, int*);
  142. extern int F_DPTSVX(char*, int*, int*, double*, double*, double*, double*, double*, int*, double*, int*, double*, double*, double*, double*, int*);
  143. extern int F_DPTTRF(int*, double*, double*, int*);
  144. extern int F_DPTTRS(int*, int*, double*, double*, double*, int*, int*);
  145. extern int F_DSBEV(char*, char*, int*, int*, double*, int*, double*, double*, int*, double*, int*);
  146. extern int F_DSBEVD(char*, char*, int*, int*, double*, int*, double*, double*, int*, double*, int*, int*, int*, int*);
  147. extern int F_DSBEVX(char*, char*, char*, int*, int*, double*, int*, double*, int*, double*, double*, int*, int*, double*, int*, double*, double*, int*, double*, int*, int*, int*);
  148. extern int F_DSBGST(char*, char*, int*, int*, int*, double*, int*, double*, int*, double*, int*, double*, int*);
  149. extern int F_DSBGV(char*, char*, int*, int*, int*, double*, int*, double*, int*, double*, double*, int*, double*, int*);
  150. extern int F_DSBGVD(char*, char*, int*, int*, int*, double*, int*, double*, int*, double*, double*, int*, double*, int*, int*, int*, int*);
  151. extern int F_DSBGVX(char*, char*, char*, int*, int*, int*, double*, int*, double*, int*, double*, int*, double*, double*, int*, int*, double*, int*, double*, double*, int*, double*, int*, int*, int*);
  152. extern int F_DSBTRD(char*, char*, int*, int*, double*, int*, double*, double*, double*, int*, double*, int*);
  153. extern int F_DSGESV(int*, int*, double*, int*, int*, double*, int*, double*, int*, double*, int*, int*);
  154. extern int F_DSPCON(char*, int*, double*, int*, double*, double*, double*, int*, int*);
  155. extern int F_DSPEV(char*, char*, int*, double*, double*, double*, int*, double*, int*);
  156. extern int F_DSPEVD(char*, char*, int*, double*, double*, double*, int*, double*, int*, int*, int*, int*);
  157. extern int F_DSPEVX(char*, char*, char*, int*, double*, double*, double*, int*, int*, double*, int*, double*, double*, int*, double*, int*, int*, int*);
  158. extern int F_DSPGST(int*, char*, int*, double*, double*, int*);
  159. extern int F_DSPGV(int*, char*, char*, int*, double*, double*, double*, double*, int*, double*, int*);
  160. extern int F_DSPGVD(int*, char*, char*, int*, double*, double*, double*, double*, int*, double*, int*, int*, int*, int*);
  161. extern int F_DSPGVX(int*, char*, char*, char*, int*, double*, double*, double*, double*, int*, int*, double*, int*, double*, double*, int*, double*, int*, int*, int*);
  162. extern int F_DSPRFS(char*, int*, int*, double*, double*, int*, double*, int*, double*, int*, double*, double*, double*, int*, int*);
  163. extern int F_DSPSV(char*, int*, int*, double*, int*, double*, int*, int*);
  164. extern int F_DSPSVX(char*, char*, int*, int*, double*, double*, int*, double*, int*, double*, int*, double*, int*);
  165. extern int F_DSPTRD(char*, int*, double*, double*, double*, double*, int*);
  166. extern int F_DSPTRF(char*, int*, double*, int*, int*);
  167. extern int F_DSPTRI(char*, int*, double*, int*, double*, int*);
  168. extern int F_DSPTRS(char*, int*, int*, double*, int*, double*, int*, int*);
  169. extern int F_DSTEBZ(char*, char*, int*, double*, double*, int*, int*, double*, double*, double*, int*, int*, double*, int*, int*, double*, int*, int*);
  170. extern int F_DSTEDC(char*, int*, double*, double*, double*, int*, double*, int*, int*, int*, int*);
  171. extern int F_DSTEGR(char*, char*, int*, double*, double*, double*, double*, int*, int*, double*, int*, double*, double*, int*, int*, double*, int*, int*, int*, int*);
  172. extern int F_DSTEIN(int*, double*, double*, int*, double*, int*, int*, double*, int*, double*, int*, int*, int*);
  173. extern int F_DSTEQR(char*, int*, double*, double*, double*, int*, double*, int*);
  174. extern int F_DSTERF(int*, double*, double*, int*);
  175. extern int F_DSTEV(char*, int*, double*, double*, double*, int*, double*, int*);
  176. extern int F_DSTEVD(char*, int*, double*, double*, double*, int*, double*, int*, int*, int*, int*);
  177. extern int F_DSTEVR(char*, char*, int*, double*, double*, double*, double*, int*, int*, double*, int*, double*, double*, int*, int*, double*, int*, int*, int*, int*);
  178. extern int F_DSTEVX(char*, char*, int*, double*, double*, double*, double*, int*, int*, double*, int*, double*, double*, int*, double*, int*, int*, int*);
  179. extern int F_DSYCON(char*, int*, double*, int*, int*, double*, double*, double*, int*, int*);
  180. extern int F_DSYEV(char*, char*, int*, double*, int*, double*, double*, int*, int*);
  181. extern int F_DSYEVD(char*, char*, int*, double*, int*, double*, double*, int*, int*, int*, int*);
  182. extern int F_DSYEVR(char*, char*, char*, int*, double*, int*, double*, double*, int*, int*, double*, int*, double*, double*, int*, int*, double*, int*, int*, int*, int*);
  183. extern int F_DSYEVX(char*, char*, char*, int*, double*, int*, double*, double*, int*, int*, double*, int*, double*, double*, int*, double*, int*, int*, int*, int*);
  184. extern int F_DSYGST(int*, char*, int*, double*, int*, double*, int*, int*);
  185. extern int F_DSYGV(int*, char*, char*, int*, double*, int*, double*, int*, double*, double*, int*, int*);
  186. extern int F_DSYGVD(int*, char*, char*, int*, double*, int*, double*, int*, double*, double*, int*, int*, int*, int*);
  187. extern int F_DSYGVX(int*, char*, char*, char*, int*, double*, int*, double*, int*, double*, double*, int*, int*, double*, int*, double*, double*, int*, double*, int*, int*, int*, int*);
  188. extern int F_DSYRFS(char*, int*, int*, double*, int*, double*, int*, int*, double*, int*, double*, int*, double*, double*, double*, int*, int*);
  189. extern int F_DSYSV(char*, int*, int*, double*, int*, int*, double*, int*, double*, int*, int*);
  190. extern int F_DSYSVX(char*, char*, int*, int*, double*, int*, double*, int*, int*, double*, int*, double*, int*, double*, int*);
  191. extern int F_DSYTRD(char*, int*, double*, int*, double*, double*, double*, double*, int*, int*);
  192. extern int F_DSYTRF(char*, int*, double*, int*, int*, double*, int*, int*);
  193. extern int F_DSYTRI(char*, int*, double*, int*, int*, double*, int*);
  194. extern int F_DSYTRS(char*, int*, int*, double*, int*, int*, double*, int*, int*);
  195. extern int F_DTBCON(char*, char*, char*, int*, int*, double*, int*, double*, double*, int*, int*);
  196. extern int F_DTBRFS(char*, char*, char*, int*, int*, int*, double*, int*, double*, int*, double*, int*, double*, double*, double*, int*, int*);
  197. extern int F_DTBTRS(char*, char*, char*, int*, int*, int*, double*, int*, double*, int*, int*);
  198. extern int F_DTGEVC(char*, char*, int*, double*, int*, double*, int*, double*, int*, double*, int*, int*, int*, double*, int*);
  199. extern int F_DTGEXC(int*, double*, int*, double*, int*, double*, int*, double*, int*, int*, int*, double*, int*, int*);
  200. extern int F_DTGSEN(int*, int*, double*, int*, double*, int*, double*, double*, double*, double*, int*, double*, int*, int*, double*, double*, double*, double*, int*, int*, int*, int*);
  201. extern int F_DTGSJA(char*, char*, char*, int*, int*, int*, int*, int*, double*, int*, double*, int*, double*, double*, double*, double*, double*, int*, double*, int*, double*, int*, double*, int*, int*);
  202. extern int F_DTGSNA(char*, char*, int*, double*, int*, double*, int*, double*, int*, double*, int*, double*, double*, int*, int*, double*, int*, int*, int*);
  203. extern int F_DTGSYL(char*, int*, int*, int*, double*, int*, double*, int*, double*, int*, double*, int*, double*, int*, double*, int*, double*, double*, double*, int*, int*, int*);
  204. extern int F_DTPCON(char*, char*, char*, int*, double*, double*, double*, int*, int*);
  205. extern int F_DTPRFS(char*, char*, char*, int*, int*, double*, double*, int*, double*, int*, double*, double*, double*, int*, int*);
  206. extern int F_DTPTRI(char*, char*, int*, double*, int*);
  207. extern int F_DTPTRS(char*, char*, char*, int*, int*, double*, double*, int*, int*);
  208. extern int F_DTRCON(char*, char*, char*, int*, double*, int*, double*, double*, int*, int*);
  209. extern int F_DTREVC(char*, char*, int*, double*, int*, double*, int*, double*, int*, int*, int*, double*, int*);
  210. extern int F_DTREXC(char*, int*, double*, int*, double*, int*, int*, int*, double*, int*);
  211. extern int F_DTRRFS(char*, char*, char*, int*, int*, double*, int*, double*, int*, double*, int*, double*, double*, double*, int*, int*);
  212. extern int F_DTRSEN(char*, char*, int*, double*, int*, double*, int*, double*, double*, int*, double*, double*, double*, int*, int*, int*, int*);
  213. extern int F_DTRSNA(char*, char*, int*, double*, int*, double*, int*, double*, int*, double*, double*, int*, int*, double*, int*, int*, int*);
  214. extern int F_DTRSYL(char*, char*, int*, int*, int*, double*, int*, double*, int*, double*, int*, double*, int*);
  215. extern int F_DTRTRI(char*, char*, int*, double*, int*, int*);
  216. extern int F_DTRTRS(char*, char*, char*, int*, int*, double*, int*, double*, int*, int*);
  217. extern int F_DTZRQF(int*, int*, double*, int*, double*, int*);
  218. extern int F_DTZRZF(int*, int*, double*, int*, double*, double*, int*, int*);
  219. }
  220. namespace psi {
  221. /**
  222. * Purpose
  223. * =======
  224. *
  225. * DBDSDC computes the singular value decomposition (SVD) of a real
  226. * N-by-N (upper or lower) bidiagonal matrix B: B = U * S * VT,
  227. * using a divide and conquer method, where S is a diagonal matrix
  228. * with non-negative diagonal elements (the singular values of B), and
  229. * U and VT are orthogonal matrices of left and right singular vectors,
  230. * respectively. DBDSDC can be used to compute all singular values,
  231. * and optionally, singular vectors or singular vectors in compact form.
  232. *
  233. * This code makes very mild assumptions about floating point
  234. * arithmetic. It will work on machines with a guard digit in
  235. * add/subtract, or on those binary machines without guard digits
  236. * which subtract like the Cray X-MP, Cray Y-MP, Cray C-90, or Cray-2.
  237. * It could conceivably fail on hexadecimal or decimal machines
  238. * without guard digits, but we know of none. See DLASD3 for details.
  239. *
  240. * The code currently calls DLASDQ if singular values only are desired.
  241. * However, it can be slightly modified to compute singular values
  242. * using the divide and conquer method.
  243. *
  244. * Arguments
  245. * =========
  246. *
  247. * UPLO (input) CHARACTER*1
  248. * = 'U': B is upper bidiagonal.
  249. * = 'L': B is lower bidiagonal.
  250. *
  251. * COMPQ (input) CHARACTER*1
  252. * Specifies whether singular vectors are to be computed
  253. * as follows:
  254. * = 'N': Compute singular values only;
  255. * = 'P': Compute singular values and compute singular
  256. * vectors in compact form;
  257. * = 'I': Compute singular values and singular vectors.
  258. *
  259. * N (input) INTEGER
  260. * The order of the matrix B. N >= 0.
  261. *
  262. * D (input/output) DOUBLE PRECISION array, dimension (N)
  263. * On entry, the n diagonal elements of the bidiagonal matrix B.
  264. * On exit, if INFO=0, the singular values of B.
  265. *
  266. * E (input/output) DOUBLE PRECISION array, dimension (N-1)
  267. * On entry, the elements of E contain the offdiagonal
  268. * elements of the bidiagonal matrix whose SVD is desired.
  269. * On exit, E has been destroyed.
  270. *
  271. * U (output) DOUBLE PRECISION array, dimension (LDU,N)
  272. * If COMPQ = 'I', then:
  273. * On exit, if INFO = 0, U contains the left singular vectors
  274. * of the bidiagonal matrix.
  275. * For other values of COMPQ, U is not referenced.
  276. *
  277. * LDU (input) INTEGER
  278. * The leading dimension of the array U. LDU >= 1.
  279. * If singular vectors are desired, then LDU >= max( 1, N ).
  280. *
  281. * VT (output) DOUBLE PRECISION array, dimension (LDVT,N)
  282. * If COMPQ = 'I', then:
  283. * On exit, if INFO = 0, VT' contains the right singular
  284. * vectors of the bidiagonal matrix.
  285. * For other values of COMPQ, VT is not referenced.
  286. *
  287. * LDVT (input) INTEGER
  288. * The leading dimension of the array VT. LDVT >= 1.
  289. * If singular vectors are desired, then LDVT >= max( 1, N ).
  290. *
  291. * Q (output) DOUBLE PRECISION array, dimension (LDQ)
  292. * If COMPQ = 'P', then:
  293. * On exit, if INFO = 0, Q and IQ contain the left
  294. * and right singular vectors in a compact form,
  295. * requiring O(N log N) space instead of 2*N**2.
  296. * In particular, Q contains all the DOUBLE PRECISION data in
  297. * LDQ >= N*(11 + 2*SMLSIZ + 8*INT(LOG_2(N/(SMLSIZ+1))))
  298. * words of memory, where SMLSIZ is returned by ILAENV and
  299. * is equal to the maximum size of the subproblems at the
  300. * bottom of the computation tree (usually about 25).
  301. * For other values of COMPQ, Q is not referenced.
  302. *
  303. * IQ (output) INTEGER array, dimension (LDIQ)
  304. * If COMPQ = 'P', then:
  305. * On exit, if INFO = 0, Q and IQ contain the left
  306. * and right singular vectors in a compact form,
  307. * requiring O(N log N) space instead of 2*N**2.
  308. * In particular, IQ contains all INTEGER data in
  309. * LDIQ >= N*(3 + 3*INT(LOG_2(N/(SMLSIZ+1))))
  310. * words of memory, where SMLSIZ is returned by ILAENV and
  311. * is equal to the maximum size of the subproblems at the
  312. * bottom of the computation tree (usually about 25).
  313. * For other values of COMPQ, IQ is not referenced.
  314. *
  315. * WORK (workspace) DOUBLE PRECISION array, dimension (MAX(1,LWORK))
  316. * If COMPQ = 'N' then LWORK >= (4 * N).
  317. * If COMPQ = 'P' then LWORK >= (6 * N).
  318. * If COMPQ = 'I' then LWORK >= (3 * N**2 + 4 * N).
  319. *
  320. * IWORK (workspace) INTEGER array, dimension (8*N)
  321. *
  322. * C++ Return value: INFO (output) INTEGER
  323. * = 0: successful exit.
  324. * < 0: if INFO = -i, the i-th argument had an illegal value.
  325. * > 0: The algorithm failed to compute a singular value.
  326. * The update process of divide and conquer failed.
  327. *
  328. * Further Details
  329. * ===============
  330. *
  331. * Based on contributions by
  332. * Ming Gu and Huan Ren, Computer Science Division, University of
  333. * California at Berkeley, USA
  334. *
  335. * =====================================================================
  336. * Changed dimension statement in comment describing E from (N) to
  337. * (N-1). Sven, 17 Feb 05.
  338. * =====================================================================
  339. *
  340. * .. Parameters ..
  341. **/
  342. int C_DBDSDC(char uplo, char compq, int n, double* d, double* e, double* u, int ldu, double* vt, int ldvt, double* q, int* iq, double* work, int* iwork)
  343. {
  344. int info;
  345. ::F_DBDSDC(&uplo, &compq, &n, d, e, u, &ldu, vt, &ldvt, q, iq, work, iwork, &info);
  346. return info;
  347. }
  348. /**
  349. * Purpose
  350. * =======
  351. *
  352. * DBDSQR computes the singular values and, optionally, the right and/or
  353. * left singular vectors from the singular value decomposition (SVD) of
  354. * a real N-by-N (upper or lower) bidiagonal matrix B using the implicit
  355. * zero-shift QR algorithm. The SVD of B has the form
  356. *
  357. * B = Q * S * P**T
  358. *
  359. * where S is the diagonal matrix of singular values, Q is an orthogonal
  360. * matrix of left singular vectors, and P is an orthogonal matrix of
  361. * right singular vectors. If left singular vectors are requested, this
  362. * subroutine actually returns U*Q instead of Q, and, if right singular
  363. * vectors are requested, this subroutine returns P**T*VT instead of
  364. * P**T, for given real input matrices U and VT. When U and VT are the
  365. * orthogonal matrices that reduce a general matrix A to bidiagonal
  366. * form: A = U*B*VT, as computed by DGEBRD, then
  367. *
  368. * A = (U*Q) * S * (P**T*VT)
  369. *
  370. * is the SVD of A. Optionally, the subroutine may also compute Q**T*C
  371. * for a given real input matrix C.
  372. *
  373. * See "Computing Small Singular Values of Bidiagonal Matrices With
  374. * Guaranteed High Relative Accuracy," by J. Demmel and W. Kahan,
  375. * LAPACK Working Note #3 (or SIAM J. Sci. Statist. Comput. vol. 11,
  376. * no. 5, pp. 873-912, Sept 1990) and
  377. * "Accurate singular values and differential qd algorithms," by
  378. * B. Parlett and V. Fernando, Technical Report CPAM-554, Mathematics
  379. * Department, University of California at Berkeley, July 1992
  380. * for a detailed description of the algorithm.
  381. *
  382. * Arguments
  383. * =========
  384. *
  385. * UPLO (input) CHARACTER*1
  386. * = 'U': B is upper bidiagonal;
  387. * = 'L': B is lower bidiagonal.
  388. *
  389. * N (input) INTEGER
  390. * The order of the matrix B. N >= 0.
  391. *
  392. * NCVT (input) INTEGER
  393. * The number of columns of the matrix VT. NCVT >= 0.
  394. *
  395. * NRU (input) INTEGER
  396. * The number of rows of the matrix U. NRU >= 0.
  397. *
  398. * NCC (input) INTEGER
  399. * The number of columns of the matrix C. NCC >= 0.
  400. *
  401. * D (input/output) DOUBLE PRECISION array, dimension (N)
  402. * On entry, the n diagonal elements of the bidiagonal matrix B.
  403. * On exit, if INFO=0, the singular values of B in decreasing
  404. * order.
  405. *
  406. * E (input/output) DOUBLE PRECISION array, dimension (N-1)
  407. * On entry, the N-1 offdiagonal elements of the bidiagonal
  408. * matrix B.
  409. * On exit, if INFO = 0, E is destroyed; if INFO > 0, D and E
  410. * will contain the diagonal and superdiagonal elements of a
  411. * bidiagonal matrix orthogonally equivalent to the one given
  412. * as input.
  413. *
  414. * VT (input/output) DOUBLE PRECISION array, dimension (LDVT, NCVT)
  415. * On entry, an N-by-NCVT matrix VT.
  416. * On exit, VT is overwritten by P**T * VT.
  417. * Not referenced if NCVT = 0.
  418. *
  419. * LDVT (input) INTEGER
  420. * The leading dimension of the array VT.
  421. * LDVT >= max(1,N) if NCVT > 0; LDVT >= 1 if NCVT = 0.
  422. *
  423. * U (input/output) DOUBLE PRECISION array, dimension (LDU, N)
  424. * On entry, an NRU-by-N matrix U.
  425. * On exit, U is overwritten by U * Q.
  426. * Not referenced if NRU = 0.
  427. *
  428. * LDU (input) INTEGER
  429. * The leading dimension of the array U. LDU >= max(1,NRU).
  430. *
  431. * C (input/output) DOUBLE PRECISION array, dimension (LDC, NCC)
  432. * On entry, an N-by-NCC matrix C.
  433. * On exit, C is overwritten by Q**T * C.
  434. * Not referenced if NCC = 0.
  435. *
  436. * LDC (input) INTEGER
  437. * The leading dimension of the array C.
  438. * LDC >= max(1,N) if NCC > 0; LDC >=1 if NCC = 0.
  439. *
  440. * WORK (workspace) DOUBLE PRECISION array, dimension (4*N)
  441. *
  442. * C++ Return value: INFO (output) INTEGER
  443. * = 0: successful exit
  444. * < 0: If INFO = -i, the i-th argument had an illegal value
  445. * > 0:
  446. * if NCVT = NRU = NCC = 0,
  447. * = 1, a split was marked by a positive value in E
  448. * = 2, current block of Z not diagonalized after 30*N
  449. * iterations (in inner while loop)
  450. * = 3, termination criterion of outer while loop not met
  451. * (program created more than N unreduced blocks)
  452. * else NCVT = NRU = NCC = 0,
  453. * the algorithm did not converge; D and E contain the
  454. * elements of a bidiagonal matrix which is orthogonally
  455. * similar to the input matrix B; if INFO = i, i
  456. * elements of E have not converged to zero.
  457. *
  458. * Internal Parameters
  459. * ===================
  460. *
  461. * TOLMUL DOUBLE PRECISION, default = max(10,min(100,EPS**(-1/8)))
  462. * TOLMUL controls the convergence criterion of the QR loop.
  463. * If it is positive, TOLMUL*EPS is the desired relative
  464. * precision in the computed singular values.
  465. * If it is negative, abs(TOLMUL*EPS*sigma_max) is the
  466. * desired absolute accuracy in the computed singular
  467. * values (corresponds to relative accuracy
  468. * abs(TOLMUL*EPS) in the largest singular value.
  469. * abs(TOLMUL) should be between 1 and 1/EPS, and preferably
  470. * between 10 (for fast convergence) and .1/EPS
  471. * (for there to be some accuracy in the results).
  472. * Default is to lose at either one eighth or 2 of the
  473. * available decimal digits in each computed singular value
  474. * (whichever is smaller).
  475. *
  476. * MAXITR INTEGER, default = 6
  477. * MAXITR controls the maximum number of passes of the
  478. * algorithm through its inner loop. The algorithms stops
  479. * (and so fails to converge) if the number of passes
  480. * through the inner loop exceeds MAXITR*N**2.
  481. *
  482. * =====================================================================
  483. *
  484. * .. Parameters ..
  485. **/
  486. int C_DBDSQR(char uplo, int n, int ncvt, int nru, int ncc, double* d, double* e, double* vt, int ldvt, double* u, int ldu, double* c, int ldc, double* work)
  487. {
  488. int info;
  489. ::F_DBDSQR(&uplo, &n, &ncvt, &nru, &ncc, d, e, vt, &ldvt, u, &ldu, c, &ldc, work, &info);
  490. return info;
  491. }
  492. /**
  493. * Purpose
  494. * =======
  495. *
  496. * DDISNA computes the reciprocal condition numbers for the eigenvectors
  497. * of a real symmetric or complex Hermitian matrix or for the left or
  498. * right singular vectors of a general m-by-n matrix. The reciprocal
  499. * condition number is the 'gap' between the corresponding eigenvalue or
  500. * singular value and the nearest other one.
  501. *
  502. * The bound on the error, measured by angle in radians, in the I-th
  503. * computed vector is given by
  504. *
  505. * DLAMCH( 'E' ) * ( ANORM / SEP( I ) )
  506. *
  507. * where ANORM = 2-norm(A) = max( abs( D(j) ) ). SEP(I) is not allowed
  508. * to be smaller than DLAMCH( 'E' )*ANORM in order to limit the size of
  509. * the error bound.
  510. *
  511. * DDISNA may also be used to compute error bounds for eigenvectors of
  512. * the generalized symmetric definite eigenproblem.
  513. *
  514. * Arguments
  515. * =========
  516. *
  517. * JOB (input) CHARACTER*1
  518. * Specifies for which problem the reciprocal condition numbers
  519. * should be computed:
  520. * = 'E': the eigenvectors of a symmetric/Hermitian matrix;
  521. * = 'L': the left singular vectors of a general matrix;
  522. * = 'R': the right singular vectors of a general matrix.
  523. *
  524. * M (input) INTEGER
  525. * The number of rows of the matrix. M >= 0.
  526. *
  527. * N (input) INTEGER
  528. * If JOB = 'L' or 'R', the number of columns of the matrix,
  529. * in which case N >= 0. Ignored if JOB = 'E'.
  530. *
  531. * D (input) DOUBLE PRECISION array, dimension (M) if JOB = 'E'
  532. * dimension (min(M,N)) if JOB = 'L' or 'R'
  533. * The eigenvalues (if JOB = 'E') or singular values (if JOB =
  534. * 'L' or 'R') of the matrix, in either increasing or decreasing
  535. * order. If singular values, they must be non-negative.
  536. *
  537. * SEP (output) DOUBLE PRECISION array, dimension (M) if JOB = 'E'
  538. * dimension (min(M,N)) if JOB = 'L' or 'R'
  539. * The reciprocal condition numbers of the vectors.
  540. *
  541. * C++ Return value: INFO (output) INTEGER
  542. * = 0: successful exit.
  543. * < 0: if INFO = -i, the i-th argument had an illegal value.
  544. *
  545. * =====================================================================
  546. *
  547. * .. Parameters ..
  548. **/
  549. int C_DDISNA(char job, int m, int n, double* d, double* sep)
  550. {
  551. int info;
  552. ::F_DDISNA(&job, &m, &n, d, sep, &info);
  553. return info;
  554. }
  555. /**
  556. * Purpose
  557. * =======
  558. *
  559. * DGBBRD reduces a real general m-by-n band matrix A to upper
  560. * bidiagonal form B by an orthogonal transformation: Q' * A * P = B.
  561. *
  562. * The routine computes B, and optionally forms Q or P', or computes
  563. * Q'*C for a given matrix C.
  564. *
  565. * Arguments
  566. * =========
  567. *
  568. * VECT (input) CHARACTER*1
  569. * Specifies whether or not the matrices Q and P' are to be
  570. * formed.
  571. * = 'N': do not form Q or P';
  572. * = 'Q': form Q only;
  573. * = 'P': form P' only;
  574. * = 'B': form both.
  575. *
  576. * M (input) INTEGER
  577. * The number of rows of the matrix A. M >= 0.
  578. *
  579. * N (input) INTEGER
  580. * The number of columns of the matrix A. N >= 0.
  581. *
  582. * NCC (input) INTEGER
  583. * The number of columns of the matrix C. NCC >= 0.
  584. *
  585. * KL (input) INTEGER
  586. * The number of subdiagonals of the matrix A. KL >= 0.
  587. *
  588. * KU (input) INTEGER
  589. * The number of superdiagonals of the matrix A. KU >= 0.
  590. *
  591. * AB (input/output) DOUBLE PRECISION array, dimension (LDAB,N)
  592. * On entry, the m-by-n band matrix A, stored in rows 1 to
  593. * KL+KU+1. The j-th column of A is stored in the j-th column of
  594. * the array AB as follows:
  595. * AB(ku+1+i-j,j) = A(i,j) for max(1,j-ku)<=i<=min(m,j+kl).
  596. * On exit, A is overwritten by values generated during the
  597. * reduction.
  598. *
  599. * LDAB (input) INTEGER
  600. * The leading dimension of the array A. LDAB >= KL+KU+1.
  601. *
  602. * D (output) DOUBLE PRECISION array, dimension (min(M,N))
  603. * The diagonal elements of the bidiagonal matrix B.
  604. *
  605. * E (output) DOUBLE PRECISION array, dimension (min(M,N)-1)
  606. * The superdiagonal elements of the bidiagonal matrix B.
  607. *
  608. * Q (output) DOUBLE PRECISION array, dimension (LDQ,M)
  609. * If VECT = 'Q' or 'B', the m-by-m orthogonal matrix Q.
  610. * If VECT = 'N' or 'P', the array Q is not referenced.
  611. *
  612. * LDQ (input) INTEGER
  613. * The leading dimension of the array Q.
  614. * LDQ >= max(1,M) if VECT = 'Q' or 'B'; LDQ >= 1 otherwise.
  615. *
  616. * PT (output) DOUBLE PRECISION array, dimension (LDPT,N)
  617. * If VECT = 'P' or 'B', the n-by-n orthogonal matrix P'.
  618. * If VECT = 'N' or 'Q', the array PT is not referenced.
  619. *
  620. * LDPT (input) INTEGER
  621. * The leading dimension of the array PT.
  622. * LDPT >= max(1,N) if VECT = 'P' or 'B'; LDPT >= 1 otherwise.
  623. *
  624. * C (input/output) DOUBLE PRECISION array, dimension (LDC,NCC)
  625. * On entry, an m-by-ncc matrix C.
  626. * On exit, C is overwritten by Q'*C.
  627. * C is not referenced if NCC = 0.
  628. *
  629. * LDC (input) INTEGER
  630. * The leading dimension of the array C.
  631. * LDC >= max(1,M) if NCC > 0; LDC >= 1 if NCC = 0.
  632. *
  633. * WORK (workspace) DOUBLE PRECISION array, dimension (2*max(M,N))
  634. *
  635. * C++ Return value: INFO (output) INTEGER
  636. * = 0: successful exit.
  637. * < 0: if INFO = -i, the i-th argument had an illegal value.
  638. *
  639. * =====================================================================
  640. *
  641. * .. Parameters ..
  642. **/
  643. int C_DGBBRD(char vect, int m, int n, int ncc, int kl, int ku, double* ab, int ldab, double* d, double* e, double* q, int ldq, double* pt, int ldpt, double* c, int ldc, double* work)
  644. {
  645. int info;
  646. ::F_DGBBRD(&vect, &m, &n, &ncc, &kl, &ku, ab, &ldab, d, e, q, &ldq, pt, &ldpt, c, &ldc, work, &info);
  647. return info;
  648. }
  649. /**
  650. * Purpose
  651. * =======
  652. *
  653. * DGBCON estimates the reciprocal of the condition number of a real
  654. * general band matrix A, in either the 1-norm or the infinity-norm,
  655. * using the LU factorization computed by DGBTRF.
  656. *
  657. * An estimate is obtained for norm(inv(A)), and the reciprocal of the
  658. * condition number is computed as
  659. * RCOND = 1 / ( norm(A) * norm(inv(A)) ).
  660. *
  661. * Arguments
  662. * =========
  663. *
  664. * NORM (input) CHARACTER*1
  665. * Specifies whether the 1-norm condition number or the
  666. * infinity-norm condition number is required:
  667. * = '1' or 'O': 1-norm;
  668. * = 'I': Infinity-norm.
  669. *
  670. * N (input) INTEGER
  671. * The order of the matrix A. N >= 0.
  672. *
  673. * KL (input) INTEGER
  674. * The number of subdiagonals within the band of A. KL >= 0.
  675. *
  676. * KU (input) INTEGER
  677. * The number of superdiagonals within the band of A. KU >= 0.
  678. *
  679. * AB (input) DOUBLE PRECISION array, dimension (LDAB,N)
  680. * Details of the LU factorization of the band matrix A, as
  681. * computed by DGBTRF. U is stored as an upper triangular band
  682. * matrix with KL+KU superdiagonals in rows 1 to KL+KU+1, and
  683. * the multipliers used during the factorization are stored in
  684. * rows KL+KU+2 to 2*KL+KU+1.
  685. *
  686. * LDAB (input) INTEGER
  687. * The leading dimension of the array AB. LDAB >= 2*KL+KU+1.
  688. *
  689. * IPIV (input) INTEGER array, dimension (N)
  690. * The pivot indices; for 1 <= i <= N, row i of the matrix was
  691. * interchanged with row IPIV(i).
  692. *
  693. * ANORM (input) DOUBLE PRECISION
  694. * If NORM = '1' or 'O', the 1-norm of the original matrix A.
  695. * If NORM = 'I', the infinity-norm of the original matrix A.
  696. *
  697. * RCOND (output) DOUBLE PRECISION
  698. * The reciprocal of the condition number of the matrix A,
  699. * computed as RCOND = 1/(norm(A) * norm(inv(A))).
  700. *
  701. * WORK (workspace) DOUBLE PRECISION array, dimension (3*N)
  702. *
  703. * IWORK (workspace) INTEGER array, dimension (N)
  704. *
  705. * C++ Return value: INFO (output) INTEGER
  706. * = 0: successful exit
  707. * < 0: if INFO = -i, the i-th argument had an illegal value
  708. *
  709. * =====================================================================
  710. *
  711. * .. Parameters ..
  712. **/
  713. int C_DGBCON(char norm, int n, int kl, int ku, double* ab, int ldab, int* ipiv, double anorm, double* rcond, double* work, int* iwork)
  714. {
  715. int info;
  716. ::F_DGBCON(&norm, &n, &kl, &ku, ab, &ldab, ipiv, &anorm, rcond, work, iwork, &info);
  717. return info;
  718. }
  719. /**
  720. * Purpose
  721. * =======
  722. *
  723. * DGBEQU computes row and column scalings intended to equilibrate an
  724. * M-by-N band matrix A and reduce its condition number. R returns the
  725. * row scale factors and C the column scale factors, chosen to try to
  726. * make the largest element in each row and column of the matrix B with
  727. * elements B(i,j)=R(i)*A(i,j)*C(j) have absolute value 1.
  728. *
  729. * R(i) and C(j) are restricted to be between SMLNUM = smallest safe
  730. * number and BIGNUM = largest safe number. Use of these scaling
  731. * factors is not guaranteed to reduce the condition number of A but
  732. * works well in practice.
  733. *
  734. * Arguments
  735. * =========
  736. *
  737. * M (input) INTEGER
  738. * The number of rows of the matrix A. M >= 0.
  739. *
  740. * N (input) INTEGER
  741. * The number of columns of the matrix A. N >= 0.
  742. *
  743. * KL (input) INTEGER
  744. * The number of subdiagonals within the band of A. KL >= 0.
  745. *
  746. * KU (input) INTEGER
  747. * The number of superdiagonals within the band of A. KU >= 0.
  748. *
  749. * AB (input) DOUBLE PRECISION array, dimension (LDAB,N)
  750. * The band matrix A, stored in rows 1 to KL+KU+1. The j-th
  751. * column of A is stored in the j-th column of the array AB as
  752. * follows:
  753. * AB(ku+1+i-j,j) = A(i,j) for max(1,j-ku)<=i<=min(m,j+kl).
  754. *
  755. * LDAB (input) INTEGER
  756. * The leading dimension of the array AB. LDAB >= KL+KU+1.
  757. *
  758. * R (output) DOUBLE PRECISION array, dimension (M)
  759. * If INFO = 0, or INFO > M, R contains the row scale factors
  760. * for A.
  761. *
  762. * C (output) DOUBLE PRECISION array, dimension (N)
  763. * If INFO = 0, C contains the column scale factors for A.
  764. *
  765. * ROWCND (output) DOUBLE PRECISION
  766. * If INFO = 0 or INFO > M, ROWCND contains the ratio of the
  767. * smallest R(i) to the largest R(i). If ROWCND >= 0.1 and
  768. * AMAX is neither too large nor too small, it is not worth
  769. * scaling by R.
  770. *
  771. * COLCND (output) DOUBLE PRECISION
  772. * If INFO = 0, COLCND contains the ratio of the smallest
  773. * C(i) to the largest C(i). If COLCND >= 0.1, it is not
  774. * worth scaling by C.
  775. *
  776. * AMAX (output) DOUBLE PRECISION
  777. * Absolute value of largest matrix element. If AMAX is very
  778. * close to overflow or very close to underflow, the matrix
  779. * should be scaled.
  780. *
  781. * C++ Return value: INFO (output) INTEGER
  782. * = 0: successful exit
  783. * < 0: if INFO = -i, the i-th argument had an illegal value
  784. * > 0: if INFO = i, and i is
  785. * <= M: the i-th row of A is exactly zero
  786. * > M: the (i-M)-th column of A is exactly zero
  787. *
  788. * =====================================================================
  789. *
  790. * .. Parameters ..
  791. **/
  792. int C_DGBEQU(int m, int n, int kl, int ku, double* ab, int ldab, double* r, double* c, double* rowcnd, double* colcnd, double* amax)
  793. {
  794. int info;
  795. ::F_DGBEQU(&m, &n, &kl, &ku, ab, &ldab, r, c, rowcnd, colcnd, amax, &info);
  796. return info;
  797. }
  798. /**
  799. * Purpose
  800. * =======
  801. *
  802. * DGBRFS improves the computed solution to a system of linear
  803. * equations when the coefficient matrix is banded, and provides
  804. * error bounds and backward error estimates for the solution.
  805. *
  806. * Arguments
  807. * =========
  808. *
  809. * TRANS (input) CHARACTER*1
  810. * Specifies the form of the system of equations:
  811. * = 'N': A * X = B (No transpose)
  812. * = 'T': A**T * X = B (Transpose)
  813. * = 'C': A**H * X = B (Conjugate transpose = Transpose)
  814. *
  815. * N (input) INTEGER
  816. * The order of the matrix A. N >= 0.
  817. *
  818. * KL (input) INTEGER
  819. * The number of subdiagonals within the band of A. KL >= 0.
  820. *
  821. * KU (input) INTEGER
  822. * The number of superdiagonals within the band of A. KU >= 0.
  823. *
  824. * NRHS (input) INTEGER
  825. * The number of right hand sides, i.e., the number of columns
  826. * of the matrices B and X. NRHS >= 0.
  827. *
  828. * AB (input) DOUBLE PRECISION array, dimension (LDAB,N)
  829. * The original band matrix A, stored in rows 1 to KL+KU+1.
  830. * The j-th column of A is stored in the j-th column of the
  831. * array AB as follows:
  832. * AB(ku+1+i-j,j) = A(i,j) for max(1,j-ku)<=i<=min(n,j+kl).
  833. *
  834. * LDAB (input) INTEGER
  835. * The leading dimension of the array AB. LDAB >= KL+KU+1.
  836. *
  837. * AFB (input) DOUBLE PRECISION array, dimension (LDAFB,N)
  838. * Details of the LU factorization of the band matrix A, as
  839. * computed by DGBTRF. U is stored as an upper triangular band
  840. * matrix with KL+KU superdiagonals in rows 1 to KL+KU+1, and
  841. * the multipliers used during the factorization are stored in
  842. * rows KL+KU+2 to 2*KL+KU+1.
  843. *
  844. * LDAFB (input) INTEGER
  845. * The leading dimension of the array AFB. LDAFB >= 2*KL*KU+1.
  846. *
  847. * IPIV (input) INTEGER array, dimension (N)
  848. * The pivot indices from DGBTRF; for 1<=i<=N, row i of the
  849. * matrix was interchanged with row IPIV(i).
  850. *
  851. * B (input) DOUBLE PRECISION array, dimension (LDB,NRHS)
  852. * The right hand side matrix B.
  853. *
  854. * LDB (input) INTEGER
  855. * The leading dimension of the array B. LDB >= max(1,N).
  856. *
  857. * X (input/output) DOUBLE PRECISION array, dimension (LDX,NRHS)
  858. * On entry, the solution matrix X, as computed by DGBTRS.
  859. * On exit, the improved solution matrix X.
  860. *
  861. * LDX (input) INTEGER
  862. * The leading dimension of the array X. LDX >= max(1,N).
  863. *
  864. * FERR (output) DOUBLE PRECISION array, dimension (NRHS)
  865. * The estimated forward error bound for each solution vector
  866. * X(j) (the j-th column of the solution matrix X).
  867. * If XTRUE is the true solution corresponding to X(j), FERR(j)
  868. * is an estimated upper bound for the magnitude of the largest
  869. * element in (X(j) - XTRUE) divided by the magnitude of the
  870. * largest element in X(j). The estimate is as reliable as
  871. * the estimate for RCOND, and is almost always a slight
  872. * overestimate of the true error.
  873. *
  874. * BERR (output) DOUBLE PRECISION array, dimension (NRHS)
  875. * The componentwise relative backward error of each solution
  876. * vector X(j) (i.e., the smallest relative change in
  877. * any element of A or B that makes X(j) an exact solution).
  878. *
  879. * WORK (workspace) DOUBLE PRECISION array, dimension (3*N)
  880. *
  881. * IWORK (workspace) INTEGER array, dimension (N)
  882. *
  883. * C++ Return value: INFO (output) INTEGER
  884. * = 0: successful exit
  885. * < 0: if INFO = -i, the i-th argument had an illegal value
  886. *
  887. * Internal Parameters
  888. * ===================
  889. *
  890. * ITMAX is the maximum number of steps of iterative refinement.
  891. *
  892. * =====================================================================
  893. *
  894. * .. Parameters ..
  895. **/
  896. int C_DGBRFS(char trans, int n, int kl, int ku, int nrhs, double* ab, int ldab, double* afb, int ldafb, int* ipiv, double* b, int ldb, double* x, int ldx, double* ferr, double* berr, double* work, int* iwork)
  897. {
  898. int info;
  899. ::F_DGBRFS(&trans, &n, &kl, &ku, &nrhs, ab, &ldab, afb, &ldafb, ipiv, b, &ldb, x, &ldx, ferr, berr, work, iwork, &info);
  900. return info;
  901. }
  902. /**
  903. * Purpose
  904. * =======
  905. *
  906. * DGBSV computes the solution to a real system of linear equations
  907. * A * X = B, where A is a band matrix of order N with KL subdiagonals
  908. * and KU superdiagonals, and X and B are N-by-NRHS matrices.
  909. *
  910. * The LU decomposition with partial pivoting and row interchanges is
  911. * used to factor A as A = L * U, where L is a product of permutation
  912. * and unit lower triangular matrices with KL subdiagonals, and U is
  913. * upper triangular with KL+KU superdiagonals. The factored form of A
  914. * is then used to solve the system of equations A * X = B.
  915. *
  916. * Arguments
  917. * =========
  918. *
  919. * N (input) INTEGER
  920. * The number of linear equations, i.e., the order of the
  921. * matrix A. N >= 0.
  922. *
  923. * KL (input) INTEGER
  924. * The number of subdiagonals within the band of A. KL >= 0.
  925. *
  926. * KU (input) INTEGER
  927. * The number of superdiagonals within the band of A. KU >= 0.
  928. *
  929. * NRHS (input) INTEGER
  930. * Theā€¦

Large files files are truncated, but you can click here to view the full file