XVector
xvec_ivf_rabitq_index.hpp
Go to the documentation of this file.
1 /*
2  Copyright (c) 2026 XCENA Inc.
3 
4  Licensed under the Apache License, Version 2.0 (the "License");
5  you may not use this file except in compliance with the License.
6  You may obtain a copy of the License at
7 
8  http://www.apache.org/licenses/LICENSE-2.0
9 
10  Unless required by applicable law or agreed to in writing, software
11  distributed under the License is distributed on an "AS IS" BASIS,
12  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  See the License for the specific language governing permissions and
14  limitations under the License.
15 */
16 
34 #pragma once
35 
36 #ifdef __cplusplus
37 
38 #include <string>
39 
41 
43 #include "xvector/xvec_types.h"
44 
45 namespace xvec
46 {
47 
59 {
60 public:
67  static IvfRaBitQIndex fromFaissFile(xvecExecutionContextTag* context, const std::string& path);
68 
77  static IvfRaBitQIndex fromDescriptor(xvecExecutionContextTag* context,
78  const xvecIvfRaBitQDescriptor& descriptor);
79 
80  virtual ~IvfRaBitQIndex();
81 
82  IvfRaBitQIndex(IvfRaBitQIndex&& other) noexcept;
84 
85  IvfRaBitQIndex(const IvfRaBitQIndex&) = delete;
87 
91  xvecIvfRaBitQIndexTag* handle() const noexcept;
92 
93 private:
94  IvfRaBitQIndex(xvecExecutionContextTag* context, xvecIvfRaBitQIndexTag* handle);
95 
96  xvecExecutionContextTag* context_ = nullptr;
97  xvecIvfRaBitQIndexTag* handle_ = nullptr;
98 };
99 
100 } // namespace xvec
101 
102 #endif // __cplusplus
RAII wrapper for xvecIvfRaBitQIndexTag.
IvfRaBitQIndex & operator=(const IvfRaBitQIndex &)=delete
IvfRaBitQIndex(IvfRaBitQIndex &&other) noexcept
xvecIvfRaBitQIndexTag * handle() const noexcept
Get the underlying C API handle.
IvfRaBitQIndex & operator=(IvfRaBitQIndex &&other) noexcept
virtual ~IvfRaBitQIndex()
static IvfRaBitQIndex fromDescriptor(xvecExecutionContextTag *context, const xvecIvfRaBitQDescriptor &descriptor)
Load an IVF-RaBitQ index from a FAISS-free descriptor.
IvfRaBitQIndex(const IvfRaBitQIndex &)=delete
static IvfRaBitQIndex fromFaissFile(xvecExecutionContextTag *context, const std::string &path)
Load an IVF-RaBitQ index from a Faiss file.
FAISS-free description of an IVF-RaBitQ index.
Exception types for C++ XVECTOR wrappers.
IVF-RaBitQ (Inverted File with Random Bit Quantization) index interface.
Core types, enums, and structures for the XVector library.