INGOR
Loading...
Searching...
No Matches
util
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
14
typedef
struct
{
15
uint64_t * B;
16
size_t
size;
17
size_t
buffSize;
18
uint64_t mask;
19
}
ytBitSet
;
20
21
ytBitSet
* ytBitSet_new();
22
ytBitSet
* ytBitSet_newSize(
size_t
size);
23
ytBitSet
* ytBitSet_arrayNew(
size_t
elms);
24
ytBitSet
* ytBitSet_arrayNewSize(
size_t
elms,
size_t
size);
25
void
ytBitSet_clear(
ytBitSet
*
this
);
26
void
ytBitSet_clearInv(
ytBitSet
*
this
);
27
void
ytBitSet_on(
ytBitSet
*
this
,
size_t
index);
28
void
ytBitSet_copy(
ytBitSet
*
this
,
const
ytBitSet
* set);
29
void
ytBitSet_and(
ytBitSet
*
this
,
const
ytBitSet
* set);
30
void
ytBitSet_and2(
const
ytBitSet
*
this
,
const
ytBitSet
* set,
ytBitSet
* res);
31
void
ytBitSet_xor(
ytBitSet
*
this
,
const
ytBitSet
* set);
32
size_t
ytBitSet_count(
const
ytBitSet
*
this
);
33
int
* ytBitSet_genLsbTable();
34
size_t
ytBitSet_lsbTable(
const
ytBitSet
*
this
,
const
int
* table);
35
void
ytBitSet_print(
const
ytBitSet
*
this
, FILE * fp);
36
void
ytBitSet_test();
37
38
#endif
/* __YTLIB_BIT_SET_H */
ytBitSet
Definition
ytBitSet.h:14
Generated by
1.9.8