Barretenberg
The ZK-SNARK library at the core of Aztec
Loading...
Searching...
No Matches
bc_retrieval_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 bc_retrievalImpl<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/bc_retrieval");
18
19 {
20 using Accumulator = typename std::tuple_element_t<0, ContainerOverSubrelations>;
21 auto tmp = in.get(C::bc_retrieval_sel) * (FF(1) - in.get(C::bc_retrieval_sel));
22 tmp *= scaling_factor;
23 std::get<0>(evals) += typename Accumulator::View(tmp);
24 }
25 { // TRACE_CONTINUITY
26 using Accumulator = typename std::tuple_element_t<1, ContainerOverSubrelations>;
27 auto tmp = (FF(1) - in.get(C::bc_retrieval_sel)) * (FF(1) - in.get(C::precomputed_first_row)) *
28 in.get(C::bc_retrieval_sel_shift);
29 tmp *= scaling_factor;
30 std::get<1>(evals) += typename Accumulator::View(tmp);
31 }
32 {
33 using Accumulator = typename std::tuple_element_t<2, ContainerOverSubrelations>;
34 auto tmp = (in.get(C::bc_retrieval_error) -
35 in.get(C::bc_retrieval_sel) * (FF(1) - in.get(C::bc_retrieval_instance_exists)));
36 tmp *= scaling_factor;
37 std::get<2>(evals) += typename Accumulator::View(tmp);
38 }
39 { // CURRENT_CLASS_ID_IS_ZERO_IF_INSTANCE_DOES_NOT_EXIST
40 using Accumulator = typename std::tuple_element_t<3, ContainerOverSubrelations>;
41 auto tmp = in.get(C::bc_retrieval_sel) * (FF(1) - in.get(C::bc_retrieval_instance_exists)) *
42 in.get(C::bc_retrieval_current_class_id);
43 tmp *= scaling_factor;
44 std::get<3>(evals) += typename Accumulator::View(tmp);
45 }
46 { // ARTIFACT_HASH_IS_ZERO_IF_INSTANCE_DOES_NOT_EXIST
47 using Accumulator = typename std::tuple_element_t<4, ContainerOverSubrelations>;
48 auto tmp = in.get(C::bc_retrieval_sel) * (FF(1) - in.get(C::bc_retrieval_instance_exists)) *
49 in.get(C::bc_retrieval_artifact_hash);
50 tmp *= scaling_factor;
51 std::get<4>(evals) += typename Accumulator::View(tmp);
52 }
53 { // PRIVATE_FUNCTION_ROOT_IS_ZERO_IF_INSTANCE_DOES_NOT_EXIST
54 using Accumulator = typename std::tuple_element_t<5, ContainerOverSubrelations>;
55 auto tmp = in.get(C::bc_retrieval_sel) * (FF(1) - in.get(C::bc_retrieval_instance_exists)) *
56 in.get(C::bc_retrieval_private_function_root);
57 tmp *= scaling_factor;
58 std::get<5>(evals) += typename Accumulator::View(tmp);
59 }
60 { // BYTECODE_ID_IS_ZERO_IF_INSTANCE_DOES_NOT_EXIST
61 using Accumulator = typename std::tuple_element_t<6, ContainerOverSubrelations>;
62 auto tmp = in.get(C::bc_retrieval_sel) * (FF(1) - in.get(C::bc_retrieval_instance_exists)) *
63 in.get(C::bc_retrieval_bytecode_id);
64 tmp *= scaling_factor;
65 std::get<6>(evals) += typename Accumulator::View(tmp);
66 }
67}
68
69} // 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.