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
#include "
barretenberg/vm2/generated/columns.hpp
"
3
#include "
barretenberg/vm2/tracegen/trace_container.hpp
"
4
5
namespace
bb::avm2
{
6
namespace
{
7
8
template
<
typename
Entities>
auto
& get_entity_by_column(Entities& entities,
ColumnAndShifts
c)
9
{
10
// A statically constructed pointer to members of the class, indexed by column.
11
// This should only be created once per Entities class.
12
static
std::array<
typename
Entities::DataType(Entities::*),
NUM_COLUMNS_WITH_SHIFTS
> col_ptrs = {
13
AVM2_ALL_ENTITIES_E
(&Entities::)
14
};
15
return
(entities.*col_ptrs[
static_cast<
size_t
>
(c)]);
16
}
17
18
}
// namespace
19
20
FF
& AvmFullRow::get(
ColumnAndShifts
col)
21
{
22
return
get_entity_by_column(*
this
, col);
23
}
24
const
FF
& AvmFullRow::get(
ColumnAndShifts
col)
const
25
{
26
return
get_entity_by_column(*
this
, col);
27
}
28
29
const
FF
& AvmFullRowProxy::get(
ColumnAndShifts
col)
const
30
{
31
return
trace
.get_column_or_shift(col, row_index);
32
}
33
34
}
// namespace bb::avm2
columns.hpp
AVM2_ALL_ENTITIES_E
#define AVM2_ALL_ENTITIES_E(e)
Definition
columns.hpp:15
trace
TestTraceContainer trace
Definition
data_copy.test.cpp:62
full_row.hpp
bb::avm2
Definition
flavor.hpp:581
bb::avm2::NUM_COLUMNS_WITH_SHIFTS
constexpr auto NUM_COLUMNS_WITH_SHIFTS
Definition
columns.hpp:39
bb::avm2::ColumnAndShifts
ColumnAndShifts
Definition
columns.hpp:34
bb::avm2::FF
AvmFlavorSettings::FF FF
Definition
field.hpp:10
trace_container.hpp
src
barretenberg
vm2
constraining
full_row.cpp
Generated by
1.9.8