PageRenderTime 44ms CodeModel.GetById 17ms RepoModel.GetById 0ms app.codeStats 0ms

/libs/UMFPACK/Include/umfpack_get_symbolic.h

http://gkw.googlecode.com/
C Header | 339 lines | 76 code | 6 blank | 257 comment | 0 complexity | 6d9924b283f256850c2584a01e0fdc31 MD5 | raw file
Possible License(s): GPL-3.0, GPL-2.0
  1. /* ========================================================================== */
  2. /* === umfpack_get_symbolic ================================================= */
  3. /* ========================================================================== */
  4. /* -------------------------------------------------------------------------- */
  5. /* UMFPACK Copyright (c) Timothy A. Davis, CISE, */
  6. /* Univ. of Florida. All Rights Reserved. See ../Doc/License for License. */
  7. /* web: http://www.cise.ufl.edu/research/sparse/umfpack */
  8. /* -------------------------------------------------------------------------- */
  9. int umfpack_di_get_symbolic
  10. (
  11. int *n_row,
  12. int *n_col,
  13. int *n1,
  14. int *nz,
  15. int *nfr,
  16. int *nchains,
  17. int P [ ],
  18. int Q [ ],
  19. int Front_npivcol [ ],
  20. int Front_parent [ ],
  21. int Front_1strow [ ],
  22. int Front_leftmostdesc [ ],
  23. int Chain_start [ ],
  24. int Chain_maxrows [ ],
  25. int Chain_maxcols [ ],
  26. void *Symbolic
  27. ) ;
  28. UF_long umfpack_dl_get_symbolic
  29. (
  30. UF_long *n_row,
  31. UF_long *n_col,
  32. UF_long *n1,
  33. UF_long *nz,
  34. UF_long *nfr,
  35. UF_long *nchains,
  36. UF_long P [ ],
  37. UF_long Q [ ],
  38. UF_long Front_npivcol [ ],
  39. UF_long Front_parent [ ],
  40. UF_long Front_1strow [ ],
  41. UF_long Front_leftmostdesc [ ],
  42. UF_long Chain_start [ ],
  43. UF_long Chain_maxrows [ ],
  44. UF_long Chain_maxcols [ ],
  45. void *Symbolic
  46. ) ;
  47. int umfpack_zi_get_symbolic
  48. (
  49. int *n_row,
  50. int *n_col,
  51. int *n1,
  52. int *nz,
  53. int *nfr,
  54. int *nchains,
  55. int P [ ],
  56. int Q [ ],
  57. int Front_npivcol [ ],
  58. int Front_parent [ ],
  59. int Front_1strow [ ],
  60. int Front_leftmostdesc [ ],
  61. int Chain_start [ ],
  62. int Chain_maxrows [ ],
  63. int Chain_maxcols [ ],
  64. void *Symbolic
  65. ) ;
  66. UF_long umfpack_zl_get_symbolic
  67. (
  68. UF_long *n_row,
  69. UF_long *n_col,
  70. UF_long *n1,
  71. UF_long *nz,
  72. UF_long *nfr,
  73. UF_long *nchains,
  74. UF_long P [ ],
  75. UF_long Q [ ],
  76. UF_long Front_npivcol [ ],
  77. UF_long Front_parent [ ],
  78. UF_long Front_1strow [ ],
  79. UF_long Front_leftmostdesc [ ],
  80. UF_long Chain_start [ ],
  81. UF_long Chain_maxrows [ ],
  82. UF_long Chain_maxcols [ ],
  83. void *Symbolic
  84. ) ;
  85. /*
  86. double int Syntax:
  87. #include "umfpack.h"
  88. int status, n_row, n_col, nz, nfr, nchains, *P, *Q,
  89. *Front_npivcol, *Front_parent, *Front_1strow, *Front_leftmostdesc,
  90. *Chain_start, *Chain_maxrows, *Chain_maxcols ;
  91. void *Symbolic ;
  92. status = umfpack_di_get_symbolic (&n_row, &n_col, &nz, &nfr, &nchains,
  93. P, Q, Front_npivcol, Front_parent, Front_1strow,
  94. Front_leftmostdesc, Chain_start, Chain_maxrows, Chain_maxcols,
  95. Symbolic) ;
  96. double UF_long Syntax:
  97. #include "umfpack.h"
  98. UF_long status, n_row, n_col, nz, nfr, nchains, *P, *Q,
  99. *Front_npivcol, *Front_parent, *Front_1strow, *Front_leftmostdesc,
  100. *Chain_start, *Chain_maxrows, *Chain_maxcols ;
  101. void *Symbolic ;
  102. status = umfpack_dl_get_symbolic (&n_row, &n_col, &nz, &nfr, &nchains,
  103. P, Q, Front_npivcol, Front_parent, Front_1strow,
  104. Front_leftmostdesc, Chain_start, Chain_maxrows, Chain_maxcols,
  105. Symbolic) ;
  106. complex int Syntax:
  107. #include "umfpack.h"
  108. int status, n_row, n_col, nz, nfr, nchains, *P, *Q,
  109. *Front_npivcol, *Front_parent, *Front_1strow, *Front_leftmostdesc,
  110. *Chain_start, *Chain_maxrows, *Chain_maxcols ;
  111. void *Symbolic ;
  112. status = umfpack_zi_get_symbolic (&n_row, &n_col, &nz, &nfr, &nchains,
  113. P, Q, Front_npivcol, Front_parent, Front_1strow,
  114. Front_leftmostdesc, Chain_start, Chain_maxrows, Chain_maxcols,
  115. Symbolic) ;
  116. complex UF_long Syntax:
  117. #include "umfpack.h"
  118. UF_long status, n_row, n_col, nz, nfr, nchains, *P, *Q,
  119. *Front_npivcol, *Front_parent, *Front_1strow, *Front_leftmostdesc,
  120. *Chain_start, *Chain_maxrows, *Chain_maxcols ;
  121. void *Symbolic ;
  122. status = umfpack_zl_get_symbolic (&n_row, &n_col, &nz, &nfr, &nchains,
  123. P, Q, Front_npivcol, Front_parent, Front_1strow,
  124. Front_leftmostdesc, Chain_start, Chain_maxrows, Chain_maxcols,
  125. Symbolic) ;
  126. Purpose:
  127. Copies the contents of the Symbolic object into simple integer arrays
  128. accessible to the user. This routine is not needed to factorize and/or
  129. solve a sparse linear system using UMFPACK. Note that the output arrays
  130. P, Q, Front_npivcol, Front_parent, Front_1strow, Front_leftmostdesc,
  131. Chain_start, Chain_maxrows, and Chain_maxcols are not allocated by
  132. umfpack_*_get_symbolic; they must exist on input.
  133. All output arguments are optional. If any of them are NULL
  134. on input, then that part of the symbolic analysis is not copied. You can
  135. use this routine to extract just the parts of the symbolic analysis that
  136. you want. For example, to retrieve just the column permutation Q, use:
  137. #define noI (int *) NULL
  138. status = umfpack_di_get_symbolic (noI, noI, noI, noI, noI, noI, noI,
  139. Q, noI, noI, noI, noI, noI, noI, noI, Symbolic) ;
  140. The only required argument the last one, the pointer to the Symbolic object.
  141. The Symbolic object is small. Its size for an n-by-n square matrix varies
  142. from 4*n to 13*n, depending on the matrix. The object holds the initial
  143. column permutation, the supernodal column elimination tree, and information
  144. about each frontal matrix. You can print it with umfpack_*_report_symbolic.
  145. Returns:
  146. Returns UMFPACK_OK if successful, UMFPACK_ERROR_invalid_Symbolic_object
  147. if Symbolic is an invalid object.
  148. Arguments:
  149. Int *n_row ; Output argument.
  150. Int *n_col ; Output argument.
  151. The dimensions of the matrix A analyzed by the call to
  152. umfpack_*_symbolic that generated the Symbolic object.
  153. Int *n1 ; Output argument.
  154. The number of pivots with zero Markowitz cost (they have just one entry
  155. in the pivot row, or the pivot column, or both). These appear first in
  156. the output permutations P and Q.
  157. Int *nz ; Output argument.
  158. The number of nonzeros in A.
  159. Int *nfr ; Output argument.
  160. The number of frontal matrices that will be used by umfpack_*_numeric
  161. to factorize the matrix A. It is in the range 0 to n_col.
  162. Int *nchains ; Output argument.
  163. The frontal matrices are related to one another by the supernodal
  164. column elimination tree. Each node in this tree is one frontal matrix.
  165. The tree is partitioned into a set of disjoint paths, and a frontal
  166. matrix chain is one path in this tree. Each chain is factorized using
  167. a unifrontal technique, with a single working array that holds each
  168. frontal matrix in the chain, one at a time. nchains is in the range
  169. 0 to nfr.
  170. Int P [n_row] ; Output argument.
  171. The initial row permutation. If P [k] = i, then this means that
  172. row i is the kth row in the pre-ordered matrix. In general, this P is
  173. not the same as the final row permutation computed by umfpack_*_numeric.
  174. For the unsymmetric strategy, P defines the row-merge order. Let j be
  175. the column index of the leftmost nonzero entry in row i of A*Q. Then
  176. P defines a sort of the rows according to this value. A row can appear
  177. earlier in this ordering if it is aggressively absorbed before it can
  178. become a pivot row. If P [k] = i, row i typically will not be the kth
  179. pivot row.
  180. For the symmetric strategy, P = Q. For the 2-by-2 strategy, P is the
  181. row permutation that places large entries on the diagonal of P*A*Q.
  182. If no pivoting occurs during numerical factorization, P [k] = i also
  183. defines the final permutation of umfpack_*_numeric, for either the
  184. symmetric or 2-by-2 strategies.
  185. Int Q [n_col] ; Output argument.
  186. The initial column permutation. If Q [k] = j, then this means that
  187. column j is the kth pivot column in the pre-ordered matrix. Q is
  188. not necessarily the same as the final column permutation Q, computed by
  189. umfpack_*_numeric. The numeric factorization may reorder the pivot
  190. columns within each frontal matrix to reduce fill-in. If the matrix is
  191. structurally singular, and if the symmetric or 2-by-2 strategies or
  192. used (or if Control [UMFPACK_FIXQ] > 0), then this Q will be the same
  193. as the final column permutation computed in umfpack_*_numeric.
  194. Int Front_npivcol [n_col+1] ; Output argument.
  195. This array should be of size at least n_col+1, in order to guarantee
  196. that it will be large enough to hold the output. Only the first nfr+1
  197. entries are used, however.
  198. The kth frontal matrix holds Front_npivcol [k] pivot columns. Thus, the
  199. first frontal matrix, front 0, is used to factorize the first
  200. Front_npivcol [0] columns; these correspond to the original columns
  201. Q [0] through Q [Front_npivcol [0]-1]. The next frontal matrix
  202. is used to factorize the next Front_npivcol [1] columns, which are thus
  203. the original columns Q [Front_npivcol [0]] through
  204. Q [Front_npivcol [0] + Front_npivcol [1] - 1], and so on. Columns
  205. with no entries at all are put in a placeholder "front",
  206. Front_npivcol [nfr]. The sum of Front_npivcol [0..nfr] is equal to
  207. n_col.
  208. Any modifications that umfpack_*_numeric makes to the initial column
  209. permutation are constrained to within each frontal matrix. Thus, for
  210. the first frontal matrix, Q [0] through Q [Front_npivcol [0]-1] is some
  211. permutation of the columns Q [0] through
  212. Q [Front_npivcol [0]-1]. For second frontal matrix,
  213. Q [Front_npivcol [0]] through Q [Front_npivcol [0] + Front_npivcol[1]-1]
  214. is some permutation of the same portion of Q, and so on. All pivot
  215. columns are numerically factorized within the frontal matrix originally
  216. determined by the symbolic factorization; there is no delayed pivoting
  217. across frontal matrices.
  218. Int Front_parent [n_col+1] ; Output argument.
  219. This array should be of size at least n_col+1, in order to guarantee
  220. that it will be large enough to hold the output. Only the first nfr+1
  221. entries are used, however.
  222. Front_parent [0..nfr] holds the supernodal column elimination tree
  223. (including the placeholder front nfr, which may be empty). Each node in
  224. the tree corresponds to a single frontal matrix. The parent of node f
  225. is Front_parent [f].
  226. Int Front_1strow [n_col+1] ; Output argument.
  227. This array should be of size at least n_col+1, in order to guarantee
  228. that it will be large enough to hold the output. Only the first nfr+1
  229. entries are used, however.
  230. Front_1strow [k] is the row index of the first row in A (P,Q)
  231. whose leftmost entry is in a pivot column for the kth front. This is
  232. necessary only to properly factorize singular matrices. Rows in the
  233. range Front_1strow [k] to Front_1strow [k+1]-1 first become pivot row
  234. candidates at the kth front. Any rows not eliminated in the kth front
  235. may be selected as pivot rows in the parent of k (Front_parent [k])
  236. and so on up the tree.
  237. Int Front_leftmostdesc [n_col+1] ; Output argument.
  238. This array should be of size at least n_col+1, in order to guarantee
  239. that it will be large enough to hold the output. Only the first nfr+1
  240. entries are used, however.
  241. Front_leftmostdesc [k] is the leftmost descendant of front k, or k
  242. if the front has no children in the tree. Since the rows and columns
  243. (P and Q) have been post-ordered via a depth-first-search of
  244. the tree, rows in the range Front_1strow [Front_leftmostdesc [k]] to
  245. Front_1strow [k+1]-1 form the entire set of candidate pivot rows for
  246. the kth front (some of these will typically have already been selected
  247. by fronts in the range Front_leftmostdesc [k] to front k-1, before
  248. the factorization reaches front k).
  249. Chain_start [n_col+1] ; Output argument.
  250. This array should be of size at least n_col+1, in order to guarantee
  251. that it will be large enough to hold the output. Only the first
  252. nchains+1 entries are used, however.
  253. The kth frontal matrix chain consists of frontal matrices Chain_start[k]
  254. through Chain_start [k+1]-1. Thus, Chain_start [0] is always 0, and
  255. Chain_start [nchains] is the total number of frontal matrices, nfr. For
  256. two adjacent fronts f and f+1 within a single chain, f+1 is always the
  257. parent of f (that is, Front_parent [f] = f+1).
  258. Int Chain_maxrows [n_col+1] ; Output argument.
  259. Int Chain_maxcols [n_col+1] ; Output argument.
  260. These arrays should be of size at least n_col+1, in order to guarantee
  261. that they will be large enough to hold the output. Only the first
  262. nchains entries are used, however.
  263. The kth frontal matrix chain requires a single working array of
  264. dimension Chain_maxrows [k] by Chain_maxcols [k], for the unifrontal
  265. technique that factorizes the frontal matrix chain. Since the symbolic
  266. factorization only provides an upper bound on the size of each frontal
  267. matrix, not all of the working array is necessarily used during the
  268. numerical factorization.
  269. Note that the upper bound on the number of rows and columns of each
  270. frontal matrix is computed by umfpack_*_symbolic, but all that is
  271. required by umfpack_*_numeric is the maximum of these two sets of
  272. values for each frontal matrix chain. Thus, the size of each
  273. individual frontal matrix is not preserved in the Symbolic object.
  274. void *Symbolic ; Input argument, not modified.
  275. The Symbolic object, which holds the symbolic factorization computed by
  276. umfpack_*_symbolic. The Symbolic object is not modified by
  277. umfpack_*_get_symbolic.
  278. */