DIRECTORY Complex USING [VEC], Seq USING [ComplexSequence, ComplexSequenceRec, NatSequence, NatSequenceRec, RealSequence, RealSequenceRec]; LSFit: CEDAR DEFINITIONS = BEGIN ComplexSequence: TYPE = Seq.ComplexSequence; ComplexSequenceRec: TYPE = Seq.ComplexSequenceRec; RealSequence: TYPE = Seq.RealSequence; RealSequenceRec: TYPE = Seq.RealSequenceRec; NatSequence: TYPE = Seq.NatSequence; NatSequenceRec: TYPE = Seq.NatSequenceRec; Patch: TYPE = RECORD[c0,c1,c2,c3: REAL ¬ 0]; PatchSequence: TYPE = REF PatchSequenceRec; PatchSequenceRec: TYPE = RECORD[element: SEQUENCE length:NAT OF Patch]; Handle: TYPE = REF StateRec; StateRec: TYPE = RECORD [n: NAT, -- number of points z: ComplexSequence, weight: RealSequence, t: RealSequence, -- the current best guess of parameter values knots: RealSequence, closedCurve: BOOLEAN ¬ FALSE, xPatches,yPatches: PatchSequence ]; Create: PROC [sa: ComplexSequence] RETURNS [Handle]; InitialKnots: PROC [h: Handle, nknots: NAT ¬ 2]; XYat: PROC [h: Handle, t: REAL] RETURNS [Complex.VEC]; ClosestKnot: PROC [h: Handle, z: Complex.VEC] RETURNS [NAT]; InitialParametricCubic: PROC [sa: ComplexSequence] RETURNS [Handle]; ImproveParametricCubic: PROC [h: Handle, first: NAT ¬ 0, last: NAT ¬ LAST[NAT]]; FitParametricCubic: PROC [h: Handle, first, last: NAT, epsilon: REAL]; ReParameterize: PROC [p: Patch, t0,t1: REAL, nt0,nt1: REAL] RETURNS[np: Patch]; InitialParametricSpline: PROC [sa: ComplexSequence, nknots: NAT, closed: BOOLEAN ¬ FALSE] RETURNS [Handle]; Sort: PROC [v: RealSequence]; InitialTValues: PROC [h: Handle]; AdjustTValues: PROC [h: Handle]; FitXAndY: PROC [h: Handle]; ImproveParametricSpline: PROC [h: Handle]; END. Μ LSFit.mesa Copyright Σ 1985, 1992 by Xerox Corporation. All rights reserved. Michael Plass 10-Mar-82 15:18:23 Doug Wyatt, September 5, 1985 1:08:55 pm PDT does the whole thing for a single piece ΚΠ•NewlineDelimiter –(cedarcode) style™codešœ ™ Kšœ Οeœ6™BKšœ ™ K™,—K˜šΟk ˜ Kšœžœžœ˜Kšœžœc˜l—K˜KšΠblœžœž œ˜Kšž˜K˜Kšœžœ˜,Kšœžœ˜2Kšœžœ˜&Kšœžœ˜,Kšœ žœ˜$Kšœžœ˜*K˜Kšœžœžœžœ˜,Kšœžœžœ˜+Kš œžœžœ žœžœžœ˜GK˜Kšœžœžœ ˜šœ žœž˜šœžœΟc˜K˜K˜Kšœ -˜>K˜Kšœ žœžœ˜K˜ K˜——K˜KšΟnœžœžœ ˜4K˜Kš‘ œžœžœ˜0K˜Kš ‘œžœžœžœ žœ˜6K˜Kš ‘ œžœžœžœžœ˜