src/bwamem.cpp
static inline int infer_bw(int l1, int l2, int score, int a, int q, int r)
{
	int w;
	if (l1 == l2 && l1 * a - score < (q + r - a)<<1) return 0; // to get equal alignment length, we need at least two gaps
	w = ((double)((l1 < l2? l1 : l2) * a - score - q) / r + 2.);
	if (w < abs(l1 - l2)) w = abs(l1 - l2);
	return w;
}
/*****************************
 * Basic hit->SAM conversion *
 *****************************/
Basic hit->SAM conversion
Basic hit - > SAM conversion
static inline int infer_bw(int l1, int l2, int score, int a, int q, int r)
{
	int w;
	if (l1 == l2 && l1 * a - score < (q + r - a)<<1) return 0; 
	w = ((double)((l1 < l2? l1 : l2) * a - score - q) / r + 2.);
	if (w < abs(l1 - l2)) w = abs(l1 - l2);
	return w;
}
static inline int infer_bw ( int l1 , int l2 , int score , int a , int q , int r ) { int w ; if ( l1 == l2 && l1 * a - score < ( q + r - a ) << 1 ) return 0 ; w = ( ( double ) ( ( l1 < l2 ? l1 : l2 ) * a - score - q ) / r + 2. ) ; if ( w < abs ( l1 - l2 ) ) w = abs ( l1 - l2 ) ; return w ; }
Basic hit->SAM conversion
Basic hit - > SAM conversion
// to get equal alignment length, we need at least two gaps
