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

A map from 'entry' to 'index' where entry is a row in a BasicTable and index is the row at which that entry exists in the table. More...

#include <types.hpp>

Classes

struct  HashFunction
 

Public Types

using FF = bb::fr
 
using Key = std::array< FF, 3 >
 
using Value = size_t
 

Public Member Functions

 LookupHashTable ()=default
 
void initialize (std::vector< FF > &column_1, std::vector< FF > &column_2, std::vector< FF > &column_3)
 
Value operator[] (const Key &key) const
 
bool operator== (const LookupHashTable &other) const =default
 

Public Attributes

std::unordered_map< Key, Value, HashFunctionindex_map
 

Detailed Description

A map from 'entry' to 'index' where entry is a row in a BasicTable and index is the row at which that entry exists in the table.

Such a map is needed to in order to construct read_counts (the polynomial containing the number of reads from each entry in a table) for the log-derivative lookup argument. A BasicTable essentially consists of 3 columns, and 'lookups' are recorded as rows in this table. The index at which this data exists in the table is not explicitly known at the time of lookup gate creation. This map can be used to construct read counts from the set of lookups that have been performed via an operation like read_counts[index_map[lookup_data]]++

Definition at line 298 of file types.hpp.

Member Typedef Documentation

◆ FF

Definition at line 299 of file types.hpp.

◆ Key

using bb::plookup::LookupHashTable::Key = std::array<FF, 3>

Definition at line 300 of file types.hpp.

◆ Value

Definition at line 301 of file types.hpp.

Constructor & Destructor Documentation

◆ LookupHashTable()

bb::plookup::LookupHashTable::LookupHashTable ( )
default

Member Function Documentation

◆ initialize()

void bb::plookup::LookupHashTable::initialize ( std::vector< FF > &  column_1,
std::vector< FF > &  column_2,
std::vector< FF > &  column_3 
)
inline

Definition at line 325 of file types.hpp.

◆ operator==()

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

◆ operator[]()

Value bb::plookup::LookupHashTable::operator[] ( const Key key) const
inline

Definition at line 333 of file types.hpp.

Member Data Documentation

◆ index_map

std::unordered_map<Key, Value, HashFunction> bb::plookup::LookupHashTable::index_map

Definition at line 320 of file types.hpp.


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