Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions halo2-base/src/gates/tests/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,15 +57,15 @@ pub fn inner_product_with_sums_ground_truth<F: ScalarField>(
input: &(Vec<QuantumCell<F>>, Vec<QuantumCell<F>>),
) -> Vec<F> {
let (a, b) = &input;
let mut result = Vec::new();
let mut sum = F::ZERO;
// TODO: convert to fold
for (ai, bi) in a.iter().zip(b) {
let product = *ai.value() * *bi.value();
sum += product;
result.push(sum);
}
result
a.iter()
.zip(b)
.map(|(ai, bi)| {
let product = *ai.value() * *bi.value();
sum += product;
sum
})
.collect()
}

pub fn sum_products_with_coeff_and_var_ground_truth<F: ScalarField>(
Expand Down