INGOR
Loading...
Searching...
No Matches
ytBitSet.h
1/*
2 util/ytBitSet.{h,c} : Bit Set
3 Copyright (C) 2016, Yoshinori Tamada <tamada A T ytlab.jp>
4 All rights reserved.
5
6 See LICENSE.txt for details of the licensing agreement.
7*/
8
9#ifndef __YTLIB_BIT_SET_H
10#define __YTLIB_BIT_SET_H
11#include <stdint.h>
12#include <stdio.h>
13
14typedef struct {
15 uint64_t * B;
16 size_t size;
17 size_t buffSize;
18 uint64_t mask;
19} ytBitSet;
20
21ytBitSet * ytBitSet_new();
22ytBitSet * ytBitSet_newSize(size_t size);
23ytBitSet * ytBitSet_arrayNew(size_t elms);
24ytBitSet * ytBitSet_arrayNewSize(size_t elms, size_t size);
25void ytBitSet_clear(ytBitSet * this);
26void ytBitSet_clearInv(ytBitSet * this);
27void ytBitSet_on(ytBitSet * this, size_t index);
28void ytBitSet_copy(ytBitSet * this, const ytBitSet * set);
29void ytBitSet_and(ytBitSet * this, const ytBitSet * set);
30void ytBitSet_and2(const ytBitSet * this, const ytBitSet * set, ytBitSet * res);
31void ytBitSet_xor(ytBitSet * this, const ytBitSet * set);
32size_t ytBitSet_count(const ytBitSet * this);
33int * ytBitSet_genLsbTable();
34size_t ytBitSet_lsbTable(const ytBitSet * this, const int * table);
35void ytBitSet_print(const ytBitSet * this, FILE * fp);
36void ytBitSet_test();
37
38#endif /* __YTLIB_BIT_SET_H */
Definition ytBitSet.h:14