mirror of
https://github.com/saymrwulf/pasta_curves-source.git
synced 2026-09-07 20:30:34 +00:00
Make RegionShape struct public
This commit is contained in:
parent
faf5da15c9
commit
2255fbec8b
1 changed files with 20 additions and 2 deletions
|
|
@ -138,21 +138,39 @@ impl<'a, C: Chip, CS: Assignment<C::Field> + 'a> Layouter<C> for SingleChip<'a,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// The shape of a region. For a region at a certain index, we track
|
||||||
|
/// the set of columns it uses as well as the number of rows it uses.
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
struct RegionShape {
|
pub struct RegionShape {
|
||||||
region_index: usize,
|
region_index: usize,
|
||||||
columns: HashSet<Column<Any>>,
|
columns: HashSet<Column<Any>>,
|
||||||
row_count: usize,
|
row_count: usize,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl RegionShape {
|
impl RegionShape {
|
||||||
fn new(region_index: usize) -> Self {
|
/// Create a new `RegionShape` for a region at `region_index`.
|
||||||
|
pub fn new(region_index: usize) -> Self {
|
||||||
RegionShape {
|
RegionShape {
|
||||||
region_index,
|
region_index,
|
||||||
columns: HashSet::default(),
|
columns: HashSet::default(),
|
||||||
row_count: 0,
|
row_count: 0,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Get the `region_index` of a `RegionShape`.
|
||||||
|
pub fn region_index(&self) -> usize {
|
||||||
|
self.region_index
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Get a reference to the set of `columns` used in a `RegionShape`.
|
||||||
|
pub fn columns(&self) -> &HashSet<Column<Any>> {
|
||||||
|
&self.columns
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Get the `row_count` of a `RegionShape`.
|
||||||
|
pub fn row_count(&self) -> usize {
|
||||||
|
self.row_count
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl<C: Chip> RegionLayouter<C> for RegionShape {
|
impl<C: Chip> RegionLayouter<C> for RegionShape {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue