fn gap_length<M : Fn(Nucleotide, Nucleotide)-> i64, C : Fn(i64)->i64>(x : &Vec<Vec<NwCell>>, i : usize, j : usize, _sub_matrix : Rc<M>, _cost_func : Rc<C>, s_or_t : bool) -> i64 {
        let mut gap_len = 1; 
        let mut i = i; 
        let mut j = j; 
        //Iterate through and test for current gaps. 
        if s_or_t == true {
            //Testing for gap in s. 
            loop{
                if i > 0 && x[i][j].gaps == (true, false) {
                    gap_len += 1; 
                    i -= 1; 
                } else {
                    return gap_len;
                }
            }
        }else {
            //Testing for gap in t. 
            loop{
                if j > 0 && x[i][j].gaps == (false, true) {
                    gap_len += 1; 
                    j -= 1; 
                } else {
                    return gap_len;
                }
            }
        }
    }
//Helper function for determening the gap length in the dynamic programming matrix for needleman wunsch. 
Helper function for determening the gap length in the dynamic programming matrix for needleman wunsch.
Helper function for determening the gap length in the dynamic programming matrix for needleman wunsch .
fn gap_length<M : Fn(Nucleotide, Nucleotide)-> i64, C : Fn(i64)->i64>(x : &Vec<Vec<NwCell>>, i : usize, j : usize, _sub_matrix : Rc<M>, _cost_func : Rc<C>, s_or_t : bool) -> i64 {
        let mut gap_len = 1; 
        let mut i = i; 
        let mut j = j; 
        //Iterate through and test for current gaps. 
        if s_or_t == true {
            //Testing for gap in s. 
            loop{
                if i > 0 && x[i][j].gaps == (true, false) {
                    gap_len += 1; 
                    i -= 1; 
                } else {
                    return gap_len;
                }
            }
        }else {
            //Testing for gap in t. 
            loop{
                if j > 0 && x[i][j].gaps == (false, true) {
                    gap_len += 1; 
                    j -= 1; 
                } else {
                    return gap_len;
                }
            }
        }
    }
fn gap_length < M : Fn ( Nucleotide , Nucleotide ) -> i64 , C : Fn ( i64 ) -> i64 > ( x : & Vec < Vec < NwCell > > , i : usize , j : usize , _sub_matrix : Rc < M > , _cost_func : Rc < C > , s_or_t : bool ) -> i64 { let mut gap_len = 1 ; let mut i = i ; let mut j = j ; //Iterate through and test for current gaps.  if s_or_t == true { //Testing for gap in s.  loop { if i > 0 && x [ i ] [ j ] . gaps == ( true , false ) { gap_len += 1 ; i -= 1 ; } else { return gap_len ; } } } else { //Testing for gap in t.  loop { if j > 0 && x [ i ] [ j ] . gaps == ( false , true ) { gap_len += 1 ; j -= 1 ; } else { return gap_len ; } } } }
Helper function for determening the gap length in the dynamic programming matrix for needleman wunsch.
Helper function for determening the gap length in the dynamic programming matrix for needleman wunsch .
x
&Vec<Vec<NwCell>>
i
usize
j
usize
_sub_matrix
Rc<M>
_cost_func
Rc<C>
s_or_t
bool
x
&Vec<Vec<NwCell>>
i
usize
j
usize
_sub_matrix
Rc<M>
_cost_func
Rc<C>
s_or_t
bool