abc-master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
sminterf.c File Reference
#include "espresso.h"

Go to the source code of this file.

Functions

ABC_NAMESPACE_IMPL_START pset do_sm_minimum_cover (pset_family A)
 

Function Documentation

ABC_NAMESPACE_IMPL_START pset do_sm_minimum_cover ( pset_family  A)

Definition at line 17 of file sminterf.c.

19 {
20  sm_matrix *M;
21  sm_row *sparse_cover;
22  sm_element *pe;
23  pset cover;
24  register int i, base, rownum;
25  register unsigned val;
26  register pset last, p;
27 
28  M = sm_alloc();
29  rownum = 0;
30  foreach_set(A, last, p) {
31  foreach_set_element(p, i, val, base) {
32  (void) sm_insert(M, rownum, base);
33  }
34  rownum++;
35  }
36 
37  sparse_cover = sm_minimum_cover(M, NIL(int), 1, 0);
38  sm_free(M);
39 
40  cover = set_new(A->sf_size);
41  sm_foreach_row_element(sparse_cover, pe) {
42  set_insert(cover, pe->col_num);
43  }
44  sm_row_free(sparse_cover);
45 
46  return cover;
47 }
static Llb_Mgr_t * p
Definition: llb3Image.c:950
#define foreach_set(R, last, p)
Definition: espresso.h:135
#define foreach_set_element(p, i, val, base)
Definition: espresso.h:155
word M(word f1, word f2, int n)
Definition: kitPerm.c:240
#define NIL(type)
Definition: avl.h:25
#define sm_foreach_row_element(prow, p)
Definition: sparse.h:103
int sf_size
Definition: espresso.h:78
void sm_free(sm_matrix *A)
Definition: matrix.c:60
unsigned int * pset
Definition: espresso.h:73
sm_element * sm_insert(sm_matrix *A, int row, int col)
Definition: matrix.c:155
sm_row * sm_minimum_cover(sm_matrix *A, int *weight, int heuristic, int debug_level)
Definition: mincov.c:34
ABC_NAMESPACE_IMPL_START sm_matrix * sm_alloc()
Definition: matrix.c:31
#define set_new(size)
Definition: espresso.h:164
#define set_insert(set, e)
Definition: espresso.h:172
typedefABC_NAMESPACE_HEADER_START struct sm_element_struct sm_element
Definition: sparse.h:21
void sm_row_free(sm_row *prow)
Definition: rows.c:53