Dip  0.92.4
Classes | Macros | Typedefs | Functions | Variables
MAD_CliquerI.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  _graph_t
 
struct  _clique_options
 

Macros

#define ELEMENTSIZE   64
 
#define SET_ELEMENT_BIT_COUNT_8(a)   (set_bit_count[(a)])
 
#define SET_ELEMENT_BIT_COUNT_16(a)
 
#define SET_ELEMENT_BIT_COUNT_32(a)
 
#define SET_ELEMENT_BIT_COUNT_64(a)
 
#define SET_ELEMENT_BIT_COUNT(a)   SET_ELEMENT_BIT_COUNT_64(a)
 
#define FULL_ELEMENT   ((setelement)0xFFFFFFFFFFFFFFFF)
 
#define SET_BIT_MASK(x)   ((setelement)1<<(x))
 
#define SET_ELEMENT_CONTAINS(e, v)   ((e)&SET_BIT_MASK(v))
 
#define SET_ADD_ELEMENT(s, a)   ((s)[(a)/ELEMENTSIZE] |= SET_BIT_MASK((a)%ELEMENTSIZE))
 
#define SET_DEL_ELEMENT(s, a)   ((s)[(a)/ELEMENTSIZE] &= ~SET_BIT_MASK((a)%ELEMENTSIZE))
 
#define SET_CONTAINS_FAST(s, a)
 
#define SET_CONTAINS(s, a)   (((a)<SET_MAX_SIZE(s))?SET_CONTAINS_FAST(s,a):0)
 
#define SET_MAX_SIZE(s)   ((s)[-1])
 
#define SET_ARRAY_LENGTH(s)   (((s)[-1]+ELEMENTSIZE-1)/ELEMENTSIZE)
 
#define GRAPH_ADD_EDGE(g, i, j)
 
#define GRAPH_DEL_EDGE(g, i, j)
 
#define GRAPH_IS_EDGE_FAST(g, i, j)   (SET_CONTAINS_FAST((g)->edges[(i)],(j)))
 

Typedefs

typedef unsigned long int setelement
 
typedef setelementset_t
 
typedef struct _graph_t graph_t
 
typedef struct _clique_options clique_options
 

Functions

static int set_size (set_t s)
 
static set_t set_new (int size)
 
static void set_free (set_t s)
 
static set_t set_duplicate (set_t s)
 
graph_tgraph_new (int n)
 
void graph_free (graph_t *g)
 
void graph_print (graph_t *g)
 
int graph_edge_count (graph_t *g)
 
static int graph_subgraph_weight (graph_t *g, set_t s)
 
int clique_find_all (graph_t *g, int min_weight, int max_weight, int maximal, clique_options *opts)
 
set_t clique_find_single (graph_t *g, int min_weight, int max_weight, int maximal, clique_options *opts)
 
int clique_unweighted_find_all (graph_t *g, int min_size, int max_size, int maximal, clique_options *opts)
 

Variables

static int set_bit_count [256]
 
clique_optionsclique_default_options
 

Macro Definition Documentation

#define ELEMENTSIZE   64

Definition at line 26 of file MAD_CliquerI.h.

Referenced by graph_subgraph_weight(), and set_new().

#define SET_ELEMENT_BIT_COUNT_8 (   a)    (set_bit_count[(a)])

Definition at line 56 of file MAD_CliquerI.h.

#define SET_ELEMENT_BIT_COUNT_16 (   a)
Value:
(set_bit_count[(a)>>8] + \
set_bit_count[(a)&0xFF])
static int set_bit_count[256]
Definition: MAD_CliquerI.h:35

Definition at line 57 of file MAD_CliquerI.h.

#define SET_ELEMENT_BIT_COUNT_32 (   a)
Value:
(set_bit_count[(a)>>24] + \
set_bit_count[((a)>>16)&0xFF] + \
set_bit_count[((a)>>8)&0xFF] + \
set_bit_count[(a)&0xFF])
static int set_bit_count[256]
Definition: MAD_CliquerI.h:35

