printf ("del = %d\n", sign * ct);
if  (Verbose > 2) printf ("del = %d\n", sign * ct);
void  Global_Align    (const char * s, int s_len, const char * t, int t_lo, int t_hi,     int match_score, int mismatch_score, int indel_score,     int gap_score, Alignment_t & align)//  Find the best global alignment of the entire string  s  to a//  substring of  t  between postions  t_lo  and  t_hi .//  The length of  s  is  s_len  and the length of  t  is at least//   t_hi .  The resulting alignment is stored in  align ,//  where  s  is the  a  string and  t  is the  b  string.//   match_score  is the score for matching characters (positive);//   mismatch_score  the score for aligning different characters (negative);//   indel_score  the score for insertions/deletions (negative);//  and  gap_score  the extra penalty for starting a gap (negative).  {   vector < vector <Align_Score_Entry_t> > a;  // the alignment array   vector <Align_Score_Entry_t>  empty_vector;   vector <int>  delta;   Align_Score_Entry_t  entry;   int  r, c;    // row and column   int  max_row, max_score;   unsigned int  max_from;   int  ct, sign;   int  i, n;  // position in string  t   assert (t_lo <= t_hi);   assert (0 <= s_len );   // Do first row   a . push_back (empty_vector);   entry . diag_score = entry . top_score = entry . left_score = 0;   entry . diag_from = entry . top_from = entry . left_from = FROM_NOWHERE;   r = 0;   a [r] . push_back (entry);   for  (c = 1;  c <= s_len;  c ++)     {      entry . top_score = NEG_INFTY_SCORE;      entry . top_from = FROM_NOWHERE;      entry . diag_score = NEG_INFTY_SCORE;      entry . diag_from = FROM_NOWHERE;      entry . left_score = a [r] [c - 1] . left_score + indel_score;      if  (c == 1)          entry . left_score += gap_score;      entry . left_from = FROM_LEFT;      a [r] . push_back (entry);     }   entry . Get_Max (max_score, max_from);   max_row = 0;        // Do remaining rows   for  (i = t_lo;  i < t_hi;  i ++)     {      int  mxs;      unsigned int  mxf;      r ++;      // First column in row      a . push_back (empty_vector);      entry . diag_score = entry . left_score = NEG_INFTY_SCORE;      entry . top_score = 0;      entry . diag_from = entry . top_from = entry . left_from = FROM_NOWHERE;      a [r] . push_back (entry);      // Remaining columns in row      for  (c = 1;  c <= s_len;  c ++)        {         Align_Score_Entry_t  * p;         p = & (a [r - 1] [c]);         p -> Get_Max (mxs, mxf);         if  (mxf != FROM_TOP)             mxs += gap_score;         mxs += indel_score;         entry . top_score = mxs;         entry . top_from = mxf;         p = & (a [r - 1] [c - 1]);         if  (p -> left_score < p -> diag_score)             {              entry . diag_score = p -> diag_score;              entry . diag_from = FROM_DIAG;             }           else             {              entry . diag_score = p -> left_score;              entry . diag_from = FROM_LEFT;             }         if  (entry . diag_score < p -> top_score)             {              entry . diag_score = p -> top_score;              entry . diag_from = FROM_TOP;             }         entry . diag_score += ((t [i] == s [c - 1]) ? match_score : mismatch_score);         p = & (a [r] [c - 1]);         if  (p -> left_score < p -> diag_score)             {              entry . left_score = p -> diag_score + gap_score;              entry . left_from = FROM_DIAG;             }           else             {              entry . left_score = p -> left_score;   // Don't add gap_score here              entry . left_from = FROM_LEFT;             }         if  (entry . left_score < p -> top_score)             {              entry . left_score = p -> top_score + gap_score;              entry . left_from = FROM_TOP;             }         entry . left_score += indel_score;         a [r] . push_back (entry);#if  0entry . Get_Max (mxs, mxf);printf ("r = %d  c = %d  mxs = %d  mxf = %u  max_score = %d  max_row = %d\n",     r, c, mxs, mxf, max_score, max_row);printf ("L = %d:%u  D = %d:%u  T = %d:%u\n", entry . left_score, entry . left_from,     entry . diag_score, entry . diag_from, entry . top_score, entry . top_from);#endif        }      entry . Get_Max (mxs, mxf);      if  (mxs > max_score)          {           max_score = mxs;           max_from = mxf;           max_row = r;          }     }   r = max_row;   c = s_len;   ct = 0;   sign = 0;   while  (c > 0)     {#if  0{ int  mxs; unsigned int  mxf; a [r] [c] . Get_Max (mxs, mxf); printf ("r = %d  c = %d  mxs = %d  mxf = %u\n", r, c, mxs, mxf); printf ("sign = %d  ct = %d\n", sign, ct);}#endif      switch  (max_from)        {         case  FROM_LEFT :           if  (sign != 0)               {                printf ("del = %d\n", sign * ct);                delta . push_back (sign * ct);               }           ct = 1;           sign = -1;           max_from = a [r] [c] . left_from;           c --;           break;         case  FROM_DIAG :           ct ++;           max_from = a [r] [c] . diag_from;           r --;           c --;           break;         case  FROM_TOP :           if  (sign != 0)               {                printf ("del = %d\n", sign * ct);                delta . push_back (sign * ct);               }           ct = 1;           sign = 1;           max_from = a [r] [c] . top_from;           r --;           break;         default :           sprintf (Clean_Exit_Msg_Line, "ERROR:  Bad from = %u in Global_Align",                max_from);           Clean_Exit (Clean_Exit_Msg_Line, __FILE__, __LINE__);        }     }   if  (sign != 0)       {        printf ("del = %d\n", sign * ct);        delta . push_back (sign * ct);       }   align . a_lo = 0;   align . a_hi = s_len;   align . b_hi = max_row + t_lo;   align . b_lo = r + t_lo;   reverse (delta . begin (), delta . end ());   n = delta . size ();   for  (i = 0;  i < n;  i ++)     printf ("delta [%d] = %d\n", i, delta [i]);   align . setDelta (delta);   return;  }