Amesos Package Browser (Single Doxygen Collection)  Development
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
amesos_cholmod_rowfac.c
Go to the documentation of this file.
1 /* ========================================================================== */
2 /* === Cholesky/cholmod_rowfac ============================================== */
3 /* ========================================================================== */
4 
5 /* -----------------------------------------------------------------------------
6  * CHOLMOD/Cholesky Module. Copyright (C) 2005-2006, Timothy A. Davis
7  * The CHOLMOD/Cholesky Module is licensed under Version 2.1 of the GNU
8  * Lesser General Public License. See lesser.txt for a text of the license.
9  * CHOLMOD is also available under other licenses; contact authors for details.
10  * http://www.cise.ufl.edu/research/sparse
11  * -------------------------------------------------------------------------- */
12 
13 /* Full or incremental numerical LDL' or LL' factorization (simplicial, not
14  * supernodal) cholmod_factorize is the "easy" wrapper for this code, but it
15  * does not provide access to incremental factorization.
16  *
17  * cholmod_rowfac computes the full or incremental LDL' or LL' factorization of
18  * A+beta*I (where A is symmetric) or A*F+beta*I (where A and F are unsymmetric
19  * and only the upper triangular part of A*F+beta*I is used). It computes
20  * L (and D, for LDL') one row at a time. beta is real.
21  *
22  * A is nrow-by-ncol or nrow-by-nrow. In "packed" form it is a conventional
23  * column-oriented sparse matrix. Row indices of column j are in
24  * Ai [Ap [j] ... Ap [j+1]-1] and values in the same locations of Ax.
25  * will be faster if A has sorted columns. In "unpacked" form the column
26  * of A ends at Ap [j] + Anz [j] - 1 instead of Ap [j+1] - 1.
27  *
28  * Row indices in each column of A can be sorted or unsorted, but the routine
29  * routine works fastest if A is sorted, or if only triu(A) is provided
30  * for the symmetric case.
31  *
32  * The unit-diagonal nrow-by-nrow output matrix L is returned in "unpacked"
33  * column form, with row indices of column j in Li [Lp [j] ...
34  * Lp [j] + Lnz [j] - 1] and values in the same location in Lx. The row
35  * indices in each column of L are in sorted order. The unit diagonal of L
36  * is not stored.
37  *
38  * L can be a simplicial symbolic or numeric (L->is_super must be FALSE).
39  * A symbolic factor is converted immediately into a numeric factor containing
40  * the identity matrix.
41  *
42  * For a full factorization, kstart = 0 and kend = nrow. The existing nonzero
43  * entries (numerical values in L->x and L->z for the zomplex case, and indices
44  * in L->i), if any, are overwritten.
45  *
46  * To compute an incremental factorization, select kstart and kend as the range
47  * of rows of L you wish to compute. A correct factorization will be computed
48  * only if all descendants of all nodes k = kstart to kend-1 in the etree have
49  * been factorized by a prior call to this routine, and if rows kstart to kend-1
50  * have not been factorized. This condition is NOT checked on input.
51  *
52  * ---------------
53  * Symmetric case:
54  * ---------------
55  *
56  * The factorization (in MATLAB notation) is:
57  *
58  * S = beta*I + A
59  * S = triu (S) + triu (S,1)'
60  * L*D*L' = S, or L*L' = S
61  *
62  * A is a conventional sparse matrix in compressed column form. Only the
63  * diagonal and upper triangular part of A is accessed; the lower
64  * triangular part is ignored and assumed to be equal to the upper
65  * triangular part. For an incremental factorization, only columns kstart
66  * to kend-1 of A are accessed. F is not used.
67  *
68  * ---------------
69  * Unsymmetric case:
70  * ---------------
71  *
72  * The factorization (in MATLAB notation) is:
73  *
74  * S = beta*I + A*F
75  * S = triu (S) + triu (S,1)'
76  * L*D*L' = S, or L*L' = S
77  *
78  * The typical case is F=A'. Alternatively, if F=A(:,f)', then this
79  * routine factorizes S = beta*I + A(:,f)*A(:,f)'.
80  *
81  * All of A and F are accessed, but only the upper triangular part of A*F
82  * is used. F must be of size A->ncol by A->nrow. F is used for the
83  * unsymmetric case only. F can be packed or unpacked and it need not be
84  * sorted.
85  *
86  * For a complete factorization of beta*I + A*A',
87  * this routine performs a number of flops exactly equal to:
88  *
89  * sum (for each column j of A) of (Anz (j)^2 + Anz (j)), to form S
90  * +
91  * sum (for each column j of L) of (Lnz (j)^2 + 3*Lnz (j)), to factorize S
92  *
93  * where Anz (j) is the number of nonzeros in column j of A, and Lnz (j)
94  * is the number of nonzero in column j of L below the diagonal.
95  *
96  *
97  * workspace: Flag (nrow), W (nrow if real, 2*nrow if complex/zomplex),
98  * Iwork (nrow)
99  *
100  * Supports any xtype, except a pattern-only input matrix A cannot be
101  * factorized.
102  */
103 
104 #ifndef NCHOLESKY
105 
106 #include "amesos_cholmod_internal.h"
107 #include "amesos_cholmod_cholesky.h"
108 
109 /* ========================================================================== */
110 /* === subtree ============================================================== */
111 /* ========================================================================== */
112 
113 /* Compute the nonzero pattern of the sparse triangular solve Lx=b, where L in
114  * this case is L(0:k-1,0:k-1), and b is a column of A. This is done by
115  * traversing the kth row-subtree of the elimination tree of L, starting from
116  * each nonzero entry in b. The pattern is returned postordered, and is valid
117  * for a subsequent numerical triangular solve of Lx=b. The elimination tree
118  * can be provided in a Parent array, or extracted from the pattern of L itself.
119  *
120  * The pattern of x = inv(L)*b is returned in Stack [top...].
121  * Also scatters b, or a multiple of b, into the work vector W.
122  *
123  * The SCATTER macro is defines how the numerical values of A or A*A' are to be
124  * scattered.
125  *
126  * PARENT(i) is a macro the defines how the etree is accessed. It is either:
127  * #define PARENT(i) Parent [i]
128  * #define PARENT(i) (Lnz [i] > 1) ? (Li [Lp [i] + 1]) : EMPTY
129  */
130 
131 #define SUBTREE \
132  for ( ; p < pend ; p++) \
133  { \
134  i = Ai [p] ; \
135  if (i <= k) \
136  { \
137  /* scatter the column of A, or A*A' into Wx and Wz */ \
138  SCATTER ; \
139  /* start at node i and traverse up the subtree, stop at node k */ \
140  for (len = 0 ; i < k && i != EMPTY && Flag [i] < mark ; i = parent) \
141  { \
142  /* L(k,i) is nonzero, and seen for the first time */ \
143  Stack [len++] = i ; /* place i on the stack */ \
144  Flag [i] = mark ; /* mark i as visited */ \
145  parent = PARENT (i) ; /* traverse up the etree to the parent */ \
146  } \
147  /* move the path down to the bottom of the stack */ \
148  while (len > 0) \
149  { \
150  Stack [--top] = Stack [--len] ; \
151  } \
152  } \
153  else if (sorted) \
154  { \
155  break ; \
156  } \
157  }
158 
159 
160 /* ========================================================================== */
161 /* === TEMPLATE ============================================================= */
162 /* ========================================================================== */
163 
164 #define REAL
165 #include "amesos_t_cholmod_rowfac.c"
166 #define COMPLEX
167 #include "amesos_t_cholmod_rowfac.c"
168 #define ZOMPLEX
169 #include "amesos_t_cholmod_rowfac.c"
170 
171 #define MASK
172 #define REAL
173 #include "amesos_t_cholmod_rowfac.c"
174 #define COMPLEX
175 #include "amesos_t_cholmod_rowfac.c"
176 #define ZOMPLEX
177 #include "amesos_t_cholmod_rowfac.c"
178 #undef MASK
179 
180 
181 /* ========================================================================== */
182 /* === cholmod_row_subtree ================================================== */
183 /* ========================================================================== */
184 
185 /* Compute the nonzero pattern of the solution to the lower triangular system
186  * L(0:k-1,0:k-1) * x = A (0:k-1,k) if A is symmetric, or
187  * L(0:k-1,0:k-1) * x = A (0:k-1,:) * A (:,k)' if A is unsymmetric.
188  * This gives the nonzero pattern of row k of L (excluding the diagonal).
189  * The pattern is returned postordered.
190  *
191  * The symmetric case requires A to be in symmetric-upper form.
192  *
193  * The result is returned in R, a pre-allocated sparse matrix of size nrow-by-1,
194  * with R->nzmax >= nrow. R is assumed to be packed (Rnz [0] is not updated);
195  * the number of entries in R is given by Rp [0].
196  *
197  * FUTURE WORK: a very minor change to this routine could allow it to compute
198  * the nonzero pattern of x for any system Lx=b. The SUBTREE macro would need
199  * to change, to eliminate its dependence on k.
200  *
201  * workspace: Flag (nrow)
202  */
203 
204 int CHOLMOD(row_subtree)
205 (
206  /* ---- input ---- */
207  cholmod_sparse *A, /* matrix to analyze */
208  cholmod_sparse *F, /* used for A*A' case only. F=A' or A(:,f)' */
209  size_t krow, /* row k of L */
210  Int *Parent, /* elimination tree */
211  /* ---- output --- */
212  cholmod_sparse *R, /* pattern of L(k,:), 1-by-n with R->nzmax >= n */
213  /* --------------- */
214  cholmod_common *Common
215 )
216 {
217  Int *Rp, *Stack, *Flag, *Ap, *Ai, *Anz, *Fp, *Fi, *Fnz ;
218  Int p, pend, parent, t, stype, nrow, k, pf, pfend, Fpacked, packed,
219  sorted, top, len, i, mark ;
220 
221  /* ---------------------------------------------------------------------- */
222  /* check inputs */
223  /* ---------------------------------------------------------------------- */
224 
226  RETURN_IF_NULL (A, FALSE) ;
227  RETURN_IF_NULL (R, FALSE) ;
228  RETURN_IF_NULL (Parent, FALSE) ;
231  stype = A->stype ;
232  if (stype == 0)
233  {
234  RETURN_IF_NULL (F, FALSE) ;
236  }
237  if (krow >= A->nrow)
238  {
239  ERROR (CHOLMOD_INVALID, "subtree: k invalid") ;
240  return (FALSE) ;
241  }
242  if (R->ncol != 1 || A->nrow != R->nrow || A->nrow > R->nzmax)
243  {
244  ERROR (CHOLMOD_INVALID, "subtree: R invalid") ;
245  return (FALSE) ;
246  }
247  Common->status = CHOLMOD_OK ;
248 
249  /* ---------------------------------------------------------------------- */
250  /* allocate workspace */
251  /* ---------------------------------------------------------------------- */
252 
253  nrow = A->nrow ;
254  CHOLMOD(allocate_work) (nrow, 0, 0, Common) ;
255  if (Common->status < CHOLMOD_OK)
256  {
257  return (FALSE) ;
258  }
259  ASSERT (CHOLMOD(dump_work) (TRUE, TRUE, 0, Common)) ;
260 
261  /* ---------------------------------------------------------------------- */
262  /* get inputs */
263  /* ---------------------------------------------------------------------- */
264 
265  if (stype > 0)
266  {
267  /* symmetric upper case: F is not needed. It may be NULL */
268  Fp = NULL ;
269  Fi = NULL ;
270  Fnz = NULL ;
271  Fpacked = TRUE ;
272  }
273  else if (stype == 0)
274  {
275  /* unsymmetric case: F is required. */
276  Fp = F->p ;
277  Fi = F->i ;
278  Fnz = F->nz ;
279  Fpacked = F->packed ;
280  }
281  else
282  {
283  /* symmetric lower triangular form not supported */
284  ERROR (CHOLMOD_INVALID, "symmetric lower not supported") ;
285  return (FALSE) ;
286  }
287 
288  Ap = A->p ;
289  Ai = A->i ;
290  Anz = A->nz ;
291  packed = A->packed ;
292  sorted = A->sorted ;
293 
294  k = krow ;
295  Stack = R->i ;
296 
297  /* ---------------------------------------------------------------------- */
298  /* get workspace */
299  /* ---------------------------------------------------------------------- */
300 
301  Flag = Common->Flag ; /* size nrow, Flag [i] < mark must hold */
302  mark = CHOLMOD(clear_flag) (Common) ;
303 
304  /* ---------------------------------------------------------------------- */
305  /* compute the pattern of L(k,:) */
306  /* ---------------------------------------------------------------------- */
307 
308  top = nrow ; /* Stack is empty */
309  Flag [k] = mark ; /* do not include diagonal entry in Stack */
310 
311 #define SCATTER /* do not scatter numerical values */
312 #define PARENT(i) Parent [i] /* use Parent for etree */
313 
314  if (stype != 0)
315  {
316  /* scatter kth col of triu (A), get pattern L(k,:) */
317  p = Ap [k] ;
318  pend = (packed) ? (Ap [k+1]) : (p + Anz [k]) ;
319  SUBTREE ;
320  }
321  else
322  {
323  /* scatter kth col of triu (beta*I+AA'), get pattern L(k,:) */
324  pf = Fp [k] ;
325  pfend = (Fpacked) ? (Fp [k+1]) : (pf + Fnz [k]) ;
326  for ( ; pf < pfend ; pf++)
327  {
328  /* get nonzero entry F (t,k) */
329  t = Fi [pf] ;
330  p = Ap [t] ;
331  pend = (packed) ? (Ap [t+1]) : (p + Anz [t]) ;
332  SUBTREE ;
333  }
334  }
335 
336 #undef SCATTER
337 #undef PARENT
338 
339  /* shift the stack upwards, to the first part of R */
340  len = nrow - top ;
341  for (i = 0 ; i < len ; i++)
342  {
343  Stack [i] = Stack [top + i] ;
344  }
345 
346  Rp = R->p ;
347  Rp [0] = 0 ;
348  Rp [1] = len ;
349  R->sorted = FALSE ;
350 
351  CHOLMOD(clear_flag) (Common) ;
352  ASSERT (CHOLMOD(dump_work) (TRUE, TRUE, 0, Common)) ;
353  return (TRUE) ;
354 }
355 
356 
357 /* ========================================================================== */
358 /* === cholmod_row_lsubtree ================================================= */
359 /* ========================================================================== */
360 
361 /* Identical to cholmod_row_subtree, except that the elimination tree is
362  * obtained from L itself, as the first off-diagonal entry in each column.
363  * L must be simplicial, not supernodal */
364 
366 (
367  /* ---- input ---- */
368  cholmod_sparse *A, /* matrix to analyze */
369  Int *Fi, size_t fnz, /* nonzero pattern of kth row of A', not required
370  * for the symmetric case. Need not be sorted. */
371  size_t krow, /* row k of L */
372  cholmod_factor *L, /* the factor L from which parent(i) is derived */
373  /* ---- output --- */
374  cholmod_sparse *R, /* pattern of L(k,:), 1-by-n with R->nzmax >= n */
375  /* --------------- */
376  cholmod_common *Common
377 )
378 {
379  Int *Rp, *Stack, *Flag, *Ap, *Ai, *Anz, *Lp, *Li, *Lnz ;
380  Int p, pend, parent, t, stype, nrow, k, pf, packed, sorted, top, len, i,
381  mark ;
382 
383  /* ---------------------------------------------------------------------- */
384  /* check inputs */
385  /* ---------------------------------------------------------------------- */
386 
388  RETURN_IF_NULL (A, FALSE) ;
389  RETURN_IF_NULL (R, FALSE) ;
390  RETURN_IF_NULL (L, FALSE) ;
394  stype = A->stype ;
395  if (stype == 0)
396  {
397  RETURN_IF_NULL (Fi, FALSE) ;
398  }
399  if (krow >= A->nrow)
400  {
401  ERROR (CHOLMOD_INVALID, "lsubtree: k invalid") ;
402  return (FALSE) ;
403  }
404  if (R->ncol != 1 || A->nrow != R->nrow || A->nrow > R->nzmax)
405  {
406  ERROR (CHOLMOD_INVALID, "lsubtree: R invalid") ;
407  return (FALSE) ;
408  }
409  if (L->is_super)
410  {
411  ERROR (CHOLMOD_INVALID, "lsubtree: L invalid (cannot be supernodal)") ;
412  return (FALSE) ;
413  }
414  Common->status = CHOLMOD_OK ;
415 
416  /* ---------------------------------------------------------------------- */
417  /* allocate workspace */
418  /* ---------------------------------------------------------------------- */
419 
420  nrow = A->nrow ;
421  CHOLMOD(allocate_work) (nrow, 0, 0, Common) ;
422  if (Common->status < CHOLMOD_OK)
423  {
424  return (FALSE) ;
425  }
426  ASSERT (CHOLMOD(dump_work) (TRUE, TRUE, 0, Common)) ;
427 
428  /* ---------------------------------------------------------------------- */
429  /* get inputs */
430  /* ---------------------------------------------------------------------- */
431 
432  if (stype < 0)
433  {
434  /* symmetric lower triangular form not supported */
435  ERROR (CHOLMOD_INVALID, "symmetric lower not supported") ;
436  return (FALSE) ;
437  }
438 
439  Ap = A->p ;
440  Ai = A->i ;
441  Anz = A->nz ;
442  packed = A->packed ;
443  sorted = A->sorted ;
444 
445  k = krow ;
446  Stack = R->i ;
447 
448  Lp = L->p ;
449  Li = L->i ;
450  Lnz = L->nz ;
451 
452  /* ---------------------------------------------------------------------- */
453  /* get workspace */
454  /* ---------------------------------------------------------------------- */
455 
456  Flag = Common->Flag ; /* size nrow, Flag [i] < mark must hold */
457  mark = CHOLMOD(clear_flag) (Common) ;
458 
459  /* ---------------------------------------------------------------------- */
460  /* compute the pattern of L(k,:) */
461  /* ---------------------------------------------------------------------- */
462 
463  top = nrow ; /* Stack is empty */
464  Flag [k] = mark ; /* do not include diagonal entry in Stack */
465 
466 #define SCATTER /* do not scatter numerical values */
467 #define PARENT(i) (Lnz [i] > 1) ? (Li [Lp [i] + 1]) : EMPTY
468 
469  if (stype != 0)
470  {
471  /* scatter kth col of triu (A), get pattern L(k,:) */
472  p = Ap [k] ;
473  pend = (packed) ? (Ap [k+1]) : (p + Anz [k]) ;
474  SUBTREE ;
475  }
476  else
477  {
478  /* scatter kth col of triu (beta*I+AA'), get pattern L(k,:) */
479  for (pf = 0 ; pf < (Int) fnz ; pf++)
480  {
481  /* get nonzero entry F (t,k) */
482  t = Fi [pf] ;
483  p = Ap [t] ;
484  pend = (packed) ? (Ap [t+1]) : (p + Anz [t]) ;
485  SUBTREE ;
486  }
487  }
488 
489 #undef SCATTER
490 #undef PARENT
491 
492  /* shift the stack upwards, to the first part of R */
493  len = nrow - top ;
494  for (i = 0 ; i < len ; i++)
495  {
496  Stack [i] = Stack [top + i] ;
497  }
498 
499  Rp = R->p ;
500  Rp [0] = 0 ;
501  Rp [1] = len ;
502  R->sorted = FALSE ;
503 
504  CHOLMOD(clear_flag) (Common) ;
505  ASSERT (CHOLMOD(dump_work) (TRUE, TRUE, 0, Common)) ;
506  return (TRUE) ;
507 }
508 
509 
510 /* ========================================================================== */
511 /* === cholmod_rowfac ======================================================= */
512 /* ========================================================================== */
513 
514 /* This is the incremental factorization for general purpose usage. */
515 
516 int CHOLMOD(rowfac)
517 (
518  /* ---- input ---- */
519  cholmod_sparse *A, /* matrix to factorize */
520  cholmod_sparse *F, /* used for A*A' case only. F=A' or A(:,f)' */
521  double beta [2], /* factorize beta*I+A or beta*I+AA' */
522  size_t kstart, /* first row to factorize */
523  size_t kend, /* last row to factorize is kend-1 */
524  /* ---- in/out --- */
525  cholmod_factor *L,
526  /* --------------- */
527  cholmod_common *Common
528 )
529 {
530  return (CHOLMOD(rowfac_mask) (A, F, beta, kstart, kend, NULL, NULL, L,
531  Common)) ;
532 }
533 
534 
535 /* ========================================================================== */
536 /* === cholmod_rowfac_mask ================================================== */
537 /* ========================================================================== */
538 
539 /* This is meant for use in LPDASA only. */
540 
541 int CHOLMOD(rowfac_mask)
542 (
543  /* ---- input ---- */
544  cholmod_sparse *A, /* matrix to factorize */
545  cholmod_sparse *F, /* used for A*A' case only. F=A' or A(:,f)' */
546  double beta [2], /* factorize beta*I+A or beta*I+AA' */
547  size_t kstart, /* first row to factorize */
548  size_t kend, /* last row to factorize is kend-1 */
549  Int *mask, /* size A->nrow. if mask[i] >= 0 row i is set to zero */
550  Int *RLinkUp, /* size A->nrow. link list of rows to compute */
551  /* ---- in/out --- */
552  cholmod_factor *L,
553  /* --------------- */
554  cholmod_common *Common
555 )
556 {
557  Int n ;
558  size_t s ;
559  int ok = TRUE ;
560 
561  /* ---------------------------------------------------------------------- */
562  /* check inputs */
563  /* ---------------------------------------------------------------------- */
564 
566  RETURN_IF_NULL (A, FALSE) ;
567  RETURN_IF_NULL (L, FALSE) ;
570  if (L->xtype != CHOLMOD_PATTERN && A->xtype != L->xtype)
571  {
572  ERROR (CHOLMOD_INVALID, "xtype of A and L do not match") ;
573  return (FALSE) ;
574  }
575  if (L->is_super)
576  {
577  ERROR (CHOLMOD_INVALID, "can only do simplicial factorization");
578  return (FALSE) ;
579  }
580  if (A->stype == 0)
581  {
582  RETURN_IF_NULL (F, FALSE) ;
583  if (A->xtype != F->xtype)
584  {
585  ERROR (CHOLMOD_INVALID, "xtype of A and F do not match") ;
586  return (FALSE) ;
587  }
588  }
589  if (A->stype < 0)
590  {
591  /* symmetric lower triangular form not supported */
592  ERROR (CHOLMOD_INVALID, "symmetric lower not supported") ;
593  return (FALSE) ;
594  }
595  if (kend > L->n)
596  {
597  ERROR (CHOLMOD_INVALID, "kend invalid") ;
598  return (FALSE) ;
599  }
600  if (A->nrow != L->n)
601  {
602  ERROR (CHOLMOD_INVALID, "dimensions of A and L do not match") ;
603  return (FALSE) ;
604  }
605  Common->status = CHOLMOD_OK ;
606  Common->rowfacfl = 0 ;
607 
608  /* ---------------------------------------------------------------------- */
609  /* allocate workspace */
610  /* ---------------------------------------------------------------------- */
611 
612  /* Xwork is of size n for the real case, 2*n for complex/zomplex */
613  n = L->n ;
614 
615  /* s = ((A->xtype != CHOLMOD_REAL) ? 2:1)*n */
616  s = CHOLMOD(mult_size_t) (n, ((A->xtype != CHOLMOD_REAL) ? 2:1), &ok) ;
617  if (!ok)
618  {
619  ERROR (CHOLMOD_TOO_LARGE, "problem too large") ;
620  return (FALSE) ;
621  }
622 
623  CHOLMOD(allocate_work) (n, n, s, Common) ;
624  if (Common->status < CHOLMOD_OK)
625  {
626  return (FALSE) ;
627  }
628  ASSERT (CHOLMOD(dump_work) (TRUE, TRUE, A->nrow, Common)) ;
629 
630  /* ---------------------------------------------------------------------- */
631  /* factorize the matrix, using template routine */
632  /* ---------------------------------------------------------------------- */
633 
634  if (RLinkUp == NULL)
635  {
636 
637  switch (A->xtype)
638  {
639  case CHOLMOD_REAL:
640  ok = r_cholmod_rowfac (A, F, beta, kstart, kend, L, Common) ;
641  break ;
642 
643  case CHOLMOD_COMPLEX:
644  ok = c_cholmod_rowfac (A, F, beta, kstart, kend, L, Common) ;
645  break ;
646 
647  case CHOLMOD_ZOMPLEX:
648  ok = z_cholmod_rowfac (A, F, beta, kstart, kend, L, Common) ;
649  break ;
650  }
651 
652  }
653  else
654  {
655 
656  switch (A->xtype)
657  {
658  case CHOLMOD_REAL:
659  ok = r_cholmod_rowfac_mask (A, F, beta, kstart, kend,
660  mask, RLinkUp, L, Common) ;
661  break ;
662 
663  case CHOLMOD_COMPLEX:
664  ok = c_cholmod_rowfac_mask (A, F, beta, kstart, kend,
665  mask, RLinkUp, L, Common) ;
666  break ;
667 
668  case CHOLMOD_ZOMPLEX:
669  ok = z_cholmod_rowfac_mask (A, F, beta, kstart, kend,
670  mask, RLinkUp, L, Common) ;
671  break ;
672  }
673  }
674 
675  return (ok) ;
676 }
677 #endif
int CHOLMOD() row_subtree(cholmod_sparse *A, cholmod_sparse *F, size_t krow, Int *Parent, cholmod_sparse *R, cholmod_common *Common)
#define CHOLMOD_TOO_LARGE
#define SUBTREE
int CHOLMOD() row_lsubtree(cholmod_sparse *A, Int *Fi, size_t fnz, size_t krow, cholmod_factor *L, cholmod_sparse *R, cholmod_common *Common)
#define Int
#define CHOLMOD_COMPLEX
#define FALSE
#define RETURN_IF_NULL_COMMON(result)
size_t CHOLMOD() mult_size_t(size_t a, size_t k, int *ok)
int CHOLMOD() dump_work(int flag, int head, UF_long wsize, cholmod_common *Common)
#define CHOLMOD_PATTERN
int CHOLMOD() rowfac(cholmod_sparse *A, cholmod_sparse *F, double beta[2], size_t kstart, size_t kend, cholmod_factor *L, cholmod_common *Common)
#define CHOLMOD(name)
#define CHOLMOD_REAL
#define NULL
#define ASSERT(expression)
int CHOLMOD() rowfac_mask(cholmod_sparse *A, cholmod_sparse *F, double beta[2], size_t kstart, size_t kend, Int *mask, Int *RLinkUp, cholmod_factor *L, cholmod_common *Common)
#define CHOLMOD_INVALID
#define CHOLMOD_OK
int CHOLMOD() allocate_work(size_t nrow, size_t iworksize, size_t xworksize, cholmod_common *Common)
#define RETURN_IF_NULL(A, result)
UF_long CHOLMOD() clear_flag(cholmod_common *Common)
int n
#define ERROR(status, msg)
#define TRUE
#define RETURN_IF_XTYPE_INVALID(A, xtype1, xtype2, result)
#define CHOLMOD_ZOMPLEX