Barretenberg
The ZK-SNARK library at the core of Aztec
Loading...
Searching...
No Matches
bb::plookup::MultiTable Struct Reference

Container for managing multiple BasicTables plus the data needed to combine basic table outputs (e.g. limbs) into accumulators. Does not store actual raw table data. More...

#include <types.hpp>

Public Types

typedef std::array< bb::fr, 2 > table_out
 
typedef std::array< uint64_t, 2 > table_in
 

Public Member Functions

 MultiTable (const bb::fr &col_1_repeated_coeff, const bb::fr &col_2_repeated_coeff, const bb::fr &col_3_repeated_coeff, const size_t num_lookups)
 
 MultiTable (const std::vector< bb::fr > &col_1_coeffs, const std::vector< bb::fr > &col_2_coeffs, const std::vector< bb::fr > &col_3_coeffs)
 
 MultiTable ()
 
 MultiTable (const MultiTable &other)=default
 
 MultiTable (MultiTable &&other)=default
 
MultiTableoperator= (const MultiTable &other)=default
 
MultiTableoperator= (MultiTable &&other)=default
 
bool operator== (const MultiTable &other) const =default
 

Public Attributes

std::vector< bb::frcolumn_1_coefficients
 
std::vector< bb::frcolumn_2_coefficients
 
std::vector< bb::frcolumn_3_coefficients
 
MultiTableId id
 
std::vector< BasicTableIdbasic_table_ids
 
std::vector< uint64_t > slice_sizes
 
std::vector< bb::frcolumn_1_step_sizes
 
std::vector< bb::frcolumn_2_step_sizes
 
std::vector< bb::frcolumn_3_step_sizes
 
std::vector< table_out(*)(table_in)> get_table_values
 

Private Member Functions

void init_step_sizes ()
 

Detailed Description

Container for managing multiple BasicTables plus the data needed to combine basic table outputs (e.g. limbs) into accumulators. Does not store actual raw table data.

As a simple example, consider using lookups to compute XOR on uint32_t inputs. To do this we decompose the inputs into 6 limbs and use a BasicTable for 6-bit XOR lookups. In this case the MultiTable simply manages 6 basic tables, all of which are the XOR BasicTable. (In many cases all of the BasicTables managed by a MultiTable are identical, however there are some cases where more than 1 type is required, e.g. if a certain limb has to be handled differently etc.). This class also stores the scalars needed to reconstruct full values from the components that are contained in the basic lookup tables.

Note
Note that a MultiTable does not actually store any table data. Rather it stores a set of basic table IDs, the methods used to compute the basic table entries, plus some metadata.

Definition at line 154 of file types.hpp.

Member Typedef Documentation

◆ table_in

typedef std::array<uint64_t, 2> bb::plookup::MultiTable::table_in

Definition at line 166 of file types.hpp.

◆ table_out

Definition at line 165 of file types.hpp.

Constructor & Destructor Documentation

◆ MultiTable() [1/5]

bb::plookup::MultiTable::MultiTable ( const bb::fr col_1_repeated_coeff,
const bb::fr col_2_repeated_coeff,
const bb::fr col_3_repeated_coeff,
const size_t  num_lookups 
)
inline

Definition at line 192 of file types.hpp.

◆ MultiTable() [2/5]

bb::plookup::MultiTable::MultiTable ( const std::vector< bb::fr > &  col_1_coeffs,
const std::vector< bb::fr > &  col_2_coeffs,
const std::vector< bb::fr > &  col_3_coeffs 
)
inline

Definition at line 208 of file types.hpp.

◆ MultiTable() [3/5]

bb::plookup::MultiTable::MultiTable ( )
inline

Definition at line 218 of file types.hpp.

◆ MultiTable() [4/5]

bb::plookup::MultiTable::MultiTable ( const MultiTable other)
default

◆ MultiTable() [5/5]

bb::plookup::MultiTable::MultiTable ( MultiTable &&  other)
default

Member Function Documentation

◆ init_step_sizes()

void bb::plookup::MultiTable::init_step_sizes ( )
inlineprivate

Definition at line 171 of file types.hpp.

◆ operator=() [1/2]

MultiTable & bb::plookup::MultiTable::operator= ( const MultiTable other)
default

◆ operator=() [2/2]

MultiTable & bb::plookup::MultiTable::operator= ( MultiTable &&  other)
default

◆ operator==()

bool bb::plookup::MultiTable::operator== ( const MultiTable other) const
default

Member Data Documentation

◆ basic_table_ids

std::vector<BasicTableId> bb::plookup::MultiTable::basic_table_ids

Definition at line 160 of file types.hpp.

◆ column_1_coefficients

std::vector<bb::fr> bb::plookup::MultiTable::column_1_coefficients

Definition at line 156 of file types.hpp.

◆ column_1_step_sizes

std::vector<bb::fr> bb::plookup::MultiTable::column_1_step_sizes

Definition at line 162 of file types.hpp.

◆ column_2_coefficients

std::vector<bb::fr> bb::plookup::MultiTable::column_2_coefficients

Definition at line 157 of file types.hpp.

◆ column_2_step_sizes

std::vector<bb::fr> bb::plookup::MultiTable::column_2_step_sizes

Definition at line 163 of file types.hpp.

◆ column_3_coefficients

std::vector<bb::fr> bb::plookup::MultiTable::column_3_coefficients

Definition at line 158 of file types.hpp.

◆ column_3_step_sizes

std::vector<bb::fr> bb::plookup::MultiTable::column_3_step_sizes

Definition at line 164 of file types.hpp.

◆ get_table_values

std::vector<table_out (*)(table_in)> bb::plookup::MultiTable::get_table_values

Definition at line 168 of file types.hpp.

◆ id

MultiTableId bb::plookup::MultiTable::id

Definition at line 159 of file types.hpp.

◆ slice_sizes

std::vector<uint64_t> bb::plookup::MultiTable::slice_sizes

Definition at line 161 of file types.hpp.


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