DIRECTORY Buttons USING [ButtonProc, Create], MessageWindow USING [Append], ViewerClasses USING [Viewer]; TestNarrowTimes: CEDAR MONITOR IMPORTS Buttons, MessageWindow = BEGIN Constr: TYPE = REF ConstrRec; -- to some kind of constraint record ConstrKind: TYPE = {hor, ver, para, perp, cong, at, ccw}; -- kind of constraint ConstrRec: TYPE = RECORD [link: Constr, constr: SELECT kind: ConstrKind FROM hor => -- Constrains (i,j) to be horizontal [i, j: Point _ NIL], ver => -- Constrains (i,j) to be vertical [i, j: Point _ NIL], para => -- Constrains (i,j), (k,l) to be parallel [i, j, k, l: Point _ NIL], perp => -- Constrains (i,j), (k,l) to be perpendicular (relative to the given frame) [i, j, k, l: Point _ NIL], cong => -- Constrains segments (i,j), (k,l) to be congruent (relative to the given frame) [i, j, k, l: Point _ NIL], at => -- Constrains p to have coordinates (x,y) (relative to the given frame) [p: Point _ NIL, x, y: REAL _ 0], ccw => -- Constrains (i,j,k) to be counterclockwise (rel to frame) [i, j, k: Point _ NIL], ENDCASE]; Point: TYPE = REF PointRec; PointRec: TYPE = RECORD [x, y: REAL _ 0, -- coordinates of point. -- The following stuff is used only by JunoOldSolver: tempfixed: BOOL _ FALSE, -- (set by caller) TRUE = don't solve for this point. xheader, yheader: INTEGER _ 0, -- indices of x and y in array oldx, oldy: REAL _ 0, -- values of x, y in previous iteration. -- The following stuff is used only by JunoTop, JunoImage: frozen: BOOL _ FALSE, -- p was frozen by user. visible: BOOL _ FALSE, -- false for control points of strings wn: INTEGER _ 0, -- winding number; used only in TrackLoop copy: Point _ NIL, -- used by CopyCmd. name: REF _ NIL -- used when building procedures ]; FoolAny: PROC [list: LIST OF REF ANY] RETURNS [LIST OF REF ANY] = { RETURN[list] }; FoolPoint: PROC [list: LIST OF Point] RETURNS [LIST OF Point] = { RETURN[list] }; LotsaNarrows: PROC [list: LIST OF REF ANY] = { MessageWindow.Append["Lotsa started...."]; THROUGH [1..100] DO NARROW[list.first, Point].wn _ 0; THROUGH [1..30000] DO NARROW[FoolAny[list].first, Point].wn _ NARROW[list.first, Point].wn+1; ENDLOOP; ENDLOOP; MessageWindow.Append["done. "] }; NoNarrows: PROC [list: LIST OF Point] = { MessageWindow.Append["Notsa started...."]; THROUGH [1..100] DO list.first.wn _ 0; THROUGH [1..30000] DO FoolPoint[list].first.wn _ list.first.wn+1; ENDLOOP; ENDLOOP; MessageWindow.Append["done. "] }; WithButtonProc: ENTRY Buttons.ButtonProc = { r: REF ANY _ NEW[PointRec]; LotsaNarrows[LIST[r]] }; WithoutButtonProc: ENTRY Buttons.ButtonProc = { r: Point _ NEW[PointRec]; NoNarrows[LIST[r]] }; [] _ Buttons.Create[ info: [ name: "with", parent: NIL], proc: WithButtonProc, documentation: "Tests Time with Lotsa NARROWS."]; [] _ Buttons.Create[ info: [ name: "without", parent: NIL], proc: WithoutButtonProc, documentation: "Tests time without the No NARROWS."]; END. CHANGE LOG Created by Stolfi on April 17, 1984 7:58:04 pm PST ,File: TestNarrowTimes.mesa Last Edited by: Stolfi, April 17, 1984 8:28:53 pm PST Tests the time taken by Narrows. [parent: REF ANY, clientData: REF ANY, mouseButton: MouseButton, shift, control: BOOL] [parent: REF ANY, clientData: REF ANY, mouseButton: MouseButton, shift, control: BOOL] Κύ˜– "Cedar" stylešœ™J™5J™Jšœ$™$—unitšΟk ˜ Icodešœœ˜#Lšœœ ˜Lšœœ ˜—šΟbœœ˜Lšœ˜!—Lš˜L˜Jšžœœœ Οc$˜CJšœ œ'œŸ˜Pšœ œ˜Jš'œœœŸ%œœŸ#œœœŸ+œœŸMœœŸRœœŸHœœœŸ<œœœ˜§—Jšœžœœœ ˜šœ œ˜Jš1œ œŸœŸ6œ œœŸ6œœŸ œœ Ÿ*œŸ;œ œœŸœ œœŸ'œœŸ*œœŸœœœŸ!œ˜šJ˜—šΠanœœœœœœ œœœœ˜CJšœ˜ J˜J˜—š   œœœœœœ ˜AJšœ˜ J˜J˜—š   œœœœœœ˜.Jšœ*˜*šœ ˜Jšœ˜!šœ ˜Jšœ"œ˜G—Jšœœ˜ —Jšœœ˜ Jšœ˜J˜J˜—š  œœœœ ˜)Jšœ*˜*šœ ˜Jšœ˜šœ ˜Jšœ+˜+—Jšœœ˜ —Jšœœ˜ Jšœ˜J˜J˜—šΟaœœ˜,Jš œ œœœœ,œ™VJšœœœœ ˜Jšœ œ˜J˜J˜—š‘œœ˜/Jš œ œœœœ,œ™VJšœ œ ˜Jšœ œ˜J˜J˜—proc˜˜Mšœ ˜ Mšœœ˜ —Mšœ˜Mšœ1˜1—˜˜Mšœ˜Mšœœ˜ —Mšœ˜Mšœ5˜5—Mšœ˜Kšœ˜ Kšœ2˜2J˜—…— 2[