bitmap.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013 #ifndef SATSOLVER_BITMAP_H
00014 #define SATSOLVER_BITMAP_H
00015
00016 #include <string.h>
00017
00018 typedef struct _Map {
00019 unsigned char *map;
00020 int size;
00021 } Map;
00022
00023 #define MAPZERO(m) (memset((m)->map, 0, (m)->size))
00024 #define MAPSET(m, n) ((m)->map[(n) >> 3] |= 1 << ((n) & 7)) // Set Bit
00025 #define MAPCLR(m, n) ((m)->map[(n) >> 3] &= ~(1 << ((n) & 7))) // Reset Bit
00026 #define MAPTST(m, n) ((m)->map[(n) >> 3] & (1 << ((n) & 7))) // Test Bit
00027
00028 static inline void
00029 map_empty(Map *m)
00030 {
00031 MAPZERO(m);
00032 }
00033
00034 extern void map_init(Map *m, int n);
00035 extern void map_init_clone(Map *t, Map *s);
00036 extern void map_grow(Map *m, int n);
00037 extern void map_free(Map *m);
00038
00039 #endif