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

Abstract interface for a generic selector. More...

#include <execution_trace_block.hpp>

Inheritance diagram for bb::Selector< FF >:
bb::SlabVectorSelector< fr > bb::SlabVectorSelector< bb::field > bb::ZeroSelector< bb::field > bb::SlabVectorSelector< FF > bb::ZeroSelector< FF >

Public Member Functions

 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.
 
virtual void emplace_back (int value)=0
 Append an integer value to the selector.
 
virtual void push_back (const FF &value)=0
 Push a field element to the selector.
 
virtual void resize (size_t new_size)=0
 Resize the selector.
 
virtual const FFoperator[] (size_t index) const =0
 Get value at specified index.
 
virtual const FFback () const =0
 Get the last value in the selector.
 
virtual size_t size () const =0
 Get the number of elements.
 
virtual bool empty () const =0
 Check if the selector is empty.
 
virtual void set (size_t idx, int value)=0
 Set the value at index using integer.
 
virtual void set_back (int value)=0
 Set the last value using integer.
 
virtual void set (size_t idx, const FF &value)=0
 Set the value at index using a field element.
 

Detailed Description

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

Abstract interface for a generic selector.

A selector holds field elements that represent gate enable signals in circuit constraints. This interface defines basic operations required for concrete selector implementations.

Template Parameters
FFThe finite field element type.

Definition at line 47 of file execution_trace_block.hpp.

Constructor & Destructor Documentation

◆ Selector() [1/3]

template<typename FF >
bb::Selector< FF >::Selector ( )
default

◆ ~Selector()

template<typename FF >
virtual bb::Selector< FF >::~Selector ( )
virtualdefault

◆ Selector() [2/3]

template<typename FF >
bb::Selector< FF >::Selector ( const Selector< FF > &  )
default

◆ Selector() [3/3]

template<typename FF >
bb::Selector< FF >::Selector ( Selector< FF > &&  )
delete

Member Function Documentation

◆ back()

template<typename FF >
virtual const FF & bb::Selector< FF >::back ( ) const
pure virtual

Get the last value in the selector.

Returns
Reference to the last field element.

Implemented in bb::ZeroSelector< FF >, bb::ZeroSelector< bb::field >, bb::SlabVectorSelector< FF >, bb::SlabVectorSelector< bb::field >, and bb::SlabVectorSelector< fr >.

◆ emplace_back() [1/2]

template<typename FF >
void bb::Selector< FF >::emplace_back ( const FF value)
inline

Append a field element to the selector.

Parameters
valueField element to append.

Definition at line 62 of file execution_trace_block.hpp.

◆ emplace_back() [2/2]

template<typename FF >
virtual void bb::Selector< FF >::emplace_back ( int  value)
pure virtual

Append an integer value to the selector.

Parameters
valueMust be convertible to FF.

Implemented in bb::SlabVectorSelector< FF >, bb::SlabVectorSelector< bb::field >, bb::SlabVectorSelector< fr >, bb::ZeroSelector< FF >, and bb::ZeroSelector< bb::field >.

◆ empty()

template<typename FF >
virtual bool bb::Selector< FF >::empty ( ) const
pure virtual

◆ operator=() [1/2]

template<typename FF >
Selector & bb::Selector< FF >::operator= ( const Selector< FF > &  )
default

◆ operator=() [2/2]

template<typename FF >
Selector & bb::Selector< FF >::operator= ( Selector< FF > &&  )
delete

◆ operator[]()

template<typename FF >
virtual const FF & bb::Selector< FF >::operator[] ( size_t  index) const
pure virtual

Get value at specified index.

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

Implemented in bb::SlabVectorSelector< FF >, bb::SlabVectorSelector< bb::field >, bb::SlabVectorSelector< fr >, bb::ZeroSelector< FF >, and bb::ZeroSelector< bb::field >.

◆ push_back()

template<typename FF >
virtual void bb::Selector< FF >::push_back ( const FF value)
pure virtual

Push a field element to the selector.

Parameters
valueField element to add.

Implemented in bb::ZeroSelector< FF >, bb::SlabVectorSelector< FF >, and bb::SlabVectorSelector< fr >.

◆ resize()

template<typename FF >
virtual void bb::Selector< FF >::resize ( size_t  new_size)
pure virtual

◆ set() [1/2]

template<typename FF >
virtual void bb::Selector< FF >::set ( size_t  idx,
const FF value 
)
pure virtual

Set the value at index using a field element.

Parameters
idxIndex.
valueField element.

Implemented in bb::ZeroSelector< FF >, bb::SlabVectorSelector< FF >, and bb::SlabVectorSelector< fr >.

◆ set() [2/2]

template<typename FF >
virtual void bb::Selector< FF >::set ( size_t  idx,
int  value 
)
pure virtual

Set the value at index using integer.

Parameters
idxIndex.
valueInteger value.

Implemented in bb::SlabVectorSelector< FF >, bb::SlabVectorSelector< bb::field >, bb::SlabVectorSelector< fr >, bb::ZeroSelector< FF >, and bb::ZeroSelector< bb::field >.

◆ set_back()

template<typename FF >
virtual void bb::Selector< FF >::set_back ( int  value)
pure virtual

Set the last value using integer.

Parameters
valueInteger value.

Implemented in bb::ZeroSelector< FF >, bb::ZeroSelector< bb::field >, bb::SlabVectorSelector< FF >, bb::SlabVectorSelector< bb::field >, and bb::SlabVectorSelector< fr >.

◆ size()

template<typename FF >
virtual size_t bb::Selector< FF >::size ( ) const
pure virtual

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