TSGlueImpl.mesa
Michael Plass, November 2, 1982 10:10 am
Last Edited by: Beach, May 24, 1983 9:08 am
DIRECTORY
TSTypes, TSGlue;
TSGlueImpl: CEDAR PROGRAM IMPORTS TSTypes EXPORTS TSGlue =
BEGIN OPEN TSTypes, TSGlue;
SetGlue: PUBLIC PROC [desired: Dimn, g: Glue] RETURNS [GlueSet] =
BEGIN
delta: Dimn ← SubDimn[desired, g.space];
fuzz: Dimn = IntDimn[1,mica];
shrinking: BOOLEAN ← delta<0;
v: Dimn ← IF shrinking THEN g.shrink ELSE g.stretch;
absDelta: Dimn ← AbsDimn[delta];
IF shrinking AND absDelta.texPts > v.texPts + fuzz.texPts THEN
RETURN[overfullGlueSet];
v ← MaxDimn[fuzz, v];
RETURN[[DimnRatio[delta,v]]];
END; 
GlueBadness: PUBLIC PROC [set: GlueSet] RETURNS [Badness] =
BEGIN
b: Badness ← IF set.value IN (-1..2000]
THEN ABS[100*set.value*set.value*set.value]
ELSE infBadness;
IF b>=infBadness THEN RETURN[infBadness]
ELSE RETURN[b];
END;
END.
Michael Plass, November 2, 1982 10:10 am. CEDARized.