Skip to content

Commit 90ad85c

Browse files
committed
Fix matrix element ordering in trace data push for vector-matrix multiplication. Update loop indices to ensure correct column-major order and add debug print statement for matrix output.
1 parent 3b8dc9a commit 90ad85c

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

  • src/zklora/libs/plonky3/src

src/zklora/libs/plonky3/src/lib.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,8 +145,8 @@ impl<F: PrimeField> VectorMatrixMultiplicationAIR<F> {
145145

146146
/// Pushes the matrix elements to the trace data with column major order
147147
fn push_matrix(&self, trace_data: &mut Vec<F>, a: &RowMajorMatrix<F>) {
148-
for i in 0..self.m {
149-
for j in 0..self.n {
148+
for i in 0..self.n {
149+
for j in 0..self.m {
150150
trace_data.push(a.get(j, i).unwrap());
151151
}
152152
}
@@ -606,6 +606,8 @@ mod tests {
606606
3,
607607
);
608608

609+
println!("matrix: {:?}", matrix);
610+
609611
let air = VectorMatrixMultiplicationAIR::new(3, 3);
610612
let trace = air.generate_trace(&vector, &matrix);
611613
println!("trace width: {:?}", trace.width());

0 commit comments

Comments
 (0)