mirror of
https://github.com/cberner/raptorq.git
synced 2024-06-29 18:21:43 +00:00
Require borrowing for matmul
This commit is contained in:
parent
1f0a6639b4
commit
f20204d045
@ -122,7 +122,7 @@ pub fn generate_constraint_matrix<T:Iterator<Item=u32>>(source_block_symbols: u3
|
||||
}
|
||||
|
||||
// G_HDPC
|
||||
let g_hdpc = generate_mt(H, Kprime, S) * generate_gamma(Kprime, S);
|
||||
let g_hdpc = &generate_mt(H, Kprime, S) * &generate_gamma(Kprime, S);
|
||||
for i in 0..H {
|
||||
for j in 0..(Kprime + S) {
|
||||
matrix.set(i + S, j, g_hdpc.get(i, j));
|
||||
|
@ -103,10 +103,10 @@ impl OctetMatrix {
|
||||
}
|
||||
}
|
||||
|
||||
impl Mul for OctetMatrix {
|
||||
impl<'a, 'b> Mul<&'b OctetMatrix> for &'a OctetMatrix {
|
||||
type Output = OctetMatrix;
|
||||
|
||||
fn mul(self, rhs: OctetMatrix) -> OctetMatrix {
|
||||
fn mul(self, rhs: &'b OctetMatrix) -> OctetMatrix {
|
||||
assert_eq!(self.width, rhs.height);
|
||||
let mut result = OctetMatrix::new(self.height, rhs.width);
|
||||
for row in 0..self.height {
|
||||
@ -152,6 +152,6 @@ mod tests {
|
||||
a.set(i, j, Octet::new(rand::thread_rng().gen()));
|
||||
}
|
||||
}
|
||||
assert_eq!(a.clone(), identity * a.clone());
|
||||
assert_eq!(a, &identity * &a);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user