Trailing-Edge
-
PDP-10 Archives
-
decuslib10-02
-
43,50242/poodat.bli
There are no other files named poodat.bli in the archive.
00100 MODULE POODAT(INSPECT,DREGS=5,RSAVE,LOWSEG) =
00200 BEGIN
00300
00400 EXTERNAL
00500 POSQRT,
00600 FLOUT,
00700 DECOUT,
00800 OUTMSG,
00900 WRITE,
01000 TIME;
01100
01200 MACRO
01300 NN = (.ARR)<0,36>$,
01400 WWIDTH = (.ARR+1)<0,36>$,
01500 LLOW = (.ARR+2)<0,36>$,
01600 S1 = (.ARR+3)<0,36>$,
01700 S2 = (.ARR+4)<0,36>$;
01800
01900 GLOBAL ROUTINE ACCUM(SUM,OLDT,VAL) =
02000 ! ACCUMULATE TIME-INTEGRAL OF .VAL IN .SUM.
02100 ! UPDATE TIMA OF LAST ACCUMULATION.
02200 BEGIN
02300 (.SUM)<0,36>[email protected] FADR ((.TIME FSBR @.OLDT) FMPR .VAL);
02400 (.OLDT)<0,36> _ .TIME;
02500 END;
02600
02700 GLOBAL ROUTINE HISTO(ARR,VAL) =
02800 ! ADD VALUE TO HISTOGRAM.
02900 BEGIN
03000 REGISTER INDEX;
03100 INDEX _ FIX ((.VAL FSBR .LLOW) FDVR .WWIDTH);
03200 IF .INDEX LSS 0 THEN INDEX_5 ELSE
03300 IF .INDEX GTR .NN THEN INDEX_.NN+5 ELSE INDEX _ .INDEX+5;
03400 (.ARR)[.INDEX]_.(.ARR)[.INDEX] + 1;
03500 S1_.S1 FADR .VAL;
03600 S2_.S2 FADR (.VAL FMPR .VAL);
03700 END;
03800
03900 GLOBAL ROUTINE HPRINT(CHNL,ARR) =
04000 ! PRINT HHSTOGRAM.
04100 BEGIN
04200 LOCAL MAX,PERCENTFACT,TOTVAL,SUBVAL,SCALE,TEMP;
04300 TOTVAL_MAX_SUBVAL_0;
04400 INCR J FROM 5 TO .NN+5 DO
04500 ! FIND TALLEST COLOUMN AND TOTAL # OF OBSERVATIONS.
04600 BEGIN
04700 IF .(.ARR)[.J] GTR .MAX THEN MAX_.(.ARR)[.J];
04800 TOTVAL_.TOTVAL+.(.ARR)[.J];
04900 END;
05000 ! COMPUTE SOME USEFUL CONSTANTS.
05100 PERCENTFACT _ 100.0 FDVR ( FLOAT .TOTVAL);
05200 SCALE_100.0 FDVR (FLOAT(.MAX));
05300 INCR J FROM 5 TO .NN+5 DO
05400 BEGIN
05500 ! OUTPUT J'TH COLOUMN.
05600 TEMP_FIX((FLOAT .(.ARR)[.J]) FMPR .SCALE);
05700 SUBVAL_.SUBVAL+.(.ARR)[.J];
05800 FLOUT(.CHNL,.LLOW FADR .WWIDTH FMPR (FLOAT (.J-5)),4,3); ! LOWER BOUND OF COLOUMN.
05900 WRITE(.CHNL," "); WRITE(.CHNL,#41); ! EXCLAMATION MARK FOR VERTICAL BAR.
06000 INCR J1 FROM 1 TO .TEMP DO WRITE(.CHNL,"*");
06100 INCR J1 FROM 1 TO 101-.TEMP DO WRITE(.CHNL," ");
06200 DECOUT(.CHNL,5,.(.ARR)[.J]); ! NO. OF VALUES IN COLOUMN.
06300 WRITE(.CHNL,"(");
06400 FLOUT(.CHNL,(FLOAT .(.ARR)[.J]) FMPR .PERCENTFACT,3,3); ! % OF VALUES IN COLOUMN.
06500 WRITE(.CHNL,")");
06600 FLOUT(.CHNL,(FLOAT .SUBVAL) FMPR .PERCENTFACT,3,3); ! CUMULATIVE %.
06700 OUTMSG(.CHNL,PLIT #064240000000);
06800 IF ((FLOAT .SUBVAL) FMPR .PERCENTFACT) GTR 99.98 THEN EXITLOOP; ! CUT TAIL.
06900 END;
07000 OUTMSG(.CHNL,PLIT #064241505000);
07100 OUTMSG(.CHNL,PLIT ' '); ! TAB.
07200 OUTMSG(.CHNL,PLIT 'MEAN = ');
07300 MAX _ 1.0 FDVR (FLOAT .TOTVAL);
07400 FLOUT(.CHNL,TEMP_.S1 FMPR .MAX,5,5);
07500 TEMP_POSQRT((.S2 FMPR .MAX) FSBR (.TEMP FMPR .TEMP));
07600 OUTMSG(.CHNL,PLIT ' - STANDARD DEVIATION = ');
07700 FLOUT(.CHNL,.TEMP,4,4);
07800 OUTMSG(.CHNL,PLIT ' - TOTAL = ');
07900 DECOUT(.CHNL,8,.TOTVAL);
08000 OUTMSG(.CHNL,PLIT ' - UNITS PR. * = ');
08100 FLOUT(.CHNL,1.0 FDVR .SCALE,4,4);
08200 OUTMSG(.CHNL,PLIT '
08300 ');
08400 END; ! END HPRINT.
08500
08600 GLOBAL ROUTINE INITHISTO(ARR,N,WIDTH,LOW) =
08700 ( NN _ .N;
08800 WWIDTH _ .WIDTH;
08900 LLOW _ .LOW;
09000 INCR I FROM .ARR+3 TO .ARR + .N + 5 DO (.I)<0,36> _ 0;
09100 ); ! END INITHISTO.
09200
09300 END
09400 ELUDOM
09500