Barretenberg
The ZK-SNARK library at the core of Aztec
Loading...
Searching...
No Matches
translator_shiftable_first_coeff_zero_short_relation_impl.hpp
Go to the documentation of this file.
1// === AUDIT STATUS ===
2// internal: { status: Planned, auditors: [], commit: }
3// external_1: { status: not started, auditors: [], commit: }
4// external_2: { status: not started, auditors: [], commit: }
5// =====================
6
7#pragma once
9
10namespace bb {
11
20template <typename FF>
21template <typename ContainerOverSubrelations, typename AllEntities, typename Parameters>
22void TranslatorShiftableFirstCoeffZeroShortRelationImpl<FF>::accumulate(ContainerOverSubrelations& accumulators,
23 const AllEntities& in,
24 const Parameters& /*unused*/,
25 const FF& scaling_factor)
26{
29
30 // Every contribution carries a lagrange_first factor, so on any edge where lagrange_first is identically zero all
31 // five contributions are the zero polynomial. lagrange_first is nonzero at a single index, so this skips the
32 // degree-2 products on essentially every edge.
33 if (!in.lagrange_first.is_zero()) {
34 auto ordered_range_constraints_0 = View(in.ordered_range_constraints_0);
35 auto ordered_range_constraints_1 = View(in.ordered_range_constraints_1);
36 auto ordered_range_constraints_2 = View(in.ordered_range_constraints_2);
37 auto ordered_range_constraints_3 = View(in.ordered_range_constraints_3);
38 auto ordered_range_constraints_4 = View(in.ordered_range_constraints_4);
39 const auto lagrange_first = View(in.lagrange_first);
40 const auto lagrange_first_scaled = lagrange_first * scaling_factor;
41
42 // Contributions 0-4 pin the first value of each sorted ordered_range_constraints wire to 0.
43 std::get<0>(accumulators) += Accumulator(lagrange_first_scaled * ordered_range_constraints_0);
44 std::get<1>(accumulators) += Accumulator(lagrange_first_scaled * ordered_range_constraints_1);
45 std::get<2>(accumulators) += Accumulator(lagrange_first_scaled * ordered_range_constraints_2);
46 std::get<3>(accumulators) += Accumulator(lagrange_first_scaled * ordered_range_constraints_3);
47 std::get<4>(accumulators) += Accumulator(lagrange_first_scaled * ordered_range_constraints_4);
48 }
49}
50} // namespace bb
static void accumulate(ContainerOverSubrelations &accumulators, const AllEntities &in, const Parameters &, const FF &scaling_factor)
Anchors the first coefficient of the shiftable ordered_range_constraints polynomials to zero.
Entry point for Barretenberg command-line interface.
Definition api.hpp:5
typename Accumulator::CoefficientAccumulator TranslatorShortMonomialView
constexpr decltype(auto) get(::tuplet::tuple< T... > &&t) noexcept
Definition tuple.hpp:13