22#ifndef DOXYGEN_SHOULD_SKIP_THIS
23typedef struct _Queue {
37static void queue_push_back (Queue *self,
pastix_int_t v) {
39 assert( self->end < self->size );
40 self->tab[ self->end ] = v;
47 assert( self->start <= self->end );
48 v = self->tab[self->start];
53 return self->start == self->end;
56static void queue_free (Queue *self) {
77 move = pastix_imin( p1, size );
83 assert( p2 - to == 0 );
130 assert(baseval == 0);
135 colptr = graph->colptr;
136 rowptr = graph->rowptr - baseval;
137 while ( total > 0 ) {
140 while ((i < n) && (comp_vtx[i] != -1) ) {
145 queue_push_back( &q, i );
150 while ( !queue_is_empty( &q ) )
152 v = queue_pop_front( &q );
154 for (i = colptr[v]; i < colptr[v+1]; i++) {
155 u = rowptr[i] - baseval;
157 if ( comp_vtx[u] != -1 ) {
158 assert( comp_vtx[u] == comp_vtx[v] );
162 queue_push_back( &q, u );
174 assert( comp_vtx[i] != -1);
BEGIN_C_DECLS typedef int pastix_int_t
pastix_int_t graphIsolateConnectedComponents(const pastix_graph_t *graph, pastix_int_t *comp_vtx, pastix_int_t *comp_sze)
Isolate the connected components from the original graph.