Blame isl-0.14/isl_tarjan.h

Packit fb9d21
#ifndef ISL_TARJAN_H
Packit fb9d21
#define ISL_TARJAN_H
Packit fb9d21
Packit fb9d21
/* Structure for representing the nodes in the graph being traversed
Packit fb9d21
 * using Tarjan's algorithm.
Packit fb9d21
 * index represents the order in which nodes are visited.
Packit fb9d21
 * min_index is the index of the root of a (sub)component.
Packit fb9d21
 * on_stack indicates whether the node is currently on the stack.
Packit fb9d21
 */
Packit fb9d21
struct isl_tarjan_node {
Packit fb9d21
	int index;
Packit fb9d21
	int min_index;
Packit fb9d21
	int on_stack;
Packit fb9d21
};
Packit fb9d21
Packit fb9d21
/* Structure for representing the graph being traversed
Packit fb9d21
 * using Tarjan's algorithm.
Packit fb9d21
 * len is the number of nodes
Packit fb9d21
 * node is an array of nodes
Packit fb9d21
 * stack contains the nodes on the path from the root to the current node
Packit fb9d21
 * sp is the stack pointer
Packit fb9d21
 * index is the index of the last node visited
Packit fb9d21
 * order contains the elements of the components separated by -1
Packit fb9d21
 * op represents the current position in order
Packit fb9d21
 */
Packit fb9d21
struct isl_tarjan_graph {
Packit fb9d21
	int len;
Packit fb9d21
	struct isl_tarjan_node *node;
Packit fb9d21
	int *stack;
Packit fb9d21
	int sp;
Packit fb9d21
	int index;
Packit fb9d21
	int *order;
Packit fb9d21
	int op;
Packit fb9d21
};
Packit fb9d21
Packit fb9d21
struct isl_tarjan_graph *isl_tarjan_graph_init(isl_ctx *ctx, int len,
Packit fb9d21
	int (*follows)(int i, int j, void *user), void *user);
Packit fb9d21
void isl_tarjan_graph_free(struct isl_tarjan_graph *g);
Packit fb9d21
Packit fb9d21
#endif