File tree Expand file tree Collapse file tree 2 files changed +29
-0
lines changed Expand file tree Collapse file tree 2 files changed +29
-0
lines changed Original file line number Diff line number Diff line change @@ -19,6 +19,7 @@ using faiss::DistanceComputer;
19
19
using faiss::IDSelector;
20
20
using faiss::IDSelectorAnd;
21
21
using faiss::IDSelectorBatch;
22
+ using faiss::IDSelectorBitmap;
22
23
using faiss::IDSelectorNot;
23
24
using faiss::IDSelectorOr;
24
25
using faiss::IDSelectorRange;
@@ -119,6 +120,23 @@ int faiss_IDSelectorBatch_new(
119
120
CATCH_AND_HANDLE
120
121
}
121
122
123
+ DEFINE_DESTRUCTOR (IDSelectorBitmap)
124
+
125
+ DEFINE_GETTER(IDSelectorBitmap, size_t , n)
126
+ DEFINE_GETTER(IDSelectorBitmap, const uint8_t *, bitmap)
127
+
128
+ int faiss_IDSelectorBitmap_new(
129
+ FaissIDSelectorBitmap** p_sel,
130
+ size_t n,
131
+ const uint8_t * bitmap) {
132
+ try {
133
+ *p_sel = reinterpret_cast <FaissIDSelectorBitmap*>(
134
+ new IDSelectorBitmap (n, bitmap));
135
+ return 0 ;
136
+ }
137
+ CATCH_AND_HANDLE
138
+ }
139
+
122
140
int faiss_IDSelectorNot_new (
123
141
FaissIDSelectorNot** p_sel,
124
142
const FaissIDSelector* sel) {
Original file line number Diff line number Diff line change @@ -81,6 +81,17 @@ int faiss_IDSelectorBatch_new(
81
81
size_t n ,
82
82
const idx_t * indices );
83
83
84
+ FAISS_DECLARE_CLASS (IDSelectorBitmap )
85
+ FAISS_DECLARE_DESTRUCTOR (IDSelectorBitmap )
86
+
87
+ FAISS_DECLARE_GETTER (IDSelectorBitmap , size_t , n )
88
+ FAISS_DECLARE_GETTER (IDSelectorBitmap , const uint8_t * , bitmap )
89
+
90
+ int faiss_IDSelectorBitmap_new (
91
+ FaissIDSelectorBitmap * * p_sel ,
92
+ size_t n ,
93
+ const uint8_t * bitmap );
94
+
84
95
FAISS_DECLARE_CLASS (IDSelectorNot )
85
96
int faiss_IDSelectorNot_new (
86
97
FaissIDSelectorNot * * p_sel ,
You can’t perform that action at this time.
0 commit comments