Barretenberg
The ZK-SNARK library at the core of Aztec
Loading...
Searching...
No Matches
bb::ZeroSelector< FF > Class Template Reference

Selector specialization that only allows zeros. More...

#include <execution_trace_block.hpp>

Inheritance diagram for bb::ZeroSelector< FF >:
bb::Selector< FF >

Public Member Functions

void emplace_back (int value) override
 Append an integer value to the selector.
 
void push_back (const FF &value) override
 Push a field element to the selector.
 
void set_back (int value) override
 Set the last value using integer.
 
void set (size_t idx, int value) override
 Set the value at index using integer.
 
void set (size_t idx, const FF &value) override
 Set the value at index using a field element.
 
void resize (size_t new_size) override
 Resize the selector.
 
bool operator== (const ZeroSelector &other) const
 
const FFoperator[] (size_t index) const override
 Get value at specified index.
 
const FFback () const override
 Get the last value in the selector.
 
size_t size () const override
 Get the number of elements.
 
bool empty () const override
 Check if the selector is empty.
 
- Public Member Functions inherited from bb::Selector< FF >
 Selector ()=default
 
virtual ~Selector ()=default
 
 Selector (const Selector &)=default
 
Selectoroperator= (const Selector &)=default
 
 Selector (Selector &&)=delete
 
Selectoroperator= (Selector &&)=delete
 
void emplace_back (const FF &value)
 Append a field element to the selector.
 

Private Attributes

size_t size_ = 0
 

Static Private Attributes

static constexpr FF zero = 0
 

Detailed Description

template<typename FF>
class bb::ZeroSelector< FF >

Selector specialization that only allows zeros.

Efficient representation for selectors that are guaranteed to be zero everywhere.

Template Parameters
FFThe finite field element type.

Definition at line 132 of file execution_trace_block.hpp.

Member Function Documentation

◆ back()

template<typename FF >
const FF & bb::ZeroSelector< FF >::back ( ) const
inlineoverridevirtual

Get the last value in the selector.

Returns
Reference to the last field element.

Implements bb::Selector< FF >.

Definition at line 177 of file execution_trace_block.hpp.

◆ emplace_back()

template<typename FF >
void bb::ZeroSelector< FF >::emplace_back ( int  value)
inlineoverridevirtual

Append an integer value to the selector.

Parameters
valueMust be convertible to FF.

Implements bb::Selector< FF >.

Definition at line 136 of file execution_trace_block.hpp.

◆ empty()

template<typename FF >
bool bb::ZeroSelector< FF >::empty ( ) const
inlineoverridevirtual

Check if the selector is empty.

Implements bb::Selector< FF >.

Definition at line 181 of file execution_trace_block.hpp.

◆ operator==()

template<typename FF >
bool bb::ZeroSelector< FF >::operator== ( const ZeroSelector< FF > &  other) const
inline

Definition at line 169 of file execution_trace_block.hpp.

◆ operator[]()

template<typename FF >
const FF & bb::ZeroSelector< FF >::operator[] ( size_t  index) const
inlineoverridevirtual

Get value at specified index.

Parameters
indexIndex of the element.
Returns
Reference to the field element at index.

Implements bb::Selector< FF >.

Definition at line 171 of file execution_trace_block.hpp.

◆ push_back()

template<typename FF >
void bb::ZeroSelector< FF >::push_back ( const FF value)
inlineoverridevirtual

Push a field element to the selector.

Parameters
valueField element to add.

Implements bb::Selector< FF >.

Definition at line 142 of file execution_trace_block.hpp.

◆ resize()

template<typename FF >
void bb::ZeroSelector< FF >::resize ( size_t  new_size)
inlineoverridevirtual

Resize the selector.

Parameters
new_sizeThe new size.

Implements bb::Selector< FF >.

Definition at line 167 of file execution_trace_block.hpp.

◆ set() [1/2]

template<typename FF >
void bb::ZeroSelector< FF >::set ( size_t  idx,
const FF value 
)
inlineoverridevirtual

Set the value at index using a field element.

Parameters
idxIndex.
valueField element.

Implements bb::Selector< FF >.

Definition at line 160 of file execution_trace_block.hpp.

◆ set() [2/2]

template<typename FF >
void bb::ZeroSelector< FF >::set ( size_t  idx,
int  value 
)
inlineoverridevirtual

Set the value at index using integer.

Parameters
idxIndex.
valueInteger value.

Implements bb::Selector< FF >.

Definition at line 154 of file execution_trace_block.hpp.

◆ set_back()

template<typename FF >
void bb::ZeroSelector< FF >::set_back ( int  value)
inlineoverridevirtual

Set the last value using integer.

Parameters
valueInteger value.

Implements bb::Selector< FF >.

Definition at line 148 of file execution_trace_block.hpp.

◆ size()

template<typename FF >
size_t bb::ZeroSelector< FF >::size ( ) const
inlineoverridevirtual

Get the number of elements.

Implements bb::Selector< FF >.

Definition at line 179 of file execution_trace_block.hpp.

Member Data Documentation

◆ size_

template<typename FF >
size_t bb::ZeroSelector< FF >::size_ = 0
private

Definition at line 185 of file execution_trace_block.hpp.

◆ zero

template<typename FF >
constexpr FF bb::ZeroSelector< FF >::zero = 0
staticconstexprprivate

Definition at line 184 of file execution_trace_block.hpp.


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