Barretenberg
The ZK-SNARK library at the core of Aztec
Loading...
Searching...
No Matches
full_row.cpp
Go to the documentation of this file.
2
3#include <cstddef>
4
7
8namespace bb::avm2 {
9namespace {
10
11template <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 = {
17 };
18 return (entities.*col_ptrs[static_cast<size_t>(c)]);
19}
20
21} // namespace
22
23FF& AvmFullRow::get(ColumnAndShifts col)
24{
25 return get_entity_by_column(*this, col);
26}
27const FF& AvmFullRow::get(ColumnAndShifts col) const
28{
29 return get_entity_by_column(*this, col);
30}
31
32const FF& AvmFullRowProxy::get(ColumnAndShifts col) const
33{
34 return trace.get_column_or_shift(col, row_index);
35}
36
37} // namespace bb::avm2
#define AVM2_ALL_ENTITIES_E(e)
Definition columns.hpp:16
TestTraceContainer trace
AvmFlavorSettings::FF FF
Definition field.hpp:10
ColumnAndShifts
Definition columns.hpp:35
constexpr auto NUM_COLUMNS_WITH_SHIFTS
Definition columns.hpp:40