MCPcopy Create free account
hub / github.com/VectorDB-NTU/RaBitQ-Library / dot_product

Function dot_product

include/rabitqlib/utils/space.hpp:152–156  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

150 const int* __restrict__ binary_code, T* __restrict__ compact_code, size_t length
151) {
152 constexpr size_t kTypeBits = sizeof(T) * 8;
153 auto* output = reinterpret_cast<uint8_t*>(compact_code);
154
155 for (size_t i = 0; i < length; i += kTypeBits) {
156 T cur = 0;
157 for (size_t j = 0; j < kTypeBits; ++j) {
158 cur |= (static_cast<T>(binary_code[i + j]) << (kTypeBits - 1 - j));
159 }

Callers 1

search_knnMethod · 0.85

Calls 1

dotMethod · 0.45

Tested by

no test coverage detected