4#define STACK_NOT_EMPTY (top >= 0)
13 ladel_int current_node, current_child, top = 0;
18 current_node = stack[top];
19 current_child = first_child[current_node];
20 if (current_child ==
NONE)
23 postorder[post_index] = current_node;
27 first_child[current_node] = next_child[current_child];
29 stack[top] = current_child;
37 if (!M || !sym || !sym->
etree || !work)
return FAIL;
42 ladel_int *first_child, *next_child, *stack, *roots;
48 for (col = 0; col < ncol; col++) first_child[col] =
NONE;
49 for (col = ncol-1; col >= 0; col--)
53 roots[col] = prev_root;
57 next_child[col] = first_child[etree[col]];
58 first_child[etree[col]] = col;
61 for (col = prev_root; col !=
NONE; col = roots[col])
63 post_index = ladel_depth_first_search(col, post_index, first_child, next_child, stack, postorder);
#define NONE
Indicates a root (a node without parent), or an untouched node.
#define SUCCESS
For status returns.
#define FAIL
For status returns.
#define IS_ROOT(col, etree)
Check whether a node is a root (i.e.
Memory allocation routines.
ladel_int ladel_postorder(ladel_sparse_matrix *M, ladel_symbolics *sym, ladel_work *work)
Compute the postordering of the elimination tree.
Structures and types used in LADEL routines.
int64_t ladel_int
Type for integer numbers (default: int64_t)
Sparse matrix in compressed column storage.
ladel_int ncol
number of columns
Workspace required for various routines in LADEL.
ladel_int * array_int_ncol2
An array of ncol integers.
ladel_int * array_int_ncol1
An array of ncol integers.
ladel_int * array_int_ncol3
An array of ncol integers.
ladel_int * array_int_ncol4
An array of ncol integers.