Definition at line 59 of file MAD_CliquerI.h.

#define SET_ELEMENT_BIT_COUNT_64 (   a)
Value:
(set_bit_count[(a)>>56] + \
set_bit_count[((a)>>48)&0xFF] + \
set_bit_count[((a)>>40)&0xFF] + \
set_bit_count[((a)>>32)&0xFF] + \
set_bit_count[((a)>>24)&0xFF] + \
set_bit_count[((a)>>16)&0xFF] + \
set_bit_count[((a)>>8)&0xFF] + \
set_bit_count[(a)&0xFF])
static int set_bit_count[256]
Definition: MAD_CliquerI.h:35

Definition at line 63 of file MAD_CliquerI.h.

#define SET_ELEMENT_BIT_COUNT (   a)    SET_ELEMENT_BIT_COUNT_64(a)

Definition at line 72 of file MAD_CliquerI.h.

Referenced by set_size().

#define FULL_ELEMENT   ((setelement)0xFFFFFFFFFFFFFFFF)

Definition at line 73 of file MAD_CliquerI.h.

#define SET_BIT_MASK (   x)    ((setelement)1<<(x))

Definition at line 92 of file MAD_CliquerI.h.

#define SET_ELEMENT_CONTAINS (   e,
 
)    ((e)&SET_BIT_MASK(v))

Definition at line 95 of file MAD_CliquerI.h.

#define SET_ADD_ELEMENT (   s,
 
)    ((s)[(a)/ELEMENTSIZE] |= SET_BIT_MASK((a)%ELEMENTSIZE))

Definition at line 96 of file MAD_CliquerI.h.

#define SET_DEL_ELEMENT (   s,
 
)    ((s)[(a)/ELEMENTSIZE] &= ~SET_BIT_MASK((a)%ELEMENTSIZE))

Definition at line 98 of file MAD_CliquerI.h.

#define SET_CONTAINS_FAST (   s,
 
)
Value:
#define ELEMENTSIZE
Definition: MAD_CliquerI.h:26
#define SET_ELEMENT_CONTAINS(e, v)
Definition: MAD_CliquerI.h:95

Definition at line 100 of file MAD_CliquerI.h.

Referenced by MAD_Cliquer::copyGraphNonPos(), and MAD_Cliquer::printGraphDimacs().

#define SET_CONTAINS (   s,
 
)    (((a)<SET_MAX_SIZE(s))?SET_CONTAINS_FAST(s,a):0)

Definition at line 102 of file MAD_CliquerI.h.

Referenced by MAD_Cliquer::cliquePopulateVector(), and MAD_Cliquer::cliquePrint().

#define SET_MAX_SIZE (   s)    ((s)[-1])
#define SET_ARRAY_LENGTH (   s)    (((s)[-1]+ELEMENTSIZE-1)/ELEMENTSIZE)

Definition at line 108 of file MAD_CliquerI.h.

Referenced by graph_subgraph_weight(), set_duplicate(), and set_size().

#define GRAPH_ADD_EDGE (   g,
  i,
 
)
Value:
do { \
SET_ADD_ELEMENT((g)->edges[(i)],(j)); \
SET_ADD_ELEMENT((g)->edges[(j)],(i)); \
} while (0)
#define SET_ADD_ELEMENT(s, a)
Definition: MAD_CliquerI.h:96

Definition at line 169 of file MAD_CliquerI.h.

Referenced by MAD_Cliquer::addEdge().

#define GRAPH_DEL_EDGE (   g,
  i,
 
)
Value:
do { \
SET_DEL_ELEMENT((g)->edges[(i)],(j)); \
SET_DEL_ELEMENT((g)->edges[(j)],(i)); \
} while (0)
#define SET_DEL_ELEMENT(s, a)
Definition: MAD_CliquerI.h:98

Definition at line 173 of file MAD_CliquerI.h.

