sym-ildl  1.0
Incomplete LDL' factorizations of indefinite symmetric matrices.
Functions
amd Namespace Reference

Functions

int amd_flip (const int &i)
 
int wclear (int mark, int lemax, int *w, int n)
 
int tdfs (int j, int k, int *head, const int *next, int *post, int *stack)
 

Function Documentation

int amd::amd_flip ( const int &  i)
inline
9 { return -i-2; }
int amd::tdfs ( int  j,
int  k,
int *  head,
const int *  next,
int *  post,
int *  stack 
)
inline
27  {
28  int i, p, top = 0;
29  if(!head || !next || !post || !stack) return (-1); /* check inputs */
30  stack[0] = j; /* place j on the stack */
31  while (top >= 0) /* while (stack is not empty) */
32  {
33  p = stack[top]; /* p = top of stack */
34  i = head[p]; /* i = youngest child of p */
35  if(i == -1)
36  {
37  top--; /* p has no unordered children left */
38  post[k++] = p; /* node p is the kth postordered node */
39  }
40  else
41  {
42  head[p] = next[i]; /* remove i from children of p */
43  stack[++top] = i; /* start dfs on child node i */
44  }
45  }
46  return k;
47  }
int amd::wclear ( int  mark,
int  lemax,
int *  w,
int  n 
)
inline
13  {
14  int k;
15  if(mark < 2 || (mark + lemax < 0))
16  {
17  for(k = 0; k < n; k++)
18  if(w[k] != 0)
19  w[k] = 1;
20  mark = 2;
21  }
22  return (mark); /* at this point, w[0..n-1] < mark holds */
23  }