usearch 2.6.0 → 2.6.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -418,6 +418,13 @@ jobs:
418
418
  verbose: true
419
419
  print-hash: true
420
420
 
421
+ - name: Publish to Anaconda
422
+ run: |
423
+ pip install anaconda-client
424
+ export ANACONDA_API_TOKEN=${{ secrets.ANACONDA_API_TOKEN }}
425
+ anaconda login --token $ANACONDA_API_TOKEN
426
+ anaconda upload -u unum-cloud ./dist/artifact/*.tar.bz2
427
+
421
428
  publish_javascript:
422
429
  name: Publish JavaScript
423
430
  needs: versioning
package/CITATION.cff CHANGED
@@ -5,7 +5,7 @@ authors:
5
5
  given-names: "Ash"
6
6
  orcid: "https://orcid.org/0000-0002-4882-1815"
7
7
  title: "USearch by Unum Cloud"
8
- version: 2.6.0
8
+ version: 2.6.1
9
9
  doi: 10.5281/zenodo.7949416
10
10
  date-released: 2022-06-12
11
11
  url: "https://github.com/unum-cloud/usearch"
package/Cargo.toml CHANGED
@@ -1,6 +1,6 @@
1
1
  [package]
2
2
  name = "usearch"
3
- version = "2.6.0"
3
+ version = "2.6.1"
4
4
  authors = ["Ash Vardanian <1983160+ashvardanian@users.noreply.github.com>"]
5
5
  description = "Smaller & Faster Single-File Vector Search Engine from Unum"
6
6
  edition = "2021"
package/README.md CHANGED
@@ -392,7 +392,7 @@ doi = {10.5281/zenodo.7949416},
392
392
  author = {Vardanian, Ash},
393
393
  title = {{USearch by Unum Cloud}},
394
394
  url = {https://github.com/unum-cloud/usearch},
395
- version = {2.6.0},
395
+ version = {2.6.1},
396
396
  year = {2022},
397
397
  month = jun,
398
398
  }
package/conanfile.py CHANGED
@@ -7,7 +7,7 @@ required_conan_version = ">=1.53.0"
7
7
  class USearchConan(ConanFile):
8
8
 
9
9
  name = "usearch"
10
- version = '2.6.0'
10
+ version = '2.6.1'
11
11
  license = "Apache-2.0"
12
12
  description = "Smaller & Faster Single-File Vector Search Engine from Unum"
13
13
  homepage = "https://github.com/unum-cloud/usearch"
package/cpp/README.md CHANGED
@@ -2,8 +2,8 @@
2
2
 
3
3
  ## Installation
4
4
 
5
- To use in a C++ project simply copy the `include/usearch/index.hpp` header into your project.
6
- Alternatively fetch it with CMake:
5
+ To use in a C++ project, copy the `include/usearch/*` headers into your project.
6
+ Alternatively, fetch it with CMake:
7
7
 
8
8
  ```cmake
9
9
  FetchContent_Declare(usearch GIT_REPOSITORY https://github.com/unum-cloud/usearch.git)
@@ -12,13 +12,17 @@ FetchContent_MakeAvailable(usearch)
12
12
 
13
13
  ## Quickstart
14
14
 
15
- Once included, the low-level C++11 interface is as simple as it gets: `reserve()`, `add()`, `search()`, `size()`, `capacity()`, `save()`, `load()`, `view()`.
16
- This covers 90% of use-cases.
15
+ Once included, the high-level C++11 interface is as simple as it gets: `reserve()`, `add()`, `search()`, `size()`, `capacity()`, `save()`, `load()`, `view()`.
16
+ This covers 90% of use cases.
17
17
 
18
- ```c++
18
+ ```cpp
19
19
  using namespace unum::usearch;
20
20
 
21
- index_gt<metric_cos_gt<float>> index;
21
+ metric_punned_t metric(256, metric_kind_t::l2sq_k, scalar_kind_t::f32_k);
22
+
23
+ // If you plan to store more than 4 Billion entries - use `index_dense_big_t`.
24
+ // Or directly instantiate the template variant you need - `index_dense_gt<key_t, internal_id_t>`.
25
+ index_dense_t index = index_dense_t::make(metric);
22
26
  float vec[3] = {0.1, 0.3, 0.2};
23
27
 
24
28
  index.reserve(10);
@@ -30,10 +34,19 @@ for (std::size_t i = 0; i != results.size(); ++i)
30
34
  ```
31
35
 
32
36
  The `add` is thread-safe for concurrent index construction.
37
+ It also has an overload for different vector types, casting them under the hood.
38
+ The same applies to the `search`, `get`, `cluster`, and `distance_between` functions.
39
+
40
+ ```cpp
41
+ double vec_double[3] = {0.1, 0.3, 0.2};
42
+ _Float16 vec_half[3] = {0.1, 0.3, 0.2};
43
+ index.add(43, {&vec_double[0], 3});
44
+ index.add(44, {&vec_half[0], 3});
45
+ ```
33
46
 
34
47
  ## Serialization
35
48
 
36
- ```c++
49
+ ```cpp
37
50
  index.save("index.usearch");
38
51
  index.load("index.usearch"); // Copying from disk
39
52
  index.view("index.usearch"); // Memory-mapping from disk
@@ -44,23 +57,14 @@ index.view("index.usearch"); // Memory-mapping from disk
44
57
  For advanced users, more compile-time abstractions are available.
45
58
 
46
59
  ```cpp
47
- template <typename metric_at = metric_ip_gt<float>, //
48
- typename key_at = std::size_t, // `uint32_t`, `uuid_t`...
49
- typename id_at = std::uint32_t, // `uint40_t`, `uint64_t`...
50
- typename scalar_at = float, // `double`, `half`, `char`...
51
- typename allocator_at = std::allocator<char>> //
60
+ template <typename distance_at = default_distance_t, // `float`
61
+ typename key_at = default_key_t, // `int64_t`, `uuid_t`
62
+ typename compressed_slot_at = default_slot_t, // `uint32_t`, `uint40_t`
63
+ typename dynamic_allocator_at = std::allocator<byte_t>, //
64
+ typename tape_allocator_at = dynamic_allocator_at> //
52
65
  class index_gt;
53
66
  ```
54
67
 
55
- You may want to use a custom memory allocator or a rare scalar type, but most often, you would start by defining a custom similarity measure.
56
- The function object should have the following signature to support different-length vectors.
57
-
58
- ```cpp
59
- struct custom_metric_t {
60
- T operator()(T const* a, T const* b, std::size_t a_length, std::size_t b_length) const;
61
- };
62
- ```
63
-
64
68
  The following distances are pre-packaged:
65
69
 
66
70
  - `metric_cos_gt<scalar_t>` for "Cosine" or "Angular" distance.
@@ -81,7 +85,7 @@ Instead of spawning additional threads within USearch, we focus on the thread sa
81
85
  ```cpp
82
86
  #pragma omp parallel for
83
87
  for (std::size_t i = 0; i < n; ++i)
84
- native.add(key, span_t{vector, dims}, index_update_config_t { .thread = omp_get_thread_num() });
88
+ native.add(key, span_t{vector, dims});
85
89
  ```
86
90
 
87
91
  During initialization, we allocate enough temporary memory for all the cores on the machine.
@@ -1,7 +1,7 @@
1
1
  <?xml version="1.0" encoding="utf-8"?>
2
2
  <Project>
3
3
  <PropertyGroup>
4
- <Version Condition="'$(Version)' == ''">2.6.0</Version>
4
+ <Version Condition="'$(Version)' == ''">2.6.1</Version>
5
5
 
6
6
  <Authors>Unum</Authors>
7
7
  <Company>Unum</Company>
@@ -11,7 +11,7 @@
11
11
 
12
12
  #define USEARCH_VERSION_MAJOR 2
13
13
  #define USEARCH_VERSION_MINOR 6
14
- #define USEARCH_VERSION_PATCH 0
14
+ #define USEARCH_VERSION_PATCH 1
15
15
 
16
16
  // Inferring C++ version
17
17
  // https://stackoverflow.com/a/61552074
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "usearch",
3
- "version": "2.6.0",
3
+ "version": "2.6.1",
4
4
  "description": "Smaller & Faster Single-File Vector Search Engine from Unum",
5
5
  "author": "Ash Vardanian",
6
6
  "license": "Apache 2.0",
package/wasmer.toml CHANGED
@@ -1,6 +1,6 @@
1
1
  [package]
2
2
  name="unum/usearch"
3
- version="2.6.0"
3
+ version="2.6.1"
4
4
  description="Smaller & Faster Single-File Vector Search Engine from Unum"
5
5
  license="Apache-2.0"
6
6
  readme="README.md"