MODULE PZMismatch; (* Last edited on 1999-08-22 02:19:45 by hcgl *) IMPORT ParseParams; FROM PZTypes IMPORT LONG; PROCEDURE ParseOptions(pp: ParseParams.T): Options RAISES {ParseParams.Error} = VAR o: Options; BEGIN pp.getKeyword("-maxDist"); WITH d = pp.getNextLongReal(0.0d0) DO o.maxDistSqr := d*d END; pp.getKeyword("-critDist"); WITH d = pp.getNextLongReal(0.0d0) DO o.critDistSqr := d*d END; pp.getKeyword("-skipDist"); WITH d = pp.getNextLongReal(0.0d0) DO o.skipDistSqr := d*d END; RETURN o END ParseOptions; PROCEDURE Eval( length: LONG; (* Total length of matching. *) intgDistSqr: LONG; (* Integral of the curve distance squared and clipped. *) totAsymm: LONG; (* Total step asymmetry. *) READONLY o: Options; (* Mismatch parameters. *) ): LONG = BEGIN RETURN intgDistSqr - length * o.critDistSqr + totAsymm * o.skipDistSqr END Eval; BEGIN END PZMismatch. (* Copyright © 2001 Universidade Estadual de Campinas (UNICAMP). Authors: Helena C. G. Leitão and Jorge Stolfi. This file can be freely distributed, used, and modified, provided that this copyright and authorship notice is preserved, and that any modified versions are clearly marked as such. This software has NO WARRANTY of correctness or applicability for any purpose. Neither the authors nor their employers chall be held responsible for any losses or damages that may result from its use. *)