// AffineGapPenalty: the score of a gap of Length positions under an affine // gap model (Gotoh, 1982): Open for the first position and Extend for each // one after it. When Open is more negative than Extend, one long gap scores // better than several short gaps of the same total length. With // Open == Extend it is the linear model. FUNCTION AffineGapPenalty(Length : INTEGER, Open : INTEGER, Extend : INTEGER) RETURNS INTEGER REQUIRE Length >= 1 ENSURE RESULT == Open + (Length - 1) * Extend RETURN Open + (Length - 1) * Extend ENDFUNCTION