devela::_dep::stringzilla::sz

Function unary_substitution_costs

pub fn unary_substitution_costs() -> [[i8; 256]; 256]
Available on crate feature dep_stringzilla only.
Expand description

Generates a default substitution matrix for use with the Needleman-Wunsch alignment algorithm. This matrix is initialized such that diagonal entries (representing matching characters) are zero, and off-diagonal entries (representing mismatches) are -1. This setup effectively produces distances equal to the negative Levenshtein edit distance, suitable for basic sequence alignment tasks where all mismatches are penalized equally and there are no rewards for matches.

ยงReturns

A 256x256 array of i8, where each element represents the substitution cost between two characters (byte values). Matching characters are assigned a cost of 0, and non-matching characters are assigned a cost of -1.