usearch 1.1.0 → 1.2.0

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.
Files changed (71) hide show
  1. package/.github/workflows/prerelease.yml +3 -3
  2. package/.github/workflows/release.yml +3 -3
  3. package/.github/workflows/update_version.sh +1 -1
  4. package/.gitmodules +1 -4
  5. package/Cargo.toml +1 -1
  6. package/Package.swift +2 -1
  7. package/README.md +129 -46
  8. package/binding.gyp +16 -12
  9. package/build.gradle +1 -1
  10. package/build.rs +0 -1
  11. package/c/CMakeLists.txt +11 -7
  12. package/c/lib.cpp +36 -24
  13. package/c/usearch.h +42 -12
  14. package/cluster.ipynb +167 -0
  15. package/conanfile.py +1 -1
  16. package/cpp/CMakeLists.txt +8 -3
  17. package/cpp/bench.cpp +2 -2
  18. package/cpp/test.cpp +42 -25
  19. package/docs/benchmarks.md +8 -0
  20. package/docs/compilation.md +7 -7
  21. package/docs/conf.py +27 -24
  22. package/docs/javascript/reference.rst +3 -0
  23. package/docs/wolfram/index.rst +6 -0
  24. package/golang/README.md +31 -7
  25. package/golang/lib.go +1 -1
  26. package/include/usearch/index.hpp +348 -69
  27. package/include/usearch/index_dense.hpp +587 -179
  28. package/include/usearch/index_plugins.hpp +194 -16
  29. package/java/cloud/unum/usearch/Index.java +13 -0
  30. package/java/cloud/unum/usearch/cloud_unum_usearch_Index.cpp +40 -9
  31. package/java/cloud/unum/usearch/cloud_unum_usearch_Index.h +16 -0
  32. package/javascript/docs.js +111 -0
  33. package/javascript/lib.cpp +29 -9
  34. package/javascript/usearch.d.ts +9 -1
  35. package/objc/USearchObjective.mm +11 -11
  36. package/package.json +2 -2
  37. package/pyproject.toml +1 -1
  38. package/python/lib.cpp +492 -159
  39. package/python/scripts/index_faiss.py +3 -3
  40. package/python/scripts/join.py +6 -6
  41. package/python/scripts/test_index.py +219 -0
  42. package/python/scripts/test_sparse.py +21 -21
  43. package/python/scripts/test_tooling.py +111 -0
  44. package/python/usearch/eval.py +9 -5
  45. package/python/usearch/index.py +491 -216
  46. package/rust/lib.cpp +6 -24
  47. package/rust/lib.hpp +1 -3
  48. package/rust/lib.rs +89 -0
  49. package/setup.py +5 -6
  50. package/wasm/CMakeLists.txt +0 -1
  51. package/wasmer.toml +1 -1
  52. package/python/scripts/test.py +0 -364
  53. package/robin-map/.codecov.yml +0 -5
  54. package/robin-map/.github/workflows/ci.yml +0 -136
  55. package/robin-map/CMakeLists.txt +0 -86
  56. package/robin-map/LICENSE +0 -21
  57. package/robin-map/README.md +0 -483
  58. package/robin-map/cmake/tsl-robin-mapConfig.cmake.in +0 -9
  59. package/robin-map/doxygen.conf +0 -2483
  60. package/robin-map/include/tsl/robin_growth_policy.h +0 -406
  61. package/robin-map/include/tsl/robin_hash.h +0 -1639
  62. package/robin-map/include/tsl/robin_map.h +0 -807
  63. package/robin-map/include/tsl/robin_set.h +0 -660
  64. package/robin-map/tests/CMakeLists.txt +0 -26
  65. package/robin-map/tests/custom_allocator_tests.cpp +0 -138
  66. package/robin-map/tests/main.cpp +0 -26
  67. package/robin-map/tests/policy_tests.cpp +0 -97
  68. package/robin-map/tests/robin_map_tests.cpp +0 -1451
  69. package/robin-map/tests/robin_set_tests.cpp +0 -164
  70. package/robin-map/tests/utils.h +0 -443
  71. package/robin-map/tsl-robin-map.natvis +0 -78
