mirror of
https://github.com/cberner/raptorq.git
synced 2024-06-29 18:21:43 +00:00
Fix bad optimization in sparse matrix
Note: setting zero isn't a no-op, since there might be a non-zero value already
This commit is contained in:
parent
fca4f14c06
commit
e53e82d785
@ -134,7 +134,9 @@ pub fn generate_constraint_matrix<T: OctetMatrix>(
|
||||
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));
|
||||
if g_hdpc.get(i, j) != Octet::zero() {
|
||||
matrix.set(i + S, j, g_hdpc.get(i, j));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -441,9 +441,6 @@ impl OctetMatrix for SparseOctetMatrix {
|
||||
}
|
||||
|
||||
fn set(&mut self, i: usize, j: usize, value: Octet) {
|
||||
if value == Octet::zero() {
|
||||
return;
|
||||
}
|
||||
self.elements[i].insert(j, value);
|
||||
if !self.columns_frozen {
|
||||
self.column_index[j].insert(i, ());
|
||||
|
Loading…
Reference in New Issue
Block a user