usearch 2.16.1 → 2.16.3
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.
- package/README.md +2 -2
- package/c/lib.cpp +1 -1
- package/include/usearch/index.hpp +1 -1
- package/include/usearch/index_plugins.hpp +11 -7
- package/package.json +1 -1
- package/prebuilds/darwin-arm64+x64/usearch.node +0 -0
- package/prebuilds/linux-arm64/usearch.node +0 -0
- package/prebuilds/linux-x64/usearch.node +0 -0
package/README.md
CHANGED
|
@@ -52,7 +52,7 @@ Linux • MacOS • Windows • iOS • Android • WebAssembly •
|
|
|
52
52
|
- ✅ [Trusted](#integrations) by giants like Google and DBs like [ClickHouse][clickhouse-docs] & [DuckDB][duckdb-docs].
|
|
53
53
|
- ✅ [SIMD][simd]-optimized and [user-defined metrics](#user-defined-functions) with JIT compilation.
|
|
54
54
|
- ✅ Hardware-agnostic `f16` & `i8` - [half-precision & quarter-precision support](#memory-efficiency-downcasting-and-quantization).
|
|
55
|
-
- ✅ [View large indexes from disk](#serving-index-from-disk) without loading into RAM.
|
|
55
|
+
- ✅ [View large indexes from disk](#serialization--serving-index-from-disk) without loading into RAM.
|
|
56
56
|
- ✅ Heterogeneous lookups, renaming/relabeling, and on-the-fly deletions.
|
|
57
57
|
- ✅ Binary Tanimoto and Sorensen coefficients for [Genomics and Chemistry applications](#usearch--rdkit--molecular-search).
|
|
58
58
|
- ✅ Space-efficient point-clouds with `uint40_t`, accommodating 4B+ size.
|
|
@@ -544,7 +544,7 @@ doi = {10.5281/zenodo.7949416},
|
|
|
544
544
|
author = {Vardanian, Ash},
|
|
545
545
|
title = {{USearch by Unum Cloud}},
|
|
546
546
|
url = {https://github.com/unum-cloud/usearch},
|
|
547
|
-
version = {2.16.
|
|
547
|
+
version = {2.16.3},
|
|
548
548
|
year = {2023},
|
|
549
549
|
month = oct,
|
|
550
550
|
}
|
package/c/lib.cpp
CHANGED
|
@@ -354,7 +354,7 @@ USEARCH_EXPORT void usearch_change_metric(usearch_index_t index, usearch_metric_
|
|
|
354
354
|
USEARCH_ASSERT(index && error && "Missing arguments");
|
|
355
355
|
auto& index_dense = *reinterpret_cast<index_dense_t*>(index);
|
|
356
356
|
auto metric_punned =
|
|
357
|
-
state ? metric_punned_t::stateful(reinterpret_cast<std::uintptr_t>(metric),
|
|
357
|
+
state ? metric_punned_t::stateful(index_dense.dimensions(), reinterpret_cast<std::uintptr_t>(metric),
|
|
358
358
|
reinterpret_cast<std::uintptr_t>(state), metric_kind_to_cpp(kind),
|
|
359
359
|
index_dense.scalar_kind())
|
|
360
360
|
: metric_punned_t::stateless(index_dense.dimensions(), reinterpret_cast<std::uintptr_t>(metric),
|
|
@@ -1276,7 +1276,7 @@ struct casts_punned_t {
|
|
|
1276
1276
|
* > warning: loop not vectorized: the optimizer was unable to perform the requested transformation;
|
|
1277
1277
|
* > the transformation might be disabled or specified as part of an unsupported transformation ordering
|
|
1278
1278
|
*/
|
|
1279
|
-
#if defined(
|
|
1279
|
+
#if defined(USEARCH_DEFINED_CLANG)
|
|
1280
1280
|
#pragma clang diagnostic push
|
|
1281
1281
|
#pragma clang diagnostic ignored "-Wpass-failed"
|
|
1282
1282
|
#endif
|
|
@@ -1767,20 +1767,22 @@ class metric_punned_t {
|
|
|
1767
1767
|
* @brief Creates a metric using the provided function pointer for a stateful metric.
|
|
1768
1768
|
* The third argument is the state that will be passed to the metric function.
|
|
1769
1769
|
*
|
|
1770
|
+
* @param dimensions The number of elements in the input arrays.
|
|
1770
1771
|
* @param metric_uintptr The function pointer to the metric function.
|
|
1771
1772
|
* @param metric_state The state to pass to the metric function.
|
|
1772
1773
|
* @param metric_kind The kind of metric to use.
|
|
1773
1774
|
* @param scalar_kind The kind of scalar to use.
|
|
1774
1775
|
* @return A metric object that can be used to compute distances between vectors.
|
|
1775
1776
|
*/
|
|
1776
|
-
inline static metric_punned_t stateful(
|
|
1777
|
-
|
|
1778
|
-
|
|
1777
|
+
inline static metric_punned_t stateful( //
|
|
1778
|
+
std::size_t dimensions, std::uintptr_t metric_uintptr, std::uintptr_t metric_state,
|
|
1779
|
+
metric_kind_t metric_kind = metric_kind_t::unknown_k,
|
|
1780
|
+
scalar_kind_t scalar_kind = scalar_kind_t::unknown_k) noexcept {
|
|
1779
1781
|
metric_punned_t metric;
|
|
1780
1782
|
metric.metric_routed_ = &metric_punned_t::invoke_array_array_third;
|
|
1781
1783
|
metric.metric_ptr_ = metric_uintptr;
|
|
1782
1784
|
metric.metric_third_arg_ = metric_state;
|
|
1783
|
-
metric.dimensions_ =
|
|
1785
|
+
metric.dimensions_ = dimensions;
|
|
1784
1786
|
metric.metric_kind_ = metric_kind;
|
|
1785
1787
|
metric.scalar_kind_ = scalar_kind;
|
|
1786
1788
|
return metric;
|
|
@@ -1990,7 +1992,7 @@ class metric_punned_t {
|
|
|
1990
1992
|
};
|
|
1991
1993
|
|
|
1992
1994
|
/* Allow complaining about vectorization after this point. */
|
|
1993
|
-
#if defined(
|
|
1995
|
+
#if defined(USEARCH_DEFINED_CLANG)
|
|
1994
1996
|
#pragma clang diagnostic pop
|
|
1995
1997
|
#endif
|
|
1996
1998
|
|
|
@@ -2223,6 +2225,8 @@ template <typename allocator_at = std::allocator<char>> class kmeans_clustering_
|
|
|
2223
2225
|
scalar_kind_t original_scalar_kind, std::size_t dimensions, executor_at&& executor = executor_at{},
|
|
2224
2226
|
progress_at&& progress = progress_at{}) {
|
|
2225
2227
|
|
|
2228
|
+
(void)progress; // TODO
|
|
2229
|
+
|
|
2226
2230
|
// Perform sanity checks for algorithm settings.
|
|
2227
2231
|
kmeans_clustering_result_t result;
|
|
2228
2232
|
if (max_iterations < 1)
|
|
@@ -2332,7 +2336,7 @@ template <typename allocator_at = std::allocator<char>> class kmeans_clustering_
|
|
|
2332
2336
|
|
|
2333
2337
|
// For every point, find the closest centroid.
|
|
2334
2338
|
std::atomic<std::size_t> points_shifted{0};
|
|
2335
|
-
executor.dynamic(points_count, [&](std::size_t
|
|
2339
|
+
executor.dynamic(points_count, [&](std::size_t, std::size_t points_idx) {
|
|
2336
2340
|
byte_t const* quantized_point =
|
|
2337
2341
|
points_quantized_buffer.data() + points_idx * stride_per_vector_quantized;
|
|
2338
2342
|
byte_t const* quantized_centroids = centroids_quantized_buffer.data();
|
package/package.json
CHANGED
|
Binary file
|
|
Binary file
|
|
Binary file
|