Barretenberg
The ZK-SNARK library at the core of Aztec
Loading...
Searching...
No Matches
relation_tuple_helpers.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
8
10
11#include <algorithm>
12#include <cstddef>
13#include <tuple>
14
15namespace bb {
16
22template <typename Tuple> constexpr size_t compute_max_partial_relation_length()
23{
25 return []<std::size_t... Is>(std::index_sequence<Is...>) {
26 return std::max({ std::tuple_element_t<Is, Tuple>::RELATION_LENGTH... });
27 }(seq);
28}
29
33template <typename Tuple> constexpr size_t compute_number_of_subrelations()
34{
36 return []<std::size_t... I>(std::index_sequence<I...>) {
37 return (0 + ... + std::tuple_element_t<I, Tuple>::SUBRELATION_PARTIAL_LENGTHS.size());
38 }(seq);
39}
40
47template <typename RelationsTuple> constexpr auto create_sumcheck_tuple_of_tuples_of_univariates()
48{
50 return []<size_t... I>(std::index_sequence<I...>) {
52 typename std::tuple_element_t<I, RelationsTuple>::SumcheckTupleOfUnivariatesOverSubrelations{}...);
53 }(seq);
54}
55
64template <typename RelationsTuple> constexpr auto create_tuple_of_arrays_of_values()
65{
67 return []<size_t... I>(std::index_sequence<I...>) {
69 typename std::tuple_element_t<I, RelationsTuple>::SumcheckArrayOfValuesOverSubrelations{}...);
70 }(seq);
71}
72
73} // namespace bb
Entry point for Barretenberg command-line interface.
Definition api.hpp:5
constexpr size_t compute_number_of_subrelations()
Utility function to find the number of subrelations.
constexpr auto create_tuple_of_arrays_of_values()
Create a tuple of arrays of values for relation evaluations.
constexpr size_t compute_max_partial_relation_length()
Utility function to find max PARTIAL_RELATION_LENGTH tuples of Relations.
constexpr auto create_sumcheck_tuple_of_tuples_of_univariates()
Utility function to construct a container for the subrelation accumulators of sumcheck proving.
constexpr decltype(auto) get(::tuplet::tuple< T... > &&t) noexcept
Definition tuple.hpp:13
TUPLET_INLINE constexpr auto make_tuple(Ts &&... args)
Definition tuplet.hpp:1062