Google
 

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

Gaq:H1K7NPlUTZ(bfzhi$lkno&ovpz GpGe GgDATE_VECTP HGt GvSCALE_VECTP G3H HSCRATCH_VECTP G9G8SUM_X G>G=SUM_Y GDGCSUM_X_SQ GJGISUM_X_Y GPGONUM GUGTMEAN G[GZINTERCEPT GG`SLOPE G%G GXSP FG) G*YSP FFSTRIDE FFPOINTS F$F#X_POS F)F(Y_POS F/F.LEN_S F4F3CNT F:F9JTEMP F@F>X_SCALE FFFDY_SCALE FLFJX_AXIS FRFPY_AXIS FWFVRANGE F]F\X_ORIGIN FcFbY_ORIGIN FiFhX_LENGTH FoFnY_LENGTH FuFtPOINT FzFyTOP GFLINE_LEN GGY_TOP GG
Y1GGY2FKHHHH H%H+ GaHX HHY HHXL HH$YL 0H H*0XLABEL 0H%H00YLABELH8HIHZHkH|IbIiJ,JYKFFHFLH
FcHFiH GI
FLFi
III/I4I?INIY 0IP	FFFL
 0I2V	Fc
ICFiFFFL
F$IyFLJ
JJFiJ
I}J!9H+ PJF$9J LABELJ1J5JKJO 0J4P	J?F$FFJC!y 0JNT(B)[0,25]H+J^JbK 0JaT[15,0]JmKH%KFFJwFcJ{ PFLK
!^! 0KT(E)N
K%K+K1GaK*MINVAL K%K0MAXVAL K+K6 ARRAYLK{L5L:K<(K%K+FFFW9K>LABEL
FcLFFL'K19L)LABELF/LEFN	LNLqMM0NFoL]FWLgN]NdOM|(NNFFF]9M~LABEL
OjFF/Fi	PP$P1PPFcPE PPH9PJLABELU>P[PaPg GaPMINVAL P[PeMAXVAL PaPk ARRAY	PrQQ.QHQaRRTQT^TtUU:FWP|
P[Q
QP[QFWQ'
Pa 0FRQW
FuFW
FcFR
QzPg9Q|LABELF/FWR&R-	
 0!R>R^RrS$TFFoRMF4RT
RQF/!	FFFSSF:SFWFo
S(S;SHoSzT
T?SYTSMSjFRSV
pS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iDjj5jkkk>ll$FRi:
i
iiIiUib
ii_  0iio ilis!
iwFR
jjjj
jFRi
  Xij. ij2  Pj:jTj>jQ
jGFRi
  |ijd ijh  Pij{ ij 
kiikk$ik!ik4 ii  kBkO
l 0
lFRi
 l(lLl2i
il<iiil\il`0n	lom9mKltm3 0m20F)mB	F
 0 0n@V(W(P4I2))
nEFzF)n^	F

!!o+o! Gao%Yo/o?oNo!FL!
o!FL!
oSobo!G!o!G!poq Gaou ARRAYF/ppoq	o{pMpp&oqF/!	FFp0F:pC
p9FWoqF/!	oqF/!	!q"pu GapyZEROppuq"FLq
F@F]

! 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, JTEMP,  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 JTEMP FROM 1 TO 9
	    BEGIN
		POINT = JTEMP * 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 (JTEMP EQ 2 OR JTEMP EQ 5)) OR JTEMP 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 JTEMP FROM 1 TO 9
	    BEGIN
		POINT = JTEMP * 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 (JTEMP EQ 2 OR JTEMP EQ 5)) OR JTEMP 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(P4I2))",

			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 JTEMP OVER DATE_VECT
!		    DATE_VECT (JTEMP) = DATE_VECT (JTEMP) + SCALE_VECT (JTEMP)
	    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(P4I2))",RX(LINE_LEN -1),"0"
	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(P4I2))", 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