1
/* This software was developed by Bruce Hendrickson and Robert Leland *
2
* at Sandia National Laboratories under US Department of Energy *
3
* contract DE-AC04-76DP00789 and is copyrighted by Sandia Corporation. */
11
void clear_dvals(graph, nvtxs, ldvals, rdvals, bspace, list_length)
12
struct vtx_data **graph; /* data structure for graph */
13
int nvtxs; /* number of vtxs in graph */
14
int *ldvals; /* d-values for each transition */
15
int *rdvals; /* d-values for each transition */
16
int *bspace; /* list of activated vertices */
17
int list_length; /* number of activated vertices */
19
int *edges; /* loops through edge list */
20
int vtx; /* vertex in bspace */
21
int neighbor; /* neighbor of vtx */
22
int i, j; /* loop counters */
24
if (list_length > .05 * nvtxs) { /* Do it directly. */
25
for (i = 1; i <= nvtxs; i++) {
26
ldvals[i] = rdvals[i] = 0;
29
else { /* Do it more carefully */
30
for (i = 0; i < list_length; i++) {
34
ldvals[vtx] = rdvals[vtx] = 0;
35
edges = graph[vtx]->edges;
36
for (j = graph[vtx]->nedges - 1; j; j--) {
37
neighbor = *(++edges);
38
ldvals[neighbor] = rdvals[neighbor] = 0;