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