DIRECTORY CD, CDBasics, Core, CoreGeometry, SinixIntervals; SinixD2Intervals: CEDAR DEFINITIONS = BEGIN Rect: TYPE = CD.Rect; universe: Rect = CDBasics.universe; empty: Rect = CDBasics.empty; Table: TYPE = REF TableRec; TableRec: TYPE = MONITORED RECORD [ range: Rect, -- given at creation time, it retains the range of all rects. Clients should not change this field. leafBuckets: PRIVATE NAT, -- private field to detect when ReHashing is necessary. data: PRIVATE REF TableData ]; TableData: PRIVATE TYPE = RECORD [c: SEQUENCE hashSize: NAT OF SinixIntervals.Table]; Create: PROC [range: Rect, logHashSize: NAT _ 2] RETURNS [Table]; Insert: PROC [table: Table, instance: CoreGeometry.Instance, wire: Core.Wire]; Enumerate: PROC [table: Table, action: PROC [CoreGeometry.Instance, Core.Wire], rect: Rect _ universe]; DeleteOutside: PROC [table: Table, rect: Rect]; END. †SinixD2Intervals.mesa Copyright Σ 1985, 1987 by Xerox Corporation. All rights reversed. Created by Bertrand Serlet, March 8, 1986 1:40:51 pm PST Bertrand Serlet, March 29, 1987 6:13:58 pm PST Very much like D2Intervals, but instanciating the types for the Sinix application yields a 20% win in memory and a factor of N (maybe N=3) in speed. Creates a new table with a suggested hash size of 2**logHashSize-1. Adds a new value in the table. The corresponding interval must lie in the creation range, otherwise an ERROR might occur. This operation is monitored. Does NOT check if already member of the table. Enumerates all values of the table that overlap a given rect. The interval can be outside the range of the table. This operation is NOT monitored. Applies action to each value until action returns TRUE or no more value. Returns TRUE if some action returns TRUE. Deletes all occurences of instances that do not overlap rect in table. The interval can be outside the range of the table. Table is erased when rect=universe. The corresponding interval must lie in the creation range, otherwise an ERROR might occur. This operation is monitored. Κώ– "cedar" style˜codešœ™KšœB™BKšœ5Οk™8Kšœ.™.—K˜body™”K˜—š œœ/˜;K˜—šΠbnœœ œ˜+K˜—šœœœ˜K˜—Kšœ#˜#šœ˜K˜—šœœœ ˜šœ œ œœ˜#KšœΟcd˜tKšœ œœŸ7˜QKšœœœ ˜Kšœ˜—Kš œ œœœœ œœ˜UK˜—šΟnœœœœ ˜AKšœD™DK˜—š œœB˜NKšœ™KšœHœ ™ZK™Kšœœ&™.K˜—š  œœœ<˜gKšœ=™=Kšœ3™3Kšœœ ™ Kšœ2œ™JKšœœœ™)K˜—š  œœ˜/KšœF™FKšœ3™3Kšœ#™#KšœHœ ™ZK™K˜—Kšœ˜K˜—…—x ό