mirror of https://github.com/zcash/halo2.git
Merge pull request #237 from zcash/dev-permutation-any-cols
Minor fixes to dev tools
This commit is contained in:
commit
78c394645d
|
@ -382,7 +382,11 @@ impl<F: FieldExt> MockProver<F> {
|
|||
let original = self.cs.permutations[perm_index]
|
||||
.get_columns()
|
||||
.iter()
|
||||
.map(|c| self.advice[c.index()].clone())
|
||||
.map(|c| match c.column_type() {
|
||||
Any::Advice => self.advice[c.index()].clone(),
|
||||
Any::Fixed => self.fixed[c.index()].clone(),
|
||||
Any::Instance => self.instance[c.index()].clone(),
|
||||
})
|
||||
.collect::<Vec<_>>();
|
||||
|
||||
// Iterate over each column of the permutation
|
||||
|
|
|
@ -187,9 +187,19 @@ impl Layout {
|
|||
if let Some(region) = self.current_region {
|
||||
let region = &mut self.regions[region];
|
||||
region.columns.insert(column);
|
||||
let offset = region.offset.unwrap_or(row);
|
||||
|
||||
// The region offset is the earliest row assigned to.
|
||||
let mut offset = region.offset.unwrap_or(row);
|
||||
if row < offset {
|
||||
// The first row assigned was not at offset 0 within the region.
|
||||
region.rows += offset - row;
|
||||
offset = row;
|
||||
}
|
||||
// The number of rows in this region is the gap between the earliest and
|
||||
// latest rows assigned.
|
||||
region.rows = cmp::max(region.rows, row - offset + 1);
|
||||
region.offset = Some(offset);
|
||||
|
||||
region.cells.push((column, row));
|
||||
} else {
|
||||
self.loose_cells.push((column, row));
|
||||
|
|
Loading…
Reference in New Issue