mirror of
https://github.com/cberner/raptorq.git
synced 2024-06-29 18:21:43 +00:00
Add verification at beginning of second phase
This commit is contained in:
parent
3a3c22db5b
commit
4eb8340bbb
10
src/base.rs
10
src/base.rs
@ -382,6 +382,7 @@ impl IntermediateSymbolDecoder {
|
||||
// Second phase (section 5.4.2.3)
|
||||
#[allow(non_snake_case)]
|
||||
fn second_phase(&mut self) -> bool {
|
||||
self.second_phase_verify();
|
||||
let rows_to_discard = self.i..self.X.len();
|
||||
let cols_to_discard = self.i..self.X[0].len();
|
||||
self.X.drain(rows_to_discard);
|
||||
@ -402,6 +403,15 @@ impl IntermediateSymbolDecoder {
|
||||
return true;
|
||||
}
|
||||
|
||||
// Verifies that X is lower triangular. See section 5.4.2.3
|
||||
fn second_phase_verify(&self) {
|
||||
for row in 0..self.i {
|
||||
for col in (row + 1)..self.i {
|
||||
assert_eq!(Octet::zero(), self.X[row][col]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Third phase (section 5.4.2.4)
|
||||
#[allow(non_snake_case)]
|
||||
fn third_phase(&mut self) {
|
||||
|
Loading…
Reference in New Issue
Block a user