LSFit.mesa
Copyright © 1985 by Xerox Corporation. All rights reserved.
Michael Plass 10-Mar-82 15:18:23
Doug Wyatt, September 5, 1985 1:08:55 pm PDT
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: BOOLEANFALSE,
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: NATLAST[NAT]];
FitParametricCubic: PROC [h: Handle, first, last: NAT, epsilon: REAL];
does the whole thing for a single piece
ReParameterize: PROC [p: Patch, t0,t1: REAL, nt0,nt1: REAL] RETURNS[np: Patch];
InitialParametricSpline: PROC [sa: ComplexSequence, nknots: NAT, closed: BOOLEANFALSE] RETURNS [Handle];
Sort: PROC [v: RealSequence];
InitialTValues: PROC [h: Handle];
AdjustTValues: PROC [h: Handle];
FitXAndY: PROC [h: Handle];
ImproveParametricSpline: PROC [h: Handle];
END.