Referenced by MAD_Cliquer::delEdge().

#define GRAPH_IS_EDGE_FAST (   g,
  i,
 
)    (SET_CONTAINS_FAST((g)->edges[(i)],(j)))

Definition at line 178 of file MAD_CliquerI.h.

Typedef Documentation

typedef unsigned long int setelement

Definition at line 20 of file MAD_CliquerI.h.

typedef setelement* set_t

Definition at line 29 of file MAD_CliquerI.h.

typedef struct _graph_t graph_t

Definition at line 161 of file MAD_CliquerI.h.

Definition at line 204 of file MAD_CliquerI.h.

Function Documentation

static int set_size ( set_t  s)
inlinestatic

Definition at line 115 of file MAD_CliquerI.h.

References SET_ARRAY_LENGTH, and SET_ELEMENT_BIT_COUNT.

Referenced by MAD_Cliquer::cliquePrint().

static set_t set_new ( int  size)
inlinestatic

Definition at line 129 of file MAD_CliquerI.h.

References ELEMENTSIZE.

Referenced by set_duplicate().

static void set_free ( set_t  s)
inlinestatic

Definition at line 143 of file MAD_CliquerI.h.

Referenced by MAD_Cliquer::cliqueFreeMemory().

static set_t set_duplicate ( set_t  s)
inlinestatic

Definition at line 152 of file MAD_CliquerI.h.

References SET_ARRAY_LENGTH, SET_MAX_SIZE, and set_new().

Referenced by record_clique_func().

graph_t* graph_new ( int  n)

Referenced by MAD_Cliquer::graphNew().

void graph_free ( graph_t g)
void graph_print ( graph_t g)

Referenced by MAD_Cliquer::printGraph().

int graph_edge_count ( graph_t g)
static int graph_subgraph_weight ( graph_t g,
set_t  s 
)
inlinestatic

Definition at line 186 of file MAD_CliquerI.h.

References ELEMENTSIZE, SET_ARRAY_LENGTH, and _graph_t::weights.

Referenced by MAD_Cliquer::cliquePrint().

int clique_find_all ( graph_t g,
int  min_weight,
int  max_weight,
int  maximal,
clique_options opts 
)
set_t clique_find_single ( graph_t g,
int  min_weight,
int  max_weight,
int  maximal,
clique_options opts 
)
int clique_unweighted_find_all ( graph_t g,
int  min_size,
int  max_size,
int  maximal,
clique_options opts 
)

Variable Documentation

int set_bit_count[256]
static
Initial value:
= {
0,1,1,2,1,2,2,3,1,2,2,3,2,3,3,4,
1,2,2,3,2,3,3,4,2,3,3,4,3,4,4,5,
1,2,2,3,2,3,3,4,2,3,3,4,3,4,4,5,
2,3,3,4,3,4,4,5,3,4,4,5,4,5,5,6,
1,2,2,3,2,3,3,4,2,3,3,4,3,4,4,5,
2,3,3,4,3,4,4,5,3,4,4,5,4,5,5,6,
2,3,3,4,3,4,4,5,3,4,4,5,4,5,5,6,
3,4,4,5,4,5,5,6,4,5,5,6,5,6,6,7,
1,2,2,3,2,3,3,4,2,3,3,4,3,4,4,5,
2,3,3,4,3,4,4,5,3,4,4,5,4,5,5,6,
2,3,3,4,3,4,4,5,3,4,4,5,4,5,5,6,
3,4,4,5,4,5,5,6,4,5,5,6,5,6,6,7,
2,3,3,4,3,4,4,5,3,4,4,5,4,5,5,6,
3,4,4,5,4,5,5,6,4,5,5,6,5,6,6,7,
3,4,4,5,4,5,5,6,4,5,5,6,5,6,6,7,
4,5,5,6,5,6,6,7,5,6,6,7,6,7,7,8 }

Definition at line 35 of file MAD_CliquerI.h.

clique_options* clique_default_options