2#include "barretenberg/ecc/curves/bn254/bn254.hpp"
4#include <barretenberg/common/slab_allocator.hpp>
8namespace arithmetization {
37 static constexpr size_t NUM_WIRES = 3;
38 static constexpr size_t NUM_SELECTORS = 5;
40 using SelectorType = std::vector<FF, barretenberg::ContainerSlabAllocator<FF>>;
42 std::vector<SelectorType> selectors;
44 SelectorType& q_m() {
return selectors[0]; };
45 SelectorType& q_1() {
return selectors[1]; };
46 SelectorType& q_2() {
return selectors[2]; };
47 SelectorType& q_3() {
return selectors[3]; };
48 SelectorType& q_c() {
return selectors[4]; };
50 const SelectorType& q_m()
const {
return selectors[0]; };
51 const SelectorType& q_1()
const {
return selectors[1]; };
52 const SelectorType& q_2()
const {
return selectors[2]; };
53 const SelectorType& q_3()
const {
return selectors[3]; };
54 const SelectorType& q_c()
const {
return selectors[4]; };
57 : selectors(NUM_SELECTORS)
60 const auto& get()
const {
return selectors; };
62 void reserve(
size_t size_hint)
64 for (
auto& p : selectors) {
70 inline static const std::vector<std::string> selector_names = {
"q_m",
"q_1",
"q_2",
"q_3",
"q_c" };
73template <
typename FF_>
class Ultra {
75 static constexpr size_t NUM_WIRES = 4;
76 static constexpr size_t NUM_SELECTORS = 11;
78 using SelectorType = std::vector<FF, barretenberg::ContainerSlabAllocator<FF>>;
81 std::array<SelectorType, NUM_SELECTORS> selectors;
84 SelectorType& q_m() {
return selectors[0]; };
85 SelectorType& q_c() {
return selectors[1]; };
86 SelectorType& q_1() {
return selectors[2]; };
87 SelectorType& q_2() {
return selectors[3]; };
88 SelectorType& q_3() {
return selectors[4]; };
89 SelectorType& q_4() {
return selectors[5]; };
90 SelectorType& q_arith() {
return selectors[6]; };
91 SelectorType& q_sort() {
return selectors[7]; };
92 SelectorType& q_elliptic() {
return selectors[8]; };
93 SelectorType& q_aux() {
return selectors[9]; };
94 SelectorType& q_lookup_type() {
return selectors[10]; };
96 const SelectorType& q_m()
const {
return selectors[0]; };
97 const SelectorType& q_c()
const {
return selectors[1]; };
98 const SelectorType& q_1()
const {
return selectors[2]; };
99 const SelectorType& q_2()
const {
return selectors[3]; };
100 const SelectorType& q_3()
const {
return selectors[4]; };
101 const SelectorType& q_4()
const {
return selectors[5]; };
102 const SelectorType& q_arith()
const {
return selectors[6]; };
103 const SelectorType& q_sort()
const {
return selectors[7]; };
104 const SelectorType& q_elliptic()
const {
return selectors[8]; };
105 const SelectorType& q_aux()
const {
return selectors[9]; };
106 const SelectorType& q_lookup_type()
const {
return selectors[10]; };
108 const auto& get()
const {
return selectors; };
110 void reserve(
size_t size_hint)
112 for (
auto& vec : selectors) {
113 vec.reserve(size_hint);
125 inline static const std::vector<std::string> selector_names = {
"q_m",
"q_c",
"q_1",
"q_2",
126 "q_3",
"q_4",
"q_arith",
"q_sort",
127 "q_elliptic",
"q_aux",
"table_type" };
138 static constexpr size_t NUM_WIRES = 4;
139 static constexpr size_t NUM_SELECTORS = 14;
141 using SelectorType = std::vector<FF, barretenberg::ContainerSlabAllocator<FF>>;
144 std::array<SelectorType, NUM_SELECTORS> selectors;
147 SelectorType& q_m() {
return selectors[0]; };
148 SelectorType& q_c() {
return selectors[1]; };
149 SelectorType& q_1() {
return selectors[2]; };
150 SelectorType& q_2() {
return selectors[3]; };
151 SelectorType& q_3() {
return selectors[4]; };
152 SelectorType& q_4() {
return selectors[5]; };
153 SelectorType& q_arith() {
return selectors[6]; };
154 SelectorType& q_sort() {
return selectors[7]; };
155 SelectorType& q_elliptic() {
return selectors[8]; };
156 SelectorType& q_aux() {
return selectors[9]; };
157 SelectorType& q_lookup_type() {
return selectors[10]; };
158 SelectorType& q_busread() {
return selectors[11]; };
159 SelectorType& q_poseidon2_external() {
return this->selectors[12]; };
160 SelectorType& q_poseidon2_internal() {
return this->selectors[13]; };
162 const SelectorType& q_m()
const {
return selectors[0]; };
163 const SelectorType& q_c()
const {
return selectors[1]; };
164 const SelectorType& q_1()
const {
return selectors[2]; };
165 const SelectorType& q_2()
const {
return selectors[3]; };
166 const SelectorType& q_3()
const {
return selectors[4]; };
167 const SelectorType& q_4()
const {
return selectors[5]; };
168 const SelectorType& q_arith()
const {
return selectors[6]; };
169 const SelectorType& q_sort()
const {
return selectors[7]; };
170 const SelectorType& q_elliptic()
const {
return selectors[8]; };
171 const SelectorType& q_aux()
const {
return selectors[9]; };
172 const SelectorType& q_lookup_type()
const {
return selectors[10]; };
173 const SelectorType& q_busread()
const {
return selectors[11]; };
174 const SelectorType& q_poseidon2_external()
const {
return this->selectors[12]; };
175 const SelectorType& q_poseidon2_internal()
const {
return this->selectors[13]; };
177 const auto& get()
const {
return selectors; };
179 void reserve(
size_t size_hint)
181 for (
auto& vec : selectors) {
182 vec.reserve(size_hint);
194 q_busread().emplace_back(0);
195 q_poseidon2_external().emplace_back(0);
196 q_poseidon2_internal().emplace_back(0);
200 inline static const std::vector<std::string> selector_names = {};
205 static constexpr size_t NUM_WIRES = 81;
206 static constexpr size_t NUM_SELECTORS = 0;
Definition: arithmetization.hpp:203
Specify the structure of a CircuitBuilder.
Definition: arithmetization.hpp:35
Ultra Honk arithmetization.
Definition: arithmetization.hpp:136
void pad_additional()
Add zeros to all selectors which are not part of the conventional Ultra arithmetization.
Definition: arithmetization.hpp:192
Definition: arithmetization.hpp:73
void pad_additional()
Add zeros to all selectors which are not part of the conventional Ultra arithmetization.
Definition: arithmetization.hpp:122