Skip to content

Commit

Permalink
fix row end set and get
Browse files Browse the repository at this point in the history
  • Loading branch information
lorewar2 committed Nov 14, 2023
1 parent e586b24 commit 60e6bf3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/alignment/poa.rs
Original file line number Diff line number Diff line change
Expand Up @@ -173,15 +173,15 @@ impl Traceback {

fn set(&mut self, i: usize, j: usize, cell: TracebackCell) {
// set the matrix cell if in band range
if !(self.matrix[i].1 >= j || self.matrix[i].2 < j) {
if !(self.matrix[i].1 > j || self.matrix[i].2 <= j) {
let real_position = j - self.matrix[i].1;
self.matrix[i].0[real_position] = cell;
}
}

fn get(&self, i: usize, j: usize) -> &TracebackCell {
// get the matrix cell if in band range else return the appropriate values
if !(self.matrix[i].1 >= j || self.matrix[i].2 < j) {
if !(self.matrix[i].1 > j || self.matrix[i].2 <= j) {
let real_position = j - self.matrix[i].1;
return &self.matrix[i].0[real_position];
}
Expand Down

0 comments on commit 60e6bf3

Please sign in to comment.