ABC: A System for Sequential Synthesis and Verification
 
Loading...
Searching...
No Matches
part.c File Reference
#include "mincov_int.h"
Include dependency graph for part.c:

Go to the source code of this file.

Functions

int sm_block_partition (sm_matrix *A, sm_matrix **L, sm_matrix **R)
 

Function Documentation

◆ sm_block_partition()

int sm_block_partition ( sm_matrix * A,
sm_matrix ** L,
sm_matrix ** R )

Definition at line 88 of file part.c.

91{
92 int cols_visited, rows_visited;
93 register sm_row *prow;
94 register sm_col *pcol;
95
96 /* Avoid the trivial case */
97 if (A->nrows == 0) {
98 return 0;
99 }
100
101 /* Reset the visited flags for each row and column */
102 for(prow = A->first_row; prow != 0; prow = prow->next_row) {
103 prow->flag = 0;
104 }
105 for(pcol = A->first_col; pcol != 0; pcol = pcol->next_col) {
106 pcol->flag = 0;
107 }
108
109 cols_visited = rows_visited = 0;
110 if (visit_row(A, A->first_row, &rows_visited, &cols_visited)) {
111 /* we found all of the rows */
112 return 0;
113 } else {
114 *L = sm_alloc();
115 *R = sm_alloc();
116 for(prow = A->first_row; prow != 0; prow = prow->next_row) {
117 if (prow->flag) {
118 copy_row(*L, prow);
119 } else {
120 copy_row(*R, prow);
121 }
122 }
123 return 1;
124 }
125}
ABC_NAMESPACE_IMPL_START sm_matrix * sm_alloc()
Definition matrix.c:31
struct sm_col_struct sm_col
Definition sparse.h:23
struct sm_row_struct sm_row
Definition sparse.h:22
sm_col * next_col
Definition sparse.h:65
sm_col * first_col
Definition sparse.h:82
sm_row * first_row
Definition sparse.h:79
sm_row * next_row
Definition sparse.h:50
Here is the call graph for this function: