Barretenberg
The ZK-SNARK library at the core of Aztec
Loading...
Searching...
No Matches
full_row.cpp
Go to the documentation of this file.
4
5namespace bb::avm2 {
6namespace {
7
8template <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
20FF& AvmFullRow::get(ColumnAndShifts col)
21{
22 return get_entity_by_column(*this, col);
23}
24const FF& AvmFullRow::get(ColumnAndShifts col) const
25{
26 return get_entity_by_column(*this, col);
27}
28
29const FF& AvmFullRowProxy::get(ColumnAndShifts col) const
30{
31 return trace.get_column_or_shift(col, row_index);
32}
33
34} // namespace bb::avm2
#define AVM2_ALL_ENTITIES_E(e)
Definition columns.hpp:15
TestTraceContainer trace
constexpr auto NUM_COLUMNS_WITH_SHIFTS
Definition columns.hpp:39
ColumnAndShifts
Definition columns.hpp:34
AvmFlavorSettings::FF FF
Definition field.hpp:10