-
Notifications
You must be signed in to change notification settings - Fork 44
/
mod.rs
63 lines (52 loc) · 1.29 KB
/
mod.rs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
use std::ops::{Deref, DerefMut};
use self::fields::m31::BaseField;
pub mod air;
pub mod backend;
pub mod channel;
pub mod circle;
pub mod constraints;
pub mod fft;
pub mod fields;
pub mod fri;
pub mod lookups;
pub mod pcs;
pub mod poly;
pub mod proof_of_work;
pub mod prover;
pub mod queries;
#[cfg(test)]
pub mod test_utils;
pub mod utils;
pub mod vcs;
/// A vector in which each element relates (by index) to a column in the trace.
pub type ColumnVec<T> = Vec<T>;
/// A vector of [ColumnVec]s. Each [ColumnVec] relates (by index) to a component in the air.
#[derive(Debug)]
pub struct ComponentVec<T>(pub Vec<ColumnVec<T>>);
impl<T> ComponentVec<T> {
pub fn flatten(self) -> ColumnVec<T> {
self.0.into_iter().flatten().collect()
}
}
impl<T> ComponentVec<ColumnVec<T>> {
pub fn flatten_cols(self) -> Vec<T> {
self.0.into_iter().flatten().flatten().collect()
}
}
impl<T> Default for ComponentVec<T> {
fn default() -> Self {
Self(Vec::new())
}
}
impl<T> Deref for ComponentVec<T> {
type Target = Vec<ColumnVec<T>>;
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl<T> DerefMut for ComponentVec<T> {
fn deref_mut(&mut self) -> &mut Self::Target {
&mut self.0
}
}
pub struct InteractionElements(Vec<(String, BaseField)>);