Signet Forge 0.1.0
C++20 Parquet library with AI-native extensions
DEMO
Loading...
Searching...
No Matches
signet::forge::QuantizedVectorReader Class Reference

Reads quantized page data (FIXED_LEN_BYTE_ARRAY) and dequantizes to float32 on demand. More...

#include <quantized_vector.hpp>

Classes

struct  RawResult
 Result of a raw (non-dequantized) page read. More...
 

Public Member Functions

 QuantizedVectorReader (QuantizationParams params)
 Construct a reader with the given quantization parameters.
 
std::vector< std::vector< float > > read_page (const uint8_t *data, size_t data_size)
 Read an entire page and dequantize all vectors to float32.
 
std::vector< float > read_vector (const uint8_t *page_data, size_t page_size, size_t index)
 Read and dequantize a single vector by index within the page.
 
expected< RawResultread_raw (const uint8_t *data, size_t data_size)
 Read raw quantized bytes without dequantization.
 

Detailed Description

Reads quantized page data (FIXED_LEN_BYTE_ARRAY) and dequantizes to float32 on demand.

See also
QuantizedVectorWriter, Dequantizer, QuantizationParams

Definition at line 325 of file quantized_vector.hpp.

Constructor & Destructor Documentation

◆ QuantizedVectorReader()

signet::forge::QuantizedVectorReader::QuantizedVectorReader ( QuantizationParams  params)
inlineexplicit

Construct a reader with the given quantization parameters.

Definition at line 328 of file quantized_vector.hpp.

Member Function Documentation

◆ read_page()

std::vector< std::vector< float > > signet::forge::QuantizedVectorReader::read_page ( const uint8_t *  data,
size_t  data_size 
)
inline

Read an entire page and dequantize all vectors to float32.

Parameters
dataPointer to page data (FIXED_LEN_BYTE_ARRAY values).
data_sizeSize of the page data in bytes.
Returns
Vector of dequantized float vectors.

Definition at line 1299 of file quantized_vector.hpp.

◆ read_raw()

expected< QuantizedVectorReader::RawResult > signet::forge::QuantizedVectorReader::read_raw ( const uint8_t *  data,
size_t  data_size 
)
inline

Read raw quantized bytes without dequantization.

Parameters
dataPointer to page data.
data_sizeSize of the page data in bytes.
Returns
A RawResult pointing into the input buffer, or an error.

Definition at line 1330 of file quantized_vector.hpp.

◆ read_vector()

std::vector< float > signet::forge::QuantizedVectorReader::read_vector ( const uint8_t *  page_data,
size_t  page_size,
size_t  index 
)
inline

Read and dequantize a single vector by index within the page.

Parameters
page_dataPointer to page data.
page_sizeSize of the page data in bytes.
indexZero-based vector index within the page.
Returns
Dequantized float vector of size dim.

Definition at line 1313 of file quantized_vector.hpp.


The documentation for this class was generated from the following file: