bit_vector_interface¶
ソースコード¶
from titan_pylib.data_structures.bit_vector.bit_vector_interface import BitVectorInterface
展開済みコード¶
1# from titan_pylib.data_structures.bit_vector.bit_vector_interface import BitVectorInterface
2from abc import ABC, abstractmethod
3
4
5class BitVectorInterface(ABC):
6
7 @abstractmethod
8 def access(self, k: int) -> int:
9 raise NotImplementedError
10
11 @abstractmethod
12 def __getitem__(self, k: int) -> int:
13 raise NotImplementedError
14
15 @abstractmethod
16 def rank0(self, r: int) -> int:
17 raise NotImplementedError
18
19 @abstractmethod
20 def rank1(self, r: int) -> int:
21 raise NotImplementedError
22
23 @abstractmethod
24 def rank(self, r: int, v: int) -> int:
25 raise NotImplementedError
26
27 @abstractmethod
28 def select0(self, k: int) -> int:
29 raise NotImplementedError
30
31 @abstractmethod
32 def select1(self, k: int) -> int:
33 raise NotImplementedError
34
35 @abstractmethod
36 def select(self, k: int, v: int) -> int:
37 raise NotImplementedError
38
39 @abstractmethod
40 def __len__(self) -> int:
41 raise NotImplementedError
42
43 @abstractmethod
44 def __str__(self) -> str:
45 raise NotImplementedError
46
47 @abstractmethod
48 def __repr__(self) -> str:
49 raise NotImplementedError