INNER CODE UNIT · C++
diff_saturation_16
torognes/swarm · src/cli.cpp:795
int64_t const diff_saturation_16 = std::min((max_reliable_score_16 / parameters.penalty_mismatch),
(max_reliable_score_16 - parameters.penalty_gapopen)
/ parameters.penalty_gapextend);
// diff_saturation_16 may be negative (its score_ceiling_16 - penalty_gapopen
// term underflows for large gap penalties), which means the scoring
// system is already saturated; compare as signed so opt_differences
// (0..255) correctly exceeds any negative saturation value.
if (static_cast<int64_t>(parameters.opt_differences) > diff_saturation_16) {
fatal("Resolution (d) too high for the given scoring system.");
}
if (parameters.penalty_mismatch > uint8_max) {
fatal("Alignment scoring system yielded a mismatch penalty greater than 255, "
"please use different parameter values.");
}
}