3#include <gtest/gtest.h>
7#include "../bool/bool.hpp"
8#include "../circuit_builders/circuit_builders.hpp"
31TEST(DynamicArray, TagCorrectness)
35 const size_t max_size = 4;
62 array.
write(0, entry_2);
79TEST(DynamicArray, DynamicArrayReadWriteConsistency)
83 const size_t max_size = 10;
87 for (
size_t i = 0; i < max_size; ++i) {
93 for (
size_t i = 0; i < max_size; ++i) {
98 array.
resize(max_size - 1, 7);
101 for (
size_t i = 0; i < max_size - 1; ++i) {
119 EXPECT_EQ(verified,
true);
static bool check(const Builder &circuit)
Check the witness satisifies the circuit.
A dynamic array of field elements.
void conditional_pop(const bool_pt &predicate)
Conditionallhy pop a field element off of the dynamic array.
void write(const field_pt &index, const field_pt &value)
Write a field element into the dynamic array at an index value.
void resize(const field_pt &new_length, const field_pt default_value=0)
Resize array. Current method v. inefficient!
void push(const field_pt &index)
Push a field element onto the dynamic array.
field_pt read(const field_pt &index) const
Read a field element from the dynamic array at an index value.
void pop()
Pop a field element off of the dynamic array.
void conditional_push(const bool_pt &predicate, const field_pt &index)
Conditionally push a field element onto the dynamic array.
size_t native_size() const
Implements boolean logic in-circuit.
OriginTag get_origin_tag() const
bb::fr get_value() const
Given a := *this, compute its value given by a.v * a.mul + a.add.
static field_t from_witness(Builder *ctx, const bb::fr &input)
void set_origin_tag(const OriginTag &new_tag) const
stdlib::witness_t< Builder > witness_ct
RNG & get_debug_randomness(bool reset, std::uint_fast64_t seed)
Entry point for Barretenberg command-line interface.
TEST(MegaCircuitBuilder, CopyConstructor)
UltraCircuitBuilder_< UltraExecutionTraceBlocks > UltraCircuitBuilder
This file contains part of the logic for the Origin Tag mechanism that tracks the use of in-circuit p...
#define STANDARD_TESTING_TAGS
static field random_element(numeric::RNG *engine=nullptr) noexcept