@@ -1,136 +0,0 @@
1
- name: CI
2
-
3
- on: [push, pull_request, release]
4
-
5
- jobs:
6
- build:
7
- strategy:
8
- fail-fast: false
9
- matrix:
10
- config:
11
- - {
12
- name: linux-x64-gcc-7,
13
- os: ubuntu-18.04,
14
- cxx: g++-7,
15
- cmake-build-type: Release
16
- }
17
- - {
18
- name: linux-x64-gcc-7-no-exceptions,
19
- os: ubuntu-18.04,
20
- cxx: g++-7,
21
- cxx-flags: -fno-exceptions,
22
- cmake-build-type: Release
23
- }
24
- - {
25
- name: linux-x64-clang-9,
26
- os: ubuntu-18.04,
27
- cxx: clang++-9,
28
- cmake-build-type: Release
29
- }
30
- - {
31
- name: macos-x64-gcc,
32
- os: macos-10.15,
33
- cxx: g++,
34
- cmake-build-type: Release
35
- }
36
- - {
37
- name: macos-x64-clang,
38
- os: macos-10.15,
39
- cxx: clang++,
40
- cmake-build-type: Release
41
- }
42
- - {
43
- name: linux-x64-clang-12-sanitize,
44
- os: ubuntu-20.04,
45
- cxx: clang++-12,
46
- cxx-flags: "-fsanitize=address,undefined",
47
- cmake-build-type: Release
48
- }
49
- - {
50
- name: linux-x64-gcc-10-coverage,
51
- os: ubuntu-20.04,
52
- cxx: g++-10,
53
- cxx-flags: --coverage,
54
- gcov-tool: gcov-10,
55
- cmake-build-type: Debug
56
- }
57
- - {
58
- name: windows-x64-vs-2019,
59
- os: windows-2019,
60
- cmake-build-type: Release,
61
- cmake-generator: Visual Studio 16 2019,
62
- cmake-platform: x64,
63
- vcpkg-triplet: x64-windows-static-md
64
- }
65
- - {
66
- name: windows-x86-vs-2019,
67
- os: windows-2019,
68
- cmake-build-type: Release,
69
- cmake-generator: Visual Studio 16 2019,
70
- cmake-platform: Win32,
71
- vcpkg-triplet: x86-windows-static-md
72
- }
73
- - {
74
- name: windows-x64-vs-2022,
75
- os: windows-2022,
76
- cmake-build-type: Release,
77
- cmake-generator: Visual Studio 17 2022,
78
- cmake-platform: x64,
79
- vcpkg-triplet: x64-windows-static-md
80
- }
81
- - {
82
- name: windows-x86-vs-2022,
83
- os: windows-2022,
84
- cmake-build-type: Release,
85
- cmake-generator: Visual Studio 17 2022,
86
- cmake-platform: Win32,
87
- vcpkg-triplet: x86-windows-static-md
88
- }
89
- name: ${{matrix.config.name}}
90
- runs-on: ${{matrix.config.os}}
91
- steps:
92
- - uses: actions/checkout@v2
93
-
94
- # Windows
95
- - name: Install boost (Windows)
96
- run: vcpkg install boost-test:${{matrix.config.vcpkg-triplet}}
97
- if: runner.os == 'Windows'
98
-
99
- - name: Configure CMake (Windows)
100
- run: cmake -G "${{matrix.config.cmake-generator}}" -A ${{matrix.config.cmake-platform}} -DCMAKE_BUILD_TYPE=${{matrix.config.cmake-build-type}} -DCMAKE_TOOLCHAIN_FILE="$env:VCPKG_INSTALLATION_ROOT/scripts/buildsystems/vcpkg.cmake" -DVCPKG_TARGET_TRIPLET=${{matrix.config.vcpkg-triplet}} -S ${{github.workspace}}/tests -B ${{github.workspace}}/build
101
- if: runner.os == 'Windows'
102
-
103
- - name: Build (Windows)
104
- run: cmake --build ${{github.workspace}}/build --config ${{matrix.config.cmake-build-type}} --verbose
105
- if: runner.os == 'Windows'
106
-
107
- - name: Test (Windows)
108
- run: ${{github.workspace}}/build/${{matrix.config.cmake-build-type}}/tsl_robin_map_tests.exe
109
- if: runner.os == 'Windows'
110
-
111
- # Linux or macOS
112
- - name: Install boost (Linux or macOS)
113
- run: vcpkg install boost-test
114
- if: runner.os == 'Linux' || runner.os == 'macOS'
115
-
116
- - name: Configure CMake (Linux or macOS)
117
- run: cmake -DCMAKE_BUILD_TYPE=${{matrix.config.cmake-build-type}} -DCMAKE_TOOLCHAIN_FILE="$VCPKG_INSTALLATION_ROOT/scripts/buildsystems/vcpkg.cmake" -S ${{github.workspace}}/tests -B ${{github.workspace}}/build
118
- env:
119
- CXX: ${{matrix.config.cxx}}
120
- CXXFLAGS: ${{matrix.config.cxx-flags}}
121
- if: runner.os == 'Linux' || runner.os == 'macOS'
122
-
123
- - name: Build (Linux or macOS)
124
- run: cmake --build ${{github.workspace}}/build --verbose
125
- if: runner.os == 'Linux' || runner.os == 'macOS'
126
-
127
- - name: Test (Linux or macOS)
128
- run: ${{github.workspace}}/build/tsl_robin_map_tests
129
- if: runner.os == 'Linux' || runner.os == 'macOS'
130
-
131
- - name: Coverage
132
- run: |
133
- sudo apt-get install -y lcov
134
- lcov -c -b ${{github.workspace}}/include -d ${{github.workspace}}/build -o ${{github.workspace}}/coverage.info --no-external --gcov-tool ${{matrix.config.gcov-tool}}
135
- bash <(curl -s https://codecov.io/bash) -f ${{github.workspace}}/coverage.info
136
- if: ${{matrix.config.name == 'linux-x64-gcc-10-coverage'}}
@@ -1,86 +0,0 @@
1
- cmake_minimum_required(VERSION 3.3)
2
-
3
- project(tsl-robin-map VERSION 1.2.1 LANGUAGES CXX)
4
-
5
- include(GNUInstallDirs)
6
-
7
-
8
- add_library(robin_map INTERFACE)
9
- # Use tsl::robin_map as target, more consistent with other libraries conventions (Boost, Qt, ...)
10
- add_library(tsl::robin_map ALIAS robin_map)
11
-
12
- target_include_directories(robin_map INTERFACE
13
- "$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>"
14
- "$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>")
15
-
16
- list(APPEND headers "${CMAKE_CURRENT_SOURCE_DIR}/include/tsl/robin_growth_policy.h"
17
- "${CMAKE_CURRENT_SOURCE_DIR}/include/tsl/robin_hash.h"
18
- "${CMAKE_CURRENT_SOURCE_DIR}/include/tsl/robin_map.h"
19
- "${CMAKE_CURRENT_SOURCE_DIR}/include/tsl/robin_set.h")
20
- target_sources(robin_map INTERFACE "$<BUILD_INTERFACE:${headers}>")
21
-
22
- if(MSVC)
23
- target_sources(robin_map INTERFACE
24
- "$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/tsl-robin-map.natvis>"
25
- "$<INSTALL_INTERFACE:${CMAKE_INSTALL_DATAROOTDIR}/tsl-robin-map.natvis>")
26
- endif()
27
-
28
-
29
-
30
-
31
- set(IS_SUBPROJECT TRUE)
32
- if(CMAKE_SOURCE_DIR STREQUAL PROJECT_SOURCE_DIR)
33
- set(IS_SUBPROJECT FALSE)
34
- endif()
35
-
36
- # Installation
37
- if(NOT IS_SUBPROJECT)
38
- include(CMakePackageConfigHelpers)
39
-
40
- ## Install include directory and potential natvis file
41
- install(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/include/tsl"
42
- DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}")
43
-
44
- if(MSVC)
45
- install(FILES "${CMAKE_CURRENT_SOURCE_DIR}/tsl-robin-map.natvis"
46
- DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}")
47
- endif()
48
-
49
-
50
-
51
- ## Create and install tsl-robin-mapConfig.cmake
52
- configure_package_config_file("${CMAKE_CURRENT_SOURCE_DIR}/cmake/tsl-robin-mapConfig.cmake.in"
53
- "${CMAKE_CURRENT_BINARY_DIR}/tsl-robin-mapConfig.cmake"
54
- INSTALL_DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/cmake/tsl-robin-map")
55
-
56
- install(FILES "${CMAKE_CURRENT_BINARY_DIR}/tsl-robin-mapConfig.cmake"
57
- DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/cmake/tsl-robin-map")
58
-
59
-
60
- ## Create local tsl-robin-mapTargets.cmake
61
- export(TARGETS robin_map NAMESPACE tsl:: FILE "${CMAKE_CURRENT_BINARY_DIR}/tsl-robin-mapTargets.cmake")
62
-
63
- ## Create and install global tsl-robin-mapTargets.cmake
64
- install(TARGETS robin_map
65
- EXPORT tsl-robin-mapTargets)
66
-
67
- install(EXPORT tsl-robin-mapTargets
68
- NAMESPACE tsl::
69
- DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/cmake/tsl-robin-map")
70
-
71
-
72
-
73
- ## Create and install tsl-robin-mapConfigVersion.cmake
74
- # tsl-robin-map is header-only and does not depend on the architecture.
75
- # Remove CMAKE_SIZEOF_VOID_P from tsl-robin-mapConfigVersion.cmake so that a
76
- # tsl-robin-mapConfig.cmake generated for a 64 bit target can be used for 32 bit
77
- # targets and vice versa.
78
- set(CMAKE_SIZEOF_VOID_P_BACKUP ${CMAKE_SIZEOF_VOID_P})
79
- unset(CMAKE_SIZEOF_VOID_P)
80
- write_basic_package_version_file("${CMAKE_CURRENT_BINARY_DIR}/tsl-robin-mapConfigVersion.cmake"
81
- COMPATIBILITY SameMajorVersion)
82
- set(CMAKE_SIZEOF_VOID_P ${CMAKE_SIZEOF_VOID_P_BACKUP})
83
-
84
- install(FILES "${CMAKE_CURRENT_BINARY_DIR}/tsl-robin-mapConfigVersion.cmake"
85
- DESTINATION "${CMAKE_INSTALL_DATAROOTDIR}/cmake/tsl-robin-map")
86
- endif()
package/robin-map/LICENSE DELETED
@@ -1,21 +0,0 @@
1
- MIT License
2
-
3
- Copyright (c) 2017 Thibaut Goetghebuer-Planchon <tessil@gmx.com>
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.