pub struct CircuitInfo {
pub n_inputs: usize,
pub values: UnorderedHashMap<ConcreteTypeId, usize>,
pub add_offsets: Vec<GateOffsets>,
pub mul_offsets: Vec<GateOffsets>,
}
Expand description
Describes a circuit in the program.
Fields§
§n_inputs: usize
The number of circuit inputs.
values: UnorderedHashMap<ConcreteTypeId, usize>
Maps a concrete type to its offset (measured in number of elements) in the values array.
The values mapping does not include the constant input 1
which is stored at offset 0
.
add_offsets: Vec<GateOffsets>
The offsets for the add gates. This includes AddModGate and SubModGate.
mul_offsets: Vec<GateOffsets>
The offsets for the mul gates. This includes MulModGate, InverseGate, and input reductions.
Implementations§
source§impl CircuitInfo
impl CircuitInfo
sourcepub fn rc96_usage(&self) -> usize
pub fn rc96_usage(&self) -> usize
Returns the number of 96-bit range checks used by the circuit.
We use:
- 1 slot for the const 1,
n_inputs
slots for the original unreduced inputs,self.values.len()
for all the intermediate values and outputs (including the reduced inputs).
Trait Implementations§
source§impl Clone for CircuitInfo
impl Clone for CircuitInfo
source§fn clone(&self) -> CircuitInfo
fn clone(&self) -> CircuitInfo
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for CircuitInfo
impl Debug for CircuitInfo
source§impl PartialEq for CircuitInfo
impl PartialEq for CircuitInfo
impl Eq for CircuitInfo
impl StructuralPartialEq for CircuitInfo
Auto Trait Implementations§
impl Freeze for CircuitInfo
impl RefUnwindSafe for CircuitInfo
impl Send for CircuitInfo
impl Sync for CircuitInfo
impl Unpin for CircuitInfo
impl UnwindSafe for CircuitInfo
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more