Signet Forge 0.1.0
C++20 Parquet library with AI-native extensions
DEMO
Loading...
Searching...
No Matches
vector_type.hpp File Reference

AI-native ML vector column type: VectorWriter/VectorReader for dense float embedding storage as FIXED_LEN_BYTE_ARRAY Parquet columns, plus SIMD-accelerated dot product, L2 distance, normalization, and copy. More...

#include "signet/types.hpp"
#include "signet/error.hpp"
#include "signet/schema.hpp"
#include <cstdint>
#include <cstring>
#include <cmath>
#include <vector>
#include <string>

Go to the source code of this file.

Classes

struct  signet::forge::VectorColumnSpec
 Configuration for a vector column: dimensionality and element precision. More...
 
class  signet::forge::VectorWriter
 Buffers float vectors and encodes them as FIXED_LEN_BYTE_ARRAY PLAIN data. More...
 
class  signet::forge::VectorReader
 Reads FIXED_LEN_BYTE_ARRAY page data back into float vectors. More...
 
struct  signet::forge::VectorReader::ZeroCopyResult
 Zero-copy read result: a pointer to the float data and the vector count. More...
 

Namespaces

namespace  signet
 
namespace  signet::forge
 
namespace  signet::forge::simd
 Platform-optimized SIMD routines for common vector operations.
 

Enumerations

enum class  signet::forge::VectorElementType : int32_t { signet::forge::FLOAT32 = 0 , signet::forge::FLOAT64 = 1 , signet::forge::FLOAT16 = 2 }
 Specifies the numerical precision of each element within a vector column. More...
 

Functions

float signet::forge::f16_to_f32 (uint16_t h) noexcept
 Convert a 16-bit IEEE 754 half-precision value to a 32-bit float.
 
uint16_t signet::forge::f32_to_f16 (float val) noexcept
 Convert a 32-bit float to a 16-bit IEEE 754 half-precision value.
 
float signet::forge::simd::dot_product (const float *a, const float *b, size_t n) noexcept
 Compute the dot product (inner product) of two float vectors.
 
float signet::forge::simd::l2_distance_sq (const float *a, const float *b, size_t n) noexcept
 Compute the squared L2 (Euclidean) distance between two float vectors.
 
float signet::forge::simd::sum_of_squares (const float *data, size_t n) noexcept
 Compute the sum of squares of a float vector.
 
void signet::forge::simd::l2_normalize (float *data, size_t n) noexcept
 L2-normalize a float vector in-place (divide each element by the L2 norm).
 
void signet::forge::simd::copy_floats (float *dst, const float *src, size_t n) noexcept
 Fast copy of n floats from src to dst.
 
SchemaBuildersignet::forge::add_vector_column (SchemaBuilder &builder, const std::string &name, uint32_t dimension, VectorElementType elem=VectorElementType::FLOAT32)
 Add a vector column to a SchemaBuilder.
 

Detailed Description

AI-native ML vector column type: VectorWriter/VectorReader for dense float embedding storage as FIXED_LEN_BYTE_ARRAY Parquet columns, plus SIMD-accelerated dot product, L2 distance, normalization, and copy.

Definition in file vector_type.hpp.