Google
 

Trailing-Edge - PDP-10 Archives - BB-AI48A-BM - datatrieve/vt125/label.cdd-plot
There are 4 other files named label.cdd-plot in the archive. Click here to see a list.

Ias-J1M7PRlWT\(dhzjk$nkpqqjrn IpIe IgDATE_VECTP JIt IvSCALE_VECTP I3J JSCRATCH_VECTP I9I8SUM_X I>I=SUM_Y IDICSUM_X_SQ IJIISUM_X_Y IPIONUM IUITMEAN I[IZINTERCEPT II`SLOPE I%I IXSP HI) I*YSP HHSTRIDE HHPOINTS H$H#X_POS H)H(Y_POS H/H.LEN_S H4H3CNT H:H9JCNT H@H>X_SCALE HFHDY_SCALE HLHJX_AXIS HRHPY_AXIS HWHVRANGE H]H\X_ORIGIN HcHbY_ORIGIN HiHhX_LENGTH HoHnY_LENGTH HuHtPOINT HzHyTOP IHLINE_LEN IIY_TOP II
Y1IIY2HMJJJJ J%J+ IaJX JJY JJXL JJ$YL 0J J*0XLABEL 0J%J00YLABELJ8JIJZJkJ|KbKiL,LYMHFJHLJ
HcJHiJ IK
HLHi
KKK/K4K?KNKY 0KP	HFHL
 0K2V	Hc
KCHiHFHL
H$KyHLL
LLHiL
K}L!9J+ PLH$9L LABELL1L5LKLO 0L4P	L?H$HFLC!y 0LNT(B)[0,25]J+L^LbM 0LaT[15,0]LmMJ%MHFLwHcL{ PHLM
!^! 0MT(E)P
M%M+M1IaM*MINVAL M%M0MAXVAL M+M6 ARRAYNM{N5N:M<(M%M+HHHW9M>LABEL
HcNHHN'M19N)LABELH/NEHP	NNNqOO0PHoN]HWNgP]PdQO|(PPHHH]9O~LABEL
QjHH/Hi	RR$R1RRHcRE PRH9RJLABELW>R[RaRg IaRMINVAL R[ReMAXVAL RaRk ARRAY	RrSS.SHSaTTVQV^VtWW:HWR|
R[S
SR[SHWS'
Ra 0HRSW
HuHW
HcHR
SzRg9S|LABELH/HWT&T-	
 0!T>T^TrU$VFHoTMH4TT
TQH/!	HHFUUH:UHWHo
U(U;UHoUzV
V?UYVUMUjHRUV
pU]Un
P
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ll5lkmm>nn$HRk:
k
kkIkUkb
kk_  0kko klks!
kwHR
llll
lHRk
  Xkl. kl2  Pl:lTl>lQ
lGHRk
  |kld klh  Pkl{ kl 
mkkmm$km!km4 kk  mBmO
n 0
nHRk
 n(nLn2k
kn<kkkn\kn`0pnoo.oAnto)	H
 0 0p4V(W(P4I(C)))
p9HzH)pR	H
H)pi	plHp|H
!!qq IaqYq#q3qBqHL!
qHL!
qGqVqI!qI!qoqe Iaqi ARRAYH/rdqe	rrAr	rqeH/!	HFr#H:r7
r-HWqeH/!	qeH/!	!srh IarmZEROrrrhs"HLs

H@H]

! Entrypoints are:
!	0	-- draw box
!	2	-- scale X linear (and scale array)
!	3	-- scale Y linear
!	4	-- scale X log  (and scale array)

!	5	-- scale Y log
!	6	-- scale X date (and scale array)
!	7	-- compute linear regression
!	8	-- scale entire Y array
!	9	-- return X and Y arrays
!      10	-- scale axis (internal)
!      11	-- print Y scale axis line
!      12	-- print X scale axis lie
 Y value
!      14	-- scale entry Y array
ale 0 axis

DECLARE STRING		STR
$DECLARE REAL		STRIDE, POINTS, X_POS, Y_POS, LEN_S, CNT, JCNT,  X_SCALE,
			Y_SCALE, X_AXIS, Y_AXIS, RANGE, X_ORIGIN, Y_ORIGIN,
			X_LENGTH, Y_LENGTH, POINT, TOP, LINE_LEN,

			Y_TOP, Y1, Y2, ZERO
DECLARE REAL VECTOR	XS, YS
DECLARE REAL		SUM_X, SUM_Y, SUM_X_SQ, SUM_X_Y, NUM, MEAN,

			INTERCEPT, SLOPE
DECLARE REAL VECTOR	DATE_VECT, SCALE_VECT, SCRATCH_VECT
! Draw boxes
ENTRY 0 (X,Y, XL, YL, X_LABEL : STRING, Y_LABEL : STRING)
    BEGIN
	X_AXIS = X
	Y_AXIS = Y
	X_LENGTH = XL
	Y_LENGTH = YL
	Y_TOP = Y_AXIS - Y_LENGTH
#	PRINT "P", LXY (X_AXIS, Y_AXIS), "V", RX(X_LENGTH), RY( - Y_LENGTH),
	    LX(X_AXIS), LY(Y_AXIS)
	Y_POS = Y_AXIS - (Y_LENGTH + 25 * LENGTH (Y_LABEL)) / 2

	PLOT LABEL 13 (Y_POS)
	PRINT "P", LXY (X_AXIS - 100, Y_POS),
	    "T(B)[0,25]", QUOTE(Y_LABEL)
		PRINT "T[15,0]",
		CENTER (X_AXIS + X_LENGTH / 2, Y_AXIS + 60, X_LABEL, 15),
		"T(E)"
    END
! Scale X"s linearily
ENTRY 2 (MIN_VAL, MAX_VAL, ARRAY : VECTOR)
    BEGIN
	PLOT LABEL 10 (MIN_VAL, MAX_VAL, POINTS, STRIDE, X_ORIGIN)
	X_SCALE = X_LENGTH / (POINTS * STRIDE)

	PLOT LABEL 14 (ARRAY)
	INCR CNT FROM 0 TO POINTS
	    BEGIN
		POINT = X_ORIGIN + CNT * STRIDE

		STR = CVT (POINT)
		X_POS = X_AXIS + CNT * X_LENGTH / POINTS
		IF CNT EQ 0 OR CNT EQ POINTS

		    THEN LINE_LEN = 0
		    ELSE LINE_LEN = Y_LENGTH - 2
		PLOT LABEL 12
    	    END
    END
! Scale Y"s linearily
ENTRY 3 (MIN_VAL, MAX_VAL)
    BEGIN
	PLOT LABEL 10 (MIN_VAL, MAX_VAL, POINTS, STRIDE, Y_ORIGIN)
	Y_SCALE = Y_LENGTH / (POINTS * STRIDE)
	INCR CNT FROM 0 TO POINTS
	    BEGIN
		POINT = Y_ORIGIN + CNT * STRIDE

		STR = CVT (POINT)
		Y_POS = Y_AXIS - CNT * Y_LENGTH / POINTS
		IF CNT EQ 0 OR CNT EQ POINTS

		    THEN LINE_LEN = 0
		    ELSE LINE_LEN = X_LENGTH - 2
		PLOT LABEL 11
	    END
    END
! Scale LOG (X)
ENTRY 4 (MIN_VAL, MAX_VAL, ARRAY : VECTOR)
    BEGIN
INVAL)
	IF MIN_VAL < 0
	    X_ORIGIN = X_ORIGIN - 1
XVAL) + 1

	RANGE = TOP - X_ORIGIN
	X_SCALE = X_LENGTH / RANGE

	PLOT LABEL 14 (ARRAY)
	INCR CNT FROM X_ORIGIN TO TOP - 1
	    INCR JCNT FROM 1 TO 9
	    BEGIN
		POINT = JCNT * 10 ** CNT

		STR = CVT (POINT)
		X_POS = X_AXIS + (LOG (POINT) - X_ORIGIN) * X_SCALE
		IF LOG (POINT) EQ X_ORIGIN
		    THEN
			LINE_LEN = 0
		    ELSE
!			IF       (RANGE < 4 AND (JCNT EQ 2 OR JCNT EQ 5)) OR JCNT EQ 1
			    THEN LINE_LEN = Y_LENGTH - 2
				ELSE BEGIN
				    LINE_LEN = 8
					    STR = " "
				END
		PLOT LABEL 12
	    END
	LINE_LEN = 0

	POINT =  10 ** TOP

	STR = CVT (POINT)
	X_POS = X_AXIS + (LOG (POINT) - X_ORIGIN) * X_SCALE
	PLOT LABEL 12
    END
