Skip to content

Commit

Permalink
Merge branch 'OrkhanHI-master'
Browse files Browse the repository at this point in the history
  • Loading branch information
masajiro committed Sep 23, 2020
2 parents 0fdea34 + 78435eb commit a88a681
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 2 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.12.1
1.12.2
21 changes: 21 additions & 0 deletions python/README-ngtpy-jp.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,27 @@ Class Index
**Returns**
なし。

### export_index
インデックスをエクスポートします。

export_index(self: ngtpy.Index, path: str)

**path**
エクスポートで保存されるパスを指定します。

**Returns**
なし。

### import_index
インデックスをインポートします。

import_index(self: ngtpy.Index, path: str)

**path**
インポートするパスを指定します。

**Returns**
なし。

FUNCTIONS
=========
Expand Down
22 changes: 22 additions & 0 deletions python/README-ngtpy.md
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,28 @@ Specify the search radius. The default is infinity.
**Returns**
None.

### export_index
Exports the index to a file.

export_index(self: ngtpy.Index, path: str)

**path**
Path to file in which the exported index will be stored.

**Returns**
None.

### import_index
Imports the index from a file

import_index(self: ngtpy.Index, path: str)

**path**
Path to file from which to load the index.

**Returns**
None.


FUNCTIONS
=========
Expand Down
6 changes: 5 additions & 1 deletion python/src/ngtpy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,11 @@ PYBIND11_MODULE(ngtpy, m) {
py::arg("batch_size") = 10000)
.def("set", &::Index::set,
py::arg("num_of_search_objects") = 0,
py::arg("search_radius") = -1.0);
py::arg("search_radius") = -1.0)
.def("export_index", (void (NGT::Index::*)(const std::string&)) &NGT::Index::exportIndex,
py::arg("path"))
.def("import_index", (void (NGT::Index::*)(const std::string&)) &NGT::Index::importIndex,
py::arg("path"));


py::class_<Optimizer>(m, "Optimizer")
Expand Down

0 comments on commit a88a681

Please sign in to comment.