本文整理汇总了C++中TRange::Set方法的典型用法代码示例。如果您正苦于以下问题:C++ TRange::Set方法的具体用法?C++ TRange::Set怎么用?C++ TRange::Set使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TRange
的用法示例。
在下文中一共展示了TRange::Set方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: min
/// Update the extent of a sequence that figures into its self
/// score, based upon the sequence ranges of a pairwise alignment
/// @param seq1 The current sequence range [in/out]
/// @param align1 The range of the current alignment on sequence 1
/// @param seq1_length Length of sequence 1
/// @param align2 The range of the current alignment on sequence 2
/// @param seq2_length Length of sequence 2
///
static void
x_UpdateRanges(TRange& seq1,
TRange align1,
int seq1_length,
TRange align2,
int seq2_length)
{
// extend the alignment bounds to the left and right
// until one sequence runs out.
TOffset first = min(seq1.GetFrom(), align1.GetFrom() - align2.GetFrom());
first = max(first, 0);
TOffset second = max(seq1.GetTo(),
align1.GetTo() + (seq2_length - 1 - align2.GetTo()));
second = min(second, seq1_length - 1);
seq1.Set(first, second);
}