2#include "barretenberg/relations/relation_types.hpp"
4namespace proof_system {
10 static constexpr std::array<size_t, 4> SUBRELATION_PARTIAL_LENGTHS{
32 template <
typename ContainerOverSubrelations,
typename AllEntities,
typename Parameters>
33 inline static void accumulate(ContainerOverSubrelations& accumulators,
34 const AllEntities& in,
36 const FF& scaling_factor)
38 using Accumulator = std::tuple_element_t<0, ContainerOverSubrelations>;
39 using View =
typename Accumulator::View;
40 auto w_1 = View(in.w_l);
41 auto w_2 = View(in.w_r);
42 auto w_3 = View(in.w_o);
43 auto w_4 = View(in.w_4);
44 auto w_1_shift = View(in.w_l_shift);
45 auto q_sort = View(in.q_sort);
47 static const FF minus_one = FF(-1);
48 static const FF minus_two = FF(-2);
49 static const FF minus_three = FF(-3);
52 auto delta_1 = w_2 - w_1;
53 auto delta_2 = w_3 - w_2;
54 auto delta_3 = w_4 - w_3;
55 auto delta_4 = w_1_shift - w_4;
59 tmp_1 *= (delta_1 + minus_one);
60 tmp_1 *= (delta_1 + minus_two);
61 tmp_1 *= (delta_1 + minus_three);
63 tmp_1 *= scaling_factor;
64 std::get<0>(accumulators) += tmp_1;
68 tmp_2 *= (delta_2 + minus_one);
69 tmp_2 *= (delta_2 + minus_two);
70 tmp_2 *= (delta_2 + minus_three);
72 tmp_2 *= scaling_factor;
73 std::get<1>(accumulators) += tmp_2;
77 tmp_3 *= (delta_3 + minus_one);
78 tmp_3 *= (delta_3 + minus_two);
79 tmp_3 *= (delta_3 + minus_three);
81 tmp_3 *= scaling_factor;
82 std::get<2>(accumulators) += tmp_3;
86 tmp_4 *= (delta_4 + minus_one);
87 tmp_4 *= (delta_4 + minus_two);
88 tmp_4 *= (delta_4 + minus_three);
90 tmp_4 *= scaling_factor;
91 std::get<3>(accumulators) += tmp_4;
95template <
typename FF>
using GenPermSortRelation = Relation<GenPermSortRelationImpl<FF>>;
Definition: gen_perm_sort_relation.hpp:6
static void accumulate(ContainerOverSubrelations &accumulators, const AllEntities &in, const Parameters &, const FF &scaling_factor)
Expression for the generalized permutation sort gate.
Definition: gen_perm_sort_relation.hpp:33