mirror of
https://github.com/cberner/raptorq.git
synced 2024-06-29 18:21:43 +00:00
Optimize mul_row() implementation
This commit is contained in:
parent
a20f894c52
commit
5e2c7a9077
@ -16,6 +16,7 @@ use util::get_both_indices;
|
||||
use petgraph::prelude::*;
|
||||
use petgraph::algo::condensation;
|
||||
use arraymap::UsizeArrayMap;
|
||||
use octets::mulassign_scalar;
|
||||
|
||||
// As defined in section 3.2
|
||||
#[derive(Clone)]
|
||||
@ -820,11 +821,7 @@ impl IntermediateSymbolDecoder {
|
||||
fn mul_row(&mut self, i: usize, beta: Octet) {
|
||||
self.debug_symbol_mul_ops += 1;
|
||||
self.D[self.d[i]].mulassign_scalar(&beta);
|
||||
for j in 0..self.A.width() {
|
||||
// TODO: use SIMD
|
||||
let temp = &self.A.get(i, j) * β
|
||||
self.A.set(i, j, temp);
|
||||
}
|
||||
mulassign_scalar(self.A.get_row_mut(i), &beta);
|
||||
}
|
||||
|
||||
fn fma_rows(&mut self, i: usize, iprime: usize, beta: Octet) {
|
||||
|
@ -40,6 +40,10 @@ impl OctetMatrix {
|
||||
&self.elements[i]
|
||||
}
|
||||
|
||||
pub fn get_row_mut(&mut self, i: usize) -> &mut Vec<u8> {
|
||||
&mut self.elements[i]
|
||||
}
|
||||
|
||||
pub fn get(&self, i: usize, j: usize) -> Octet {
|
||||
Octet::new(self.elements[i][j])
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user