Barretenberg
The ZK-SNARK library at the core of Aztec
Loading...
Searching...
No Matches
precomputed_impl.hpp
Go to the documentation of this file.
1// AUTOGENERATED FILE
2#pragma once
3
6
7namespace bb::avm2 {
8
9template <typename FF_>
10template <typename ContainerOverSubrelations, typename AllEntities>
11void precomputedImpl<FF_>::accumulate(ContainerOverSubrelations& evals,
12 const AllEntities& in,
13 [[maybe_unused]] const RelationParameters<FF_>&,
14 [[maybe_unused]] const FF_& scaling_factor)
15{
16 using C = ColumnAndShifts;
17
18 {
19 using View = typename std::tuple_element_t<0, ContainerOverSubrelations>::View;
20 auto tmp = static_cast<View>(in.get(C::precomputed_sel_range_16_active)) *
21 (FF(1) - static_cast<View>(in.get(C::precomputed_sel_range_16_active)));
22 std::get<0>(evals) += (tmp * scaling_factor);
23 }
24 {
25 using View = typename std::tuple_element_t<1, ContainerOverSubrelations>::View;
26 auto tmp = static_cast<View>(in.get(C::precomputed_sel_bitwise)) *
27 (FF(1) - static_cast<View>(in.get(C::precomputed_sel_bitwise)));
28 std::get<1>(evals) += (tmp * scaling_factor);
29 }
30 {
31 using View = typename std::tuple_element_t<2, ContainerOverSubrelations>::View;
32 auto tmp = static_cast<View>(in.get(C::precomputed_sel_addressing_gas)) *
33 (FF(1) - static_cast<View>(in.get(C::precomputed_sel_addressing_gas)));
34 std::get<2>(evals) += (tmp * scaling_factor);
35 }
36 { // GRANULAR_SELECTORS_ON_RANGE_16
37 using View = typename std::tuple_element_t<3, ContainerOverSubrelations>::View;
38 auto tmp = (static_cast<View>(in.get(C::precomputed_sel_range_16_active)) +
39 static_cast<View>(in.get(C::precomputed_sel_bitwise)) +
40 static_cast<View>(in.get(C::precomputed_sel_addressing_gas))) *
41 (FF(1) - static_cast<View>(in.get(C::precomputed_sel_range_16)));
42 std::get<3>(evals) += (tmp * scaling_factor);
43 }
44}
45
46} // namespace bb::avm2
static void accumulate(ContainerOverSubrelations &evals, const AllEntities &in, const RelationParameters< FF > &, const FF &scaling_factor)
AvmFlavorSettings::FF FF
Definition field.hpp:10
ColumnAndShifts
Definition columns.hpp:35
constexpr decltype(auto) get(::tuplet::tuple< T... > &&t) noexcept
Definition tuple.hpp:13
Container for parameters used by the grand product (permutation, lookup) Honk relations.