Barretenberg
The ZK-SNARK library at the core of Aztec
Loading...
Searching...
No Matches
tx_discard_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 tx_discardImpl<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/tx_discard");
18
19 const auto tx_LAST_ROW_OF_SETUP = (FF(1) - in.get(C::tx_is_revertible)) * in.get(C::tx_is_revertible_shift);
20 const auto tx_PROPAGATE_DISCARD = (FF(1) - tx_LAST_ROW_OF_SETUP) * (FF(1) - in.get(C::tx_reverted));
21
22 {
23 using Accumulator = typename std::tuple_element_t<0, ContainerOverSubrelations>;
24 auto tmp = in.get(C::tx_discard) * (FF(1) - in.get(C::tx_discard));
25 tmp *= scaling_factor;
26 std::get<0>(evals) += typename Accumulator::View(tmp);
27 }
28 { // CAN_ONLY_DISCARD_IN_REVERTIBLE_PHASES
29 using Accumulator = typename std::tuple_element_t<1, ContainerOverSubrelations>;
30 auto tmp = in.get(C::tx_discard) * (FF(1) - in.get(C::tx_is_revertible));
31 tmp *= scaling_factor;
32 std::get<1>(evals) += typename Accumulator::View(tmp);
33 }
34 { // FAILURE_MUST_DISCARD
35 using Accumulator = typename std::tuple_element_t<2, ContainerOverSubrelations>;
36 auto tmp = in.get(C::tx_reverted) * (FF(1) - in.get(C::tx_discard));
37 tmp *= scaling_factor;
38 std::get<2>(evals) += typename Accumulator::View(tmp);
39 }
40 { // DISCARD_PROPAGATION
41 using Accumulator = typename std::tuple_element_t<3, ContainerOverSubrelations>;
42 auto tmp = in.get(C::tx_sel) * tx_PROPAGATE_DISCARD * (in.get(C::tx_discard_shift) - in.get(C::tx_discard));
43 tmp *= scaling_factor;
44 std::get<3>(evals) += typename Accumulator::View(tmp);
45 }
46}
47
48} // 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.