pub struct Shape<K: Clone + Eq + Hash> {
pub inner: HashMap<K, usize>,
}
Expand description
A way to keep track of the log2 heights of some set of chips.
Fields§
§inner: HashMap<K, usize>
The nonzero log2 heights of each chip.
Implementations§
Source§impl<K: Clone + Eq + Hash + FromStr> Shape<K>
impl<K: Clone + Eq + Hash + FromStr> Shape<K>
Sourcepub fn from_log2_heights(log2_heights: &[(K, usize)]) -> Self
pub fn from_log2_heights(log2_heights: &[(K, usize)]) -> Self
Create a shape from a list of log2 heights.
Sourcepub fn from_traces<V: Clone + Send + Sync>(
traces: &[(K, RowMajorMatrix<V>)],
) -> Self
pub fn from_traces<V: Clone + Send + Sync>( traces: &[(K, RowMajorMatrix<V>)], ) -> Self
Create a shape from a list of traces.
Sourcepub fn log2_height(&self, key: &K) -> Option<usize>
pub fn log2_height(&self, key: &K) -> Option<usize>
Get the log2 height of a given key.
Sourcepub fn included<F: PrimeField, A: MachineAir<F>>(&self, air: &A) -> bool
pub fn included<F: PrimeField, A: MachineAir<F>>(&self, air: &A) -> bool
Whether the shape includes a given AIR.
TODO: Deprecate by adding air.id()
.
Sourcepub fn estimate_lde_size(&self, costs: &HashMap<K, usize>) -> usize
pub fn estimate_lde_size(&self, costs: &HashMap<K, usize>) -> usize
Estimate the lde size.
WARNING: This is a heuristic, it may not be completely accurate. To be 100% sure that they OOM, you should run the shape through the prover.
Trait Implementations§
Source§impl<'de, K> Deserialize<'de> for Shape<K>
impl<'de, K> Deserialize<'de> for Shape<K>
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl<K: Clone + Eq + Hash> Extend<(K, usize)> for Shape<K>
impl<K: Clone + Eq + Hash> Extend<(K, usize)> for Shape<K>
Source§fn extend<T: IntoIterator<Item = (K, usize)>>(&mut self, iter: T)
fn extend<T: IntoIterator<Item = (K, usize)>>(&mut self, iter: T)
Extends a collection with the contents of an iterator. Read more
Source§fn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
🔬This is a nightly-only experimental API. (
extend_one
)Extends a collection with exactly one element.
Source§fn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
🔬This is a nightly-only experimental API. (
extend_one
)Reserves capacity in a collection for the given number of additional elements. Read more
Source§impl<K: Clone + Eq + Hash> Extend<Shape<K>> for Shape<K>
impl<K: Clone + Eq + Hash> Extend<Shape<K>> for Shape<K>
Source§fn extend<T: IntoIterator<Item = Shape<K>>>(&mut self, iter: T)
fn extend<T: IntoIterator<Item = Shape<K>>>(&mut self, iter: T)
Extends a collection with the contents of an iterator. Read more
Source§fn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
🔬This is a nightly-only experimental API. (
extend_one
)Extends a collection with exactly one element.
Source§fn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
🔬This is a nightly-only experimental API. (
extend_one
)Reserves capacity in a collection for the given number of additional elements. Read more
Source§impl<K: Clone + Eq + Hash> PartialOrd for Shape<K>
impl<K: Clone + Eq + Hash> PartialOrd for Shape<K>
impl<K: Clone + Eq + Hash> StructuralPartialEq for Shape<K>
Auto Trait Implementations§
impl<K> Freeze for Shape<K>
impl<K> RefUnwindSafe for Shape<K>where
K: RefUnwindSafe,
impl<K> Send for Shape<K>where
K: Send,
impl<K> Sync for Shape<K>where
K: Sync,
impl<K> Unpin for Shape<K>where
K: Unpin,
impl<K> UnwindSafe for Shape<K>where
K: UnwindSafe,
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§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