Barretenberg
The ZK-SNARK library at the core of Aztec
Loading...
Searching...
No Matches
full_row.cpp
Go to the documentation of this file.
1
#include "
barretenberg/vm2/constraining/full_row.hpp
"
2
3
#include <cstddef>
4
5
#include "
barretenberg/vm2/generated/columns.hpp
"
6
#include "
barretenberg/vm2/tracegen/trace_container.hpp
"
7
8
namespace
bb::avm2
{
9
namespace
{
10
11
template
<
typename
Entities>
auto
& get_entity_by_column(
Entities
& entities,
ColumnAndShifts
c)
12
{
13
// A statically constructed pointer to members of the class, indexed by column.
14
// This should only be created once per Entities class.
15
static
std::array<
typename
Entities::DataType(
Entities
::*),
NUM_COLUMNS_WITH_SHIFTS
> col_ptrs = {
16
AVM2_ALL_ENTITIES_E
(&
Entities
::)
17
};
18
return
(entities.*col_ptrs[
static_cast<
size_t
>
(c)]);
19
}
20
21
}
// namespace
22
23
FF
& AvmFullRow::get(
ColumnAndShifts
col)
24
{
25
return
get_entity_by_column(*
this
, col);
26
}
27
const
FF
& AvmFullRow::get(
ColumnAndShifts
col)
const
28
{
29
return
get_entity_by_column(*
this
, col);
30
}
31
32
const
FF
& AvmFullRowProxy::get(
ColumnAndShifts
col)
const
33
{
34
return
trace
.get_column_or_shift(col, row_index);
35
}
36
37
}
// namespace bb::avm2
bb::MegaFlavor_Generated::AllEntities
Definition
mega_flavor_generated.hpp:277
columns.hpp
AVM2_ALL_ENTITIES_E
#define AVM2_ALL_ENTITIES_E(e)
Definition
columns.hpp:16
trace
TestTraceContainer trace
Definition
data_copy.test.cpp:63
full_row.hpp
bb::avm2
Definition
dbs.cpp:19
bb::avm2::FF
AvmFlavorSettings::FF FF
Definition
field.hpp:10
bb::avm2::ColumnAndShifts
ColumnAndShifts
Definition
columns.hpp:35
bb::avm2::NUM_COLUMNS_WITH_SHIFTS
constexpr auto NUM_COLUMNS_WITH_SHIFTS
Definition
columns.hpp:40
trace_container.hpp
src
barretenberg
vm2
constraining
full_row.cpp
Generated by
1.9.8