<> <> <> <> <> <> <> <, where their bounds are specified at creation time. Again, all counters are allocated, so keep bounds reasonable.>> DIRECTORY Rope, IO, ViewerClasses; Histograms: CEDAR DEFINITIONS = BEGIN ROPE: TYPE = Rope.ROPE; Histogram: TYPE = REF HistogramRep; HistogramRep: TYPE; NewHistogram: PROCEDURE --makes a 1D histogram [ factor: REAL _ 1, --x = I*factor + offset offset: REAL _ 0] RETURNS [Histogram]; <> Create2D: PROC [ iMin, iMax, jMin, jMax: INT, --bounds are inclusive on both ends iFactor, jFactor: REAL _ 1, --x = I*iFactor + iOffset iOffset, jOffset: REAL _ 0] --y = J*jFactor + jOffset RETURNS [Histogram]; Increment: PROCEDURE [h: Histogram, i: CARDINAL] = INLINE {Change[h, i, 1]}; <> Decrement: PROCEDURE [h: Histogram, i: CARDINAL] = INLINE {Change[h, i, -1]}; <> Change: PROCEDURE [h: Histogram, who: CARDINAL, howMuch: INTEGER]; <> IncrementTransformed: PROCEDURE [h: Histogram, xmin, xmax, x: REAL]; <> ChangeTransformed: PROC [h: Histogram, x: REAL, y: REAL _ 0, delta: INTEGER _ 1]; <> ClearAll: PROC [h: Histogram]; <> WriteTo: PROCEDURE [h: Histogram, to: IO.STREAM]; <> Show: PROCEDURE [ h: Histogram, viewerInit: ViewerClasses.ViewerRec _ [], format: ROPE _ NIL, --NIL means "%d" width: CARDINAL _ 0, --max number of chars produced when formatting iFreq: CARDINAL _ 0, --label every iFreq'th bin paint: BOOL _ TRUE] RETURNS [ViewerClasses.Viewer]; <> END.