Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions c_api/IndexFlat_c.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,11 @@ int faiss_IndexRefineFlat_new(
DEFINE_DESTRUCTOR(IndexRefineFlat)
DEFINE_INDEX_DOWNCAST(IndexRefineFlat)

FaissIndex* faiss_IndexRefineFlat_base_index(FaissIndexRefineFlat* index) {
return reinterpret_cast<FaissIndex*>(
reinterpret_cast<faiss::IndexRefineFlat*>(index)->base_index);
}

DEFINE_GETTER(IndexRefineFlat, int, own_fields)
DEFINE_SETTER(IndexRefineFlat, int, own_fields)

Expand Down
4 changes: 4 additions & 0 deletions c_api/IndexFlat_c.h
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,10 @@ int faiss_IndexRefineFlat_new(
FAISS_DECLARE_DESTRUCTOR(IndexRefineFlat)
FAISS_DECLARE_INDEX_DOWNCAST(IndexRefineFlat)

/// Get a pointer to the base index.
/// The returned pointer is borrowed, do not free.
FaissIndex* faiss_IndexRefineFlat_base_index(FaissIndexRefineFlat* index);

FAISS_DECLARE_GETTER_SETTER(IndexRefineFlat, int, own_fields)

/// factor between k requested in search and the k requested from
Expand Down
Loading