+ /* The edit_count is only ever increased. The computation can be aborted
+ when
+ (xvec_length + yvec_length - edit_count) / (xvec_length + yvec_length)
+ < lower_bound,
+ or equivalently
+ edit_count > (xvec_length + yvec_length) * (1 - lower_bound)
+ or equivalently
+ edit_count > floor((xvec_length + yvec_length) * (1 - lower_bound)).
+ We need to add an epsilon inside the floor(...) argument, to neutralize
+ rounding errors. */
+ ctxt.edit_count_limit =
+ (lower_bound < 1.0
+ ? (int) ((xvec_length + yvec_length) * (1.0 - lower_bound + 0.000001))
+ : 0);
+