! Scale (LOG Y) -- NOTE: Parameters are log of values
ENTRY 5 (MIN_VAL, MAX_VAL)
    BEGIN
INVAL)
	IF MIN_VAL < 0
	    Y_ORIGIN = Y_ORIGIN - 1
XVAL) + 1

	RANGE = TOP - Y_ORIGIN
	Y_SCALE = Y_LENGTH / RANGE
	INCR CNT FROM Y_ORIGIN TO TOP - 1
	    INCR JCNT FROM 1 TO 9
	    BEGIN
		POINT = JCNT * 10 ** CNT

		STR = CVT (POINT)
		Y_POS = Y_AXIS - (LOG (POINT) - Y_ORIGIN) * Y_SCALE
		IF LOG (POINT) EQ Y_ORIGIN
		    THEN
			LINE_LEN = 0
		    ELSE
!			IF       (RANGE < 4 AND (JCNT EQ 2 OR JCNT EQ 5)) OR JCNT EQ 1
			    THEN LINE_LEN = X_LENGTH - 2
				ELSE BEGIN
				    LINE_LEN = 8
					    STR = " "
				END
		PLOT LABEL 11
	    END

	POINT = 10 ** TOP

	STR = CVT (POINT)
	Y_POS = Y_AXIS - (LOG (POINT) - Y_ORIGIN) * Y_SCALE
	LINE_LEN = 0
	PLOT LABEL 11
    END
! Scale dates
ENTRY 6 (MIN_VAL, MAX_VAL, ARRAY : VECTOR)
    BEGIN
	RANGE =       (MAX_VAL - MIN_VAL) * 1.05
	DATE_EXP (MIN_VAL, DATE_VECT)
	IF RANGE < 11
	    THEN SCALE_VECT (3) = 1

	    ELSE IF RANGE < 21
ECT (3) = 2

	    ELSE IF RANGE < 70
ECT (3) = 7
	    ELSE BEGIN

		DATE_VECT (3) = 1
			IF RANGE < 190
		    THEN SCALE_VECT (2) = 1
		ELSE IF RANGE < 367
		    THEN SCALE_VECT (2) = 2
		ELSE IF RANGE < 734
		    THEN SCALE_VECT (2) = 3
		ELSE IF RANGE <1462
		    THEN SCALE_VECT (2) = 6
		ELSE BEGIN
			DATE_VECT (2) = 1
			SCALE_VECT (1) = 1
		    END
	    END
	X_ORIGIN = DATE_COM (DATE_VECT)
	DATE_EXP (X_ORIGIN, SCRATCH_VECT)
	POINTS = 0
	WHILE DATE_COM (SCRATCH_VECT) < MAX_VAL
	    BEGIN
		INCR CNT OVER SCRATCH_VECT
!		    SCRATCH_VECT (CNT) = SCRATCH_VECT (CNT) + SCALE_VECT (CNT)
		POINTS = POINTS + 1
	    END
	X_SCALE = X_LENGTH / (DATE_COM (SCRATCH_VECT) - X_ORIGIN)

	PLOT LABEL 14 (ARRAY)
	INCR CNT FROM 0 TO POINTS
	    BEGIN
		POINT = DATE_COM (DATE_VECT)
		X_POS =       (POINT - X_ORIGIN) * X_SCALE + X_AXIS
		IF CNT NE 0 AND CNT NE POINTS
		    PRINT "P", LXY (X_POS, Y_AXIS - 1), "V(W(P4I(C)))",

			RY( - Y_LENGTH + 3)
		PRINT CENTER (X_POS, Y_AXIS + 15, DATE_STR (POINT,0,6), 9),
		      CENTER (X_POS, Y_AXIS + 35, DATE_STR (POINT,7,4), 9)
		INCR JCNT OVER DATE_VECT
		    DATE_VECT (JCNT) = DATE_VECT (JCNT) + SCALE_VECT (JCNT)
	    END
    END
! Compute linear regression (least squares)
ENTRY 7
    BEGIN
	SUM_X = 0
	SUM_Y = 0
	SUM_X_SQ = 0
	SUM_X_Y = 0
		INCR CNT OVER XS
	    BEGIN
 XS(CNT)
 YS(CNT)
		SUM_X_SQ = SUM_X_SQ + XS(CNT) ** 2
		SUM_X_Y = SUM_X_Y + XS(CNT) * YS(CNT)
	    END
		NUM = SIZE (XS)

	MEAN = SUM_X / NUM
"	SLOPE =       (SUM_X_Y - MEAN * SUM_Y) / (SUM_X_SQ - MEAN * SUM_X)
	INTERCEPT =       (SUM_Y - SLOPE * SUM_X) / NUM
	Y1 = X_AXIS * SLOPE + INTERCEPT

	PLOT LABEL 13 (Y1)
	Y2 =       (X_AXIS + X_LENGTH) * SLOPE + INTERCEPT

	PLOT LABEL 13 (Y2)
	PRINT "P", LXY ((Y1 - INTERCEPT) / SLOPE, Y1),
	      "V", LXY ((Y2 - INTERCEPT) / SLOPE, Y2)
    END
! Scale Y array
VECTOR)

    INCR CNT OVER ARRAY
	BEGIN
 	    ARRAY (CNT) = Y_AXIS - Y_SCALE * (ARRAY (CNT) - Y_ORIGIN)
	    YS (CNT) = ARRAY (CNT)
	END

! Return X and Y arrays
ENTRY 9 (X : VECTOR, Y : VECTOR, AXIS)
    BEGIN
		INCR CNT OVER XS
	    BEGIN
			X(CNT)=XS(CNT)
			Y(CNT)=YS(CNT)
	    END

	AXIS = Y_AXIS - 1
    END
 for axis
ENTRY 10 (MIN_VAL, MAX_VAL, POINTS, STRIDE, ORIGIN)
    BEGIN
	RANGE = MAX_VAL - MIN_VAL

	IF RANGE EQ 0 THEN
	    STRIDE = 1 ELSE
	    STRIDE = 10 ** INT (LOG (RANGE))
	IF INT (RANGE / STRIDE) < 3
	    THEN STRIDE = STRIDE / 2
	IF INT (RANGE / STRIDE) > 7
	    THEN STRIDE = STRIDE * 2
	ORIGIN = STRIDE * (INT (MIN_VAL / STRIDE))
	IF MIN_VAL < 0 THEN ORIGIN = ORIGIN - STRIDE
		IF MIN_VAL NE 0
	    THEN IF MIN_VAL EQ ORIGIN THEN ORIGIN = ORIGIN - STRIDE
	POINTS = 1 + INT (RANGE / STRIDE)
	IF ORIGIN + POINTS * STRIDE LE MAX_VAL
	    THEN POINTS = POINTS + 1
    END
! Print a scale line and label 
ENTRY 11
    BEGIN
		IF LINE_LEN NE 0
#	    PRINT "P", LXY (X_AXIS + 1, Y_POS), "V(W(P4I(C)))", RX(LINE_LEN)
	LEN_S = LENGTH (STR)
	IF LEN_S NE 0
	    PRINT CENTER (X_AXIS - 10, Y_POS - 5, STR, 18)
    END
! Print a scale line and label 
ENTRY 12
    BEGIN
		IF LINE_LEN NE 0
%	    PRINT "P", LXY (X_POS, Y_AXIS  - 1), "V(W(P4I(C)))", RY( - LINE_LEN)
	LEN_S = LENGTH (STR)
	IF LEN_S NE 0
	    PRINT CENTER (X_POS, Y_AXIS + 15, STR, 9)
    END
! Clip a Y value to fit into (onto) box
ENTRY 13 (Y)

    IF Y GT Y_AXIS
		THEN Y = Y_AXIS

	ELSE IF Y LT Y_TOP

	    THEN Y = Y_TOP

! Scale entire X array
 : VECTOR)

    INCR CNT OVER ARRAY
	BEGIN
 	    ARRAY (CNT) = X_AXIS + X_SCALE * (ARRAY (CNT) - X_ORIGIN)
	    XS (CNT) = ARRAY (CNT)
	END
! Scale 0 axis
ENTRY 15 (ZERO)
    BEGIN
	ZERO = Y_AXIS + Y_SCALE * Y_ORIGIN
    END
END_PLOT