Barretenberg
The ZK-SNARK library at the core of Aztec
Loading...
Searching...
No Matches
bb::VectorField< Params > Struct Template Reference

#include <vector_field.hpp>

Public Types

using Field = field< Params >
 
using scalar_type = Field
 
using View = VectorField
 
using CoefficientAccumulator = VectorField
 

Public Member Functions

constexpr VectorField () noexcept=default
 
 VectorField (const std::array< Field, 5 > &in) noexcept
 
 VectorField (const Field &s) noexcept
 
 VectorField (int s) noexcept
 
 VectorField (uint64_t s) noexcept
 
VectorField sqr () const noexcept
 
void self_sqr () noexcept
 
VectorField operator- () const noexcept
 
VectorField invert () const noexcept
 
 VectorField (const Field *base) noexcept
 
void store_to (Field *base) const noexcept
 
std::array< Field, 5 > to_array () const noexcept
 
Field horizontal_sum () const noexcept
 
Field get (size_t i) const noexcept
 
void set (size_t i, const Field &v) noexcept
 
VectorField operator+ (const VectorField &other) const noexcept
 
VectorField operator- (const VectorField &other) const noexcept
 
VectorField operator* (const VectorField &other) const noexcept
 
VectorFieldoperator+= (const VectorField &other) noexcept
 
VectorFieldoperator-= (const VectorField &other) noexcept
 
VectorFieldoperator*= (const VectorField &other) noexcept
 
void scatter (Field *base, std::array< size_t, 5 > idx, size_t offset=0) const noexcept
 
void store_contiguous (Field *base) const noexcept
 
uint32_t eq_mask (const VectorField &other) const noexcept
 
uint32_t is_zero_mask () const noexcept
 
bool eq (const VectorField &other) const noexcept
 
bool is_zero () const noexcept
 

Static Public Member Functions

static VectorField zero () noexcept
 
static VectorField one () noexcept
 
static VectorField gather (const Field *base, std::array< size_t, 5 > idx, size_t offset=0) noexcept
 
template<typename Fn >
static VectorField from_lanes (const Fn &value_at) noexcept
 
static VectorField load_contiguous (const Field *base) noexcept
 
static VectorField broadcast (const Field &s) noexcept
 

Public Attributes

Field elts [5]
 

Static Public Attributes

static constexpr size_t SIZE = 5
 
static constexpr auto modulus = Field::modulus
 
static constexpr std::array< uint64_t, 9 > P_WASM
 
static constexpr std::array< uint64_t, 9 > TWOP_WASM = compute_twice_modulus_wasm<Params>()
 
static constexpr std::array< uint64_t, 9 > TNM_WASM = compute_tnm_wasm<Params>()
 
static constexpr uint64_t R_INV_MOD_2_29 = Params::r_inv & 0x1fffffffULL
 
static constexpr std::array< uint64_t, 9 > R_INV_WASM
 

Private Member Functions

void store_from_array (const std::array< Field, 5 > &in) noexcept
 
void load_to_array (std::array< Field, 5 > &out) const noexcept
 

Friends

VectorField operator+ (VectorField v, const Field &s) noexcept
 
VectorField operator+ (const Field &s, VectorField v) noexcept
 
VectorField operator- (VectorField v, const Field &s) noexcept
 
VectorField operator- (const Field &s, VectorField v) noexcept
 
VectorField operator* (VectorField v, const Field &s) noexcept
 
VectorField operator* (const Field &s, VectorField v) noexcept
 

Detailed Description

template<class Params>
struct bb::VectorField< Params >

Definition at line 132 of file vector_field.hpp.

Member Typedef Documentation

◆ CoefficientAccumulator

template<class Params >
using bb::VectorField< Params >::CoefficientAccumulator = VectorField

Definition at line 138 of file vector_field.hpp.

◆ Field

template<class Params >
using bb::VectorField< Params >::Field = field<Params>

Definition at line 133 of file vector_field.hpp.

◆ scalar_type

template<class Params >
using bb::VectorField< Params >::scalar_type = Field

Definition at line 134 of file vector_field.hpp.

◆ View

Definition at line 137 of file vector_field.hpp.

Constructor & Destructor Documentation

◆ VectorField() [1/6]

template<class Params >
constexpr bb::VectorField< Params >::VectorField ( )
constexprdefaultnoexcept

◆ VectorField() [2/6]

template<class Params >
bb::VectorField< Params >::VectorField ( const std::array< Field, 5 > &  in)
inlineexplicitnoexcept

Definition at line 182 of file vector_field.hpp.

◆ VectorField() [3/6]

template<class Params >
bb::VectorField< Params >::VectorField ( const Field s)
inlinenoexcept

Definition at line 188 of file vector_field.hpp.

◆ VectorField() [4/6]

template<class Params >
bb::VectorField< Params >::VectorField ( int  s)
inlinenoexcept

Definition at line 189 of file vector_field.hpp.

◆ VectorField() [5/6]

template<class Params >
bb::VectorField< Params >::VectorField ( uint64_t  s)
inlinenoexcept

Definition at line 190 of file vector_field.hpp.

◆ VectorField() [6/6]

template<class Params >
bb::VectorField< Params >::VectorField ( const Field base)
inlineexplicitnoexcept

Definition at line 1322 of file vector_field.hpp.

Member Function Documentation

◆ broadcast()

template<class Params >
VectorField< Params > bb::VectorField< Params >::broadcast ( const Field s)
inlinestaticnoexcept

Definition at line 1346 of file vector_field.hpp.

◆ eq()

template<class Params >
bool bb::VectorField< Params >::eq ( const VectorField< Params > &  other) const
inlinenoexcept

Definition at line 381 of file vector_field.hpp.

◆ eq_mask()

template<class Params >
uint32_t bb::VectorField< Params >::eq_mask ( const VectorField< Params > &  other) const
inlinenoexcept

Definition at line 1385 of file vector_field.hpp.

◆ from_lanes()

template<class Params >
template<typename Fn >
static VectorField bb::VectorField< Params >::from_lanes ( const Fn value_at)
inlinestaticnoexcept

Definition at line 299 of file vector_field.hpp.

◆ gather()

template<class Params >
static VectorField bb::VectorField< Params >::gather ( const Field base,
std::array< size_t, 5 >  idx,
size_t  offset = 0 
)
inlinestaticnoexcept

Definition at line 287 of file vector_field.hpp.

◆ get()

template<class Params >
Field bb::VectorField< Params >::get ( size_t  i) const
inlinenoexcept

Definition at line 242 of file vector_field.hpp.

◆ horizontal_sum()

template<class Params >
Field bb::VectorField< Params >::horizontal_sum ( ) const
inlinenoexcept

Definition at line 229 of file vector_field.hpp.

◆ invert()

template<class Params >
VectorField bb::VectorField< Params >::invert ( ) const
inlinenoexcept

Definition at line 200 of file vector_field.hpp.

◆ is_zero()

template<class Params >
bool bb::VectorField< Params >::is_zero ( ) const
inlinenoexcept

Definition at line 382 of file vector_field.hpp.

◆ is_zero_mask()

template<class Params >
uint32_t bb::VectorField< Params >::is_zero_mask ( ) const
inlinenoexcept

Definition at line 1396 of file vector_field.hpp.

◆ load_contiguous()

template<class Params >
VectorField< Params > bb::VectorField< Params >::load_contiguous ( const Field base)
inlinestaticnoexcept

Definition at line 1329 of file vector_field.hpp.

◆ load_to_array()

template<class Params >
void bb::VectorField< Params >::load_to_array ( std::array< Field, 5 > &  out) const
inlineprivatenoexcept

Definition at line 1315 of file vector_field.hpp.

◆ one()

template<class Params >
static VectorField bb::VectorField< Params >::one ( )
inlinestaticnoexcept

Definition at line 193 of file vector_field.hpp.

◆ operator*()

template<class Params >
VectorField< Params > bb::VectorField< Params >::operator* ( const VectorField< Params > &  other) const
inlinenoexcept

Definition at line 1376 of file vector_field.hpp.

◆ operator*=()

template<class Params >
VectorField & bb::VectorField< Params >::operator*= ( const VectorField< Params > &  other)
inlinenoexcept

Definition at line 273 of file vector_field.hpp.

◆ operator+()

template<class Params >
VectorField< Params > bb::VectorField< Params >::operator+ ( const VectorField< Params > &  other) const
inlinenoexcept

Definition at line 1356 of file vector_field.hpp.

◆ operator+=()

template<class Params >
VectorField & bb::VectorField< Params >::operator+= ( const VectorField< Params > &  other)
inlinenoexcept

Definition at line 263 of file vector_field.hpp.

◆ operator-() [1/2]

template<class Params >
VectorField bb::VectorField< Params >::operator- ( ) const
inlinenoexcept

Definition at line 197 of file vector_field.hpp.

◆ operator-() [2/2]

template<class Params >
VectorField< Params > bb::VectorField< Params >::operator- ( const VectorField< Params > &  other) const
inlinenoexcept

Definition at line 1366 of file vector_field.hpp.

◆ operator-=()

template<class Params >
VectorField & bb::VectorField< Params >::operator-= ( const VectorField< Params > &  other)
inlinenoexcept

Definition at line 268 of file vector_field.hpp.

◆ scatter()

template<class Params >
void bb::VectorField< Params >::scatter ( Field base,
std::array< size_t, 5 >  idx,
size_t  offset = 0 
) const
inlinenoexcept

Definition at line 309 of file vector_field.hpp.

◆ self_sqr()

template<class Params >
void bb::VectorField< Params >::self_sqr ( )
inlinenoexcept

Definition at line 196 of file vector_field.hpp.

◆ set()

template<class Params >
void bb::VectorField< Params >::set ( size_t  i,
const Field v 
)
inlinenoexcept

Definition at line 247 of file vector_field.hpp.

◆ sqr()

template<class Params >
VectorField bb::VectorField< Params >::sqr ( ) const
inlinenoexcept

Definition at line 195 of file vector_field.hpp.

◆ store_contiguous()

template<class Params >
void bb::VectorField< Params >::store_contiguous ( Field base) const
inlinenoexcept

Definition at line 1334 of file vector_field.hpp.

◆ store_from_array()

template<class Params >
void bb::VectorField< Params >::store_from_array ( const std::array< Field, 5 > &  in)
inlineprivatenoexcept

Definition at line 1308 of file vector_field.hpp.

◆ store_to()

template<class Params >
void bb::VectorField< Params >::store_to ( Field base) const
inlinenoexcept

Definition at line 1341 of file vector_field.hpp.

◆ to_array()

template<class Params >
std::array< Field, 5 > bb::VectorField< Params >::to_array ( ) const
inlinenoexcept

Definition at line 222 of file vector_field.hpp.

◆ zero()

template<class Params >
static VectorField bb::VectorField< Params >::zero ( )
inlinestaticnoexcept

Definition at line 192 of file vector_field.hpp.

Friends And Related Symbol Documentation

◆ operator* [1/2]

template<class Params >
VectorField operator* ( const Field s,
VectorField< Params v 
)
friend

Definition at line 368 of file vector_field.hpp.

◆ operator* [2/2]

template<class Params >
VectorField operator* ( VectorField< Params v,
const Field s 
)
friend

Definition at line 364 of file vector_field.hpp.

◆ operator+ [1/2]

template<class Params >
VectorField operator+ ( const Field s,
VectorField< Params v 
)
friend

Definition at line 352 of file vector_field.hpp.

◆ operator+ [2/2]

template<class Params >
VectorField operator+ ( VectorField< Params v,
const Field s 
)
friend

Definition at line 348 of file vector_field.hpp.

◆ operator- [1/2]

template<class Params >
VectorField operator- ( const Field s,
VectorField< Params v 
)
friend

Definition at line 360 of file vector_field.hpp.

◆ operator- [2/2]

template<class Params >
VectorField operator- ( VectorField< Params v,
const Field s 
)
friend

Definition at line 356 of file vector_field.hpp.

Member Data Documentation

◆ elts

template<class Params >
Field bb::VectorField< Params >::elts[5]

Definition at line 174 of file vector_field.hpp.

◆ modulus

template<class Params >
constexpr auto bb::VectorField< Params >::modulus = Field::modulus
staticconstexpr

Definition at line 140 of file vector_field.hpp.

◆ P_WASM

template<class Params >
constexpr std::array<uint64_t, 9> bb::VectorField< Params >::P_WASM
staticconstexpr
Initial value:
= { Params::modulus_wasm_0, Params::modulus_wasm_1,
Params::modulus_wasm_2, Params::modulus_wasm_3,
Params::modulus_wasm_4, Params::modulus_wasm_5,
Params::modulus_wasm_6, Params::modulus_wasm_7,
Params::modulus_wasm_8 }

Definition at line 150 of file vector_field.hpp.

◆ R_INV_MOD_2_29

template<class Params >
constexpr uint64_t bb::VectorField< Params >::R_INV_MOD_2_29 = Params::r_inv & 0x1fffffffULL
staticconstexpr

Definition at line 158 of file vector_field.hpp.

◆ R_INV_WASM

template<class Params >
constexpr std::array<uint64_t, 9> bb::VectorField< Params >::R_INV_WASM
staticconstexpr
Initial value:
= {
Params::r_inv_wasm_0, Params::r_inv_wasm_1, Params::r_inv_wasm_2, Params::r_inv_wasm_3, Params::r_inv_wasm_4,
Params::r_inv_wasm_5, Params::r_inv_wasm_6, Params::r_inv_wasm_7, Params::r_inv_wasm_8
}

Definition at line 159 of file vector_field.hpp.

◆ SIZE

template<class Params >
constexpr size_t bb::VectorField< Params >::SIZE = 5
staticconstexpr

Definition at line 139 of file vector_field.hpp.

◆ TNM_WASM

template<class Params >
constexpr std::array<uint64_t, 9> bb::VectorField< Params >::TNM_WASM = compute_tnm_wasm<Params>()
staticconstexpr

Definition at line 156 of file vector_field.hpp.

◆ TWOP_WASM

template<class Params >
constexpr std::array<uint64_t, 9> bb::VectorField< Params >::TWOP_WASM = compute_twice_modulus_wasm<Params>()
staticconstexpr

Definition at line 155 of file vector_field.hpp.


The documentation for this struct was generated from the following file: