Barretenberg
The ZK-SNARK library at the core of Aztec
Loading...
Searching...
No Matches
gt_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 gtImpl<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/gt");
18
19 const auto gt_A_LTE_B = (in.get(C::gt_input_b) - in.get(C::gt_input_a));
20 const auto gt_A_GT_B = ((in.get(C::gt_input_a) - in.get(C::gt_input_b)) - FF(1));
21
22 {
23 using Accumulator = typename std::tuple_element_t<0, ContainerOverSubrelations>;
24 auto tmp = in.get(C::gt_sel) * (FF(1) - in.get(C::gt_sel));
25 tmp *= scaling_factor;
26 std::get<0>(evals) += typename Accumulator::View(tmp);
27 }
28 {
29 using Accumulator = typename std::tuple_element_t<1, ContainerOverSubrelations>;
30 auto tmp = in.get(C::gt_res) * (FF(1) - in.get(C::gt_res));
31 tmp *= scaling_factor;
32 std::get<1>(evals) += typename Accumulator::View(tmp);
33 }
34 { // GT_RESULT
35 using Accumulator = typename std::tuple_element_t<2, ContainerOverSubrelations>;
36 auto tmp =
37 in.get(C::gt_sel) * (((gt_A_GT_B - gt_A_LTE_B) * in.get(C::gt_res) + gt_A_LTE_B) - in.get(C::gt_abs_diff));
38 tmp *= scaling_factor;
39 std::get<2>(evals) += typename Accumulator::View(tmp);
40 }
41}
42
43} // namespace bb::avm2
static void accumulate(ContainerOverSubrelations &evals, const AllEntities &in, const RelationParameters< FF > &, const FF &scaling_factor)
Definition gt_impl.hpp:10
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.