Exemple #1
0
/* end of augmenting path if found. */
static int 
touch2 (
    int node,
    int *pointers,		/* start/stop of adjacency lists */
    int *indices,		/* adjacency list for each vertex */
    int *flow,			/* flow on right->left edges */
    int *touched		/* flags for each vertex */
)
{
    int       neighbor;		/* neighbor of a vertex */
    int       result;		/* return value */
    int       i, j;		/* loop counters */

    touched[node] = TRUE;

    for (i = pointers[node]; i < pointers[node + 1]; i++) {
	neighbor = indices[i];
	if (!touched[neighbor]) {	/* Not yet considered. */
	    touched[neighbor] = TRUE;
	    for (j = pointers[neighbor]; j < pointers[neighbor + 1]; j++) {
		if (flow[j] && !touched[indices[j]]) {
		    result = touch2(indices[j], pointers, indices, flow, touched);
		    if (result) {
			return (1);
		    }
		}
	    }
	}
    }
    return (0);
}
Exemple #2
0
 int test() const {
   // We were accidentally not invalidating under -analyzer-ipa=inlining
   // at one point for virtual methods with visible definitions.
   int a, b, c, d;
   touch(a);
   touch2(b);
   touchV(c);
   touchV2(d);
   return a + b + c + d; // no-warning
 }
Exemple #3
0
static void reachability(int  n_left,   /* number of vertices on left side */
                         int  n_right,  /* number of vertices on right side */
                         int *pointers, /* start/stop of adjacency lists */
                         int *indices,  /* adjacency list for each vertex */
                         int *resid,    /* residual weight at each vertex */
                         int *flow,     /* flow on right->left edges */
                         int *touched   /* flags for each vertex */
                         )
{
  int i; /* loop counter */

  /* Initialize all the vertices to be untouched */
  for (i       = 0; i < n_left + n_right; i++)
    touched[i] = 0;

  for (i = 0; i < n_left; i++)
    if (!touched[i] && resid[i]) {
      touch2(i, pointers, indices, flow, touched);
    }
}