-
Notifications
You must be signed in to change notification settings - Fork 17
/
newnumal5p1.txt
20602 lines (15085 loc) · 652 KB
/
newnumal5p1.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1SECTION : 1.1.1 (DECEMBER 1979) PAGE 1
AUTHOR: P.A.BEENTJES.
INSTITUTE: MATHEMATICAL CENTRE.
RECEIVED: 730715.
BRIEF DESCRIPTION:
THIS SECTION CONTAINS FIVE PROCEDURES.
INIVEC INITIALIZES A ( PART OF A ) VECTOR WITH A CONSTANT.
INIMAT INITIALIZES A ( PART OF A ) MATRIX WITH A CONSTANT.
INIMATD INITIALIZES ELEMENTS A[I, I+SHIFT], I= LR(1)UR OF A MATRIX.
INISYMD INITIALIZES A (PART OF A) CODIAGONAL OF A SYMMETRIC MATRIX,
WHOSE UPPERTRIANGLE IS STORED COLUMNWISE IN A ONE-DIMENSIONAL
ARRAY.
INISYMROW INITIALIZES A (PART OF A) ROW OF A SYMMETRIC MATRIX,WHOSE
UPPERTRIANGLE IS STORED COLUMNWISE IN A ONE-DIMENSIONAL ARRAY.
KEYWORDS:
ELEMENTARY PROCEDURE,
VECTOR OPERATIONS,
INITIALIZATION.
SUBSECTION: INIVEC.
CALLING SEQUENCE:
HEADING:
"PROCEDURE" INIVEC(L, U, A, X); "VALUE" L,U,X;
"INTEGER" L,U; "REAL" X; "ARRAY" A;
"CODE" 31010;
FORMAL PARAMETERS:
L,U: <ARITHMETIC EXPRESSION>;
LOWER AND UPPER INDEX OF THE VECTOR A, RESPECTIVELY;
A: <ARRAY IDENTIFIER>;
"ARRAY" A[L : U], THE ARRAY TO BE INITIALIZED;
X: <ARITHMETIC EXPRESSION>;
INITIALIZATION CONSTANT.
LANGUAGE: COMPASS.
1SECTION : 1.1.1 (DECEMBER 1979) PAGE 2
SUBSECTION: INIMAT.
CALLING SEQUENCE:
HEADING:
"PROCEDURE" INIMAT(LR, UR, LC, UC, A, X); "VALUE" LR,UR,LC,UC,X;
"INTEGER" LR,UR,LC,UC; "REAL" X; "ARRAY" A;
"CODE" 31011;
FORMAL PARAMETERS:
LR,UR,LC,UC: <ARITHMETIC EXPRESSION>;
LOWER AND UPPER ROW-INDEX, AND LOWER AND UPPER COLUMN-INDEX
OF THE MATRIX A, RESPECTIVELY;
A: <ARRAY IDENTIFIER>;
"ARRAY" A[LR : UR, LC : UC], THE ARRAY TO BE INITIALIZED;
X: <ARITHMETIC EXPRESSION>;
INITIALIZATION CONSTANT.
LANGUAGE: COMPASS.
SUBSECTION: INIMATD.
CALLING SEQUENCE:
HEADING:
"PROCEDURE" INIMATD(LR, UR, SHIFT, A, X); "VALUE" LR,UR,SHIFT,X;
"INTEGER" LR,UR,SHIFT; "REAL" X; "ARRAY" A;
"CODE" 31012;
FORMAL PARAMETERS:
LR,UR: <ARITHMETIC EXPRESSION>;
LOWER AND UPPER ROW-INDEX OF THE CODIAGONAL TO BE
INITIALIZED;
SHIFT: <ARITHMETIC EXPRESSION>;
DISTANCE BETWEEN DIAGONAL AND CODIAGONAL;
A: <ARRAY IDENTIFIER>;
"ARRAY" A[LR : UR, LR + SHIFT : UR + SHIFT], THE ARRAY TO
BE INITIALIZED;
X: <ARITHMETIC EXPRESSION>;
INITIALIZATION CONSTANT.
LANGUAGE: COMPASS.
1SECTION : 1.1.1 (DECEMBER 1979) PAGE 3
SUBSECTION: INISYMD.
CALLING SEQUENCE:
HEADING:
"PROCEDURE" INISYMD(LR, UR, SHIFT, A, X); "VALUE" LR,UR,SHIFT,X;
"INTEGER" LR,UR,SHIFT; "REAL" X; "ARRAY" A;
"CODE" 31013;
FORMAL PARAMETERS:
LR,UR: <ARITHMETIC EXPRESSION>;
LOWER AND UPPER ROW-INDEX OF AN UPPER CODIAGONAL ( OF A
SYMMETRIC MATRIX OF ORDER N ) TO BE INITIALIZED;
LR AND UR SHOULD SATISFY : LR >= 1, UR <= N;
SHIFT: <ARITHMETIC EXPRESSION>;
DISTANCE BETWEEN DIAGONAL AND CODIAGONAL, (0 =< SHIFT < N);
A: <ARRAY IDENTIFIER>;
A ONE-DIMENSIONAL ARRAY A[1 : N * (N+1)//2] CONTAINING THE
COLUMNWISE STORED UPPERTRIANGLE OF A SYMMETRIC MATRIX,
SUCH THAT THE (I,J) - TH ELEMENT OF THE MATRIX IS
A[ (J-1) * J//2 + I ]; J = 1,...,N; I = 1,...,J;
X: <ARITHMETIC EXPRESSION>;
INITIALIZATION CONSTANT.
LANGUAGE: ALGOL 60.
SUBSECTION: INISYMROW.
CALLING SEQUENCE:
HEADING:
"PROCEDURE" INISYMROW(L, U, I, A, X); "VALUE" L,U,I,X;
"INTEGER" L,U,I; "REAL" X; "ARRAY" A;
"CODE" 31014;
FORMAL PARAMETERS:
L,U: <ARITHMETIC EXPRESSION>;
LOWER AND UPPER INDEX OF ROW-ELEMENT TO BE INITIALIZED;
I: <ARITHMETIC EXPRESSION>;
ROW INDEX;
A: <ARRAY IDENTIFIER>;
A ONE-DIMENSIONAL ARRAY A[1 : N * (N+1)//2];
ARRAY A SHOULD CONTAIN A COLUMNWISE STORED UPPERTRIANGLE OF
A SYMMETRIC MATRIX OF ORDER N,
SUCH THAT THE (I,J) - TH ELEMENT OF THE MATRIX IS
A[ (J - 1) * J//2 + I ]; J = 1, ... ,N; I = 1, ... ,J.
FOR FIXED ORDER N, THE PARAMETERS L, U AND I SHOULD
SATISFY THE CONDITIONS : 1 <=L<= N, 1 <=U<= N, 1 <=I<= N ;
X: <ARITHMETIC EXPRESSION>;
INITIALIZATION CONSTANT.
LANGUAGE: ALGOL 60.
1SECTION : 1.1.1 (DECEMBER 1979) PAGE 4
SOURCE TEXT(S):
THE PROCEDURES INIVEC, INIMAT AND INIMATD ARE WRITTEN IN COMPASS, AN
EQUIVALENT ALGOL 60 TEXT OF THESE COMPASS ROUTINES IS GIVEN.
"CODE" 31010;
"PROCEDURE" INIVEC(L, U, A, X); "VALUE" L,U,X;
"INTEGER" L,U; "REAL" X; "ARRAY" A;
"FOR" L:= L "STEP" 1 "UNTIL" U "DO" A[L]:= X;
"EOP"
"CODE" 31011;
"PROCEDURE" INIMAT(LR, UR, LC, UC, A, X); "VALUE" LR,UR,LC,UC,X;
"INTEGER" LR,UR,LC,UC; "REAL" X; "ARRAY" A;
"BEGIN" "INTEGER" J;
"FOR" LR:= LR "STEP" 1 "UNTIL" UR "DO"
"FOR" J:= LC "STEP" 1 "UNTIL" UC "DO" A[LR, J]:= X
"END" INIMAT;
"EOP"
"CODE" 31012;
"PROCEDURE" INIMATD(LR, UR, SHIFT, A, X); "VALUE" LR,UR,SHIFT,X;
"INTEGER" LR,UR,SHIFT; "REAL" X; "ARRAY" A;
"FOR" LR:= LR "STEP" 1 "UNTIL" UR "DO" A[LR, LR + SHIFT]:= X;
"EOP"
"CODE" 31013;
"PROCEDURE" INISYMD(LR, UR, SHIFT, A, X); "VALUE" LR,UR,SHIFT,X;
"INTEGER" LR,UR,SHIFT; "REAL" X; "ARRAY" A;
"BEGIN" SHIFT:= ABS(SHIFT); UR:= UR + SHIFT + 1; SHIFT:=LR + SHIFT;
LR := (SHIFT - 3) * SHIFT // 2 + LR;
"FOR" LR := SHIFT + LR "WHILE" SHIFT < UR "DO"
"BEGIN" A[LR]:= X; SHIFT:= SHIFT + 1 "END"
"END" INISYMD;
"EOP"
"CODE" 31014;
"PROCEDURE" INISYMROW(L, U, I, A, X); "VALUE" L,U,I,X;
"INTEGER" L,U,I; "REAL" X; "ARRAY" A;
"BEGIN" "INTEGER" K;
"IF" L <= I "THEN"
"BEGIN" K:= (I - 1) * I//2; L := K + L;
K := ("IF" U < I "THEN" U "ELSE" I) + K;
"FOR" L:= L "STEP" 1 "UNTIL" K "DO" A[L]:= X;
L := I + 1
"END";
"IF" U>I "THEN""FOR" K:=(L-1)*L//2+I, K+L-1 "WHILE" L<= U "DO"
"BEGIN" A[K]:= X; L:= L + 1 "END"
"END" INISYMROW;
"EOP"
1SECTION : 1.1.2 (DECEMBER 1979) PAGE 1
AUTHOR: P.A.BEENTJES.
INSTITUTE: MATHEMATICAL CENTRE.
RECEIVED: 730715.
BRIEF DESCRIPTION:
THIS SECTION CONTAINS SIX PROCEDURES.
DUPVEC COPIES THE VECTOR GIVEN IN ARRAY B[L+SHIFT : U+SHIFT] TO THE
VECTOR GIVEN IN ARRAY A[L:U].
DUPVECROW COPIES THE ROW VECTOR GIVEN IN ARRAY B[I:I, L:U] TO THE
VECTOR GIVEN IN ARRAY A[L:U].
DUPROWVEC COPIES THE VECTOR GIVEN IN ARRAY B[L:U] TO THE ROW VECTOR
GIVEN IN ARRAY A[I:I, L:U].
DUPVECCOL COPIES THE COLUMN VECTOR GIVEN IN ARRAY B[L:U, J:J] TO
THE VECTOR GIVEN IN ARRAY A[L:U].
DUPCOLVEC COPIES THE VECTOR GIVEN IN ARRAY B[L:U] TO THE COLUMN
VECTOR GIVEN IN ARRAY A[L:U, J:J].
DUPMAT COPIES THE MATRIX GIVEN IN ARRAY B[L:U, I:J] TO THE MATRIX
GIVEN IN ARRAY A[L:U, I:J].
KEYWORDS:
ELEMENTARY PROCEDURE,
VECTOR OPERATIONS,
DUPLICATION.
SUBSECTION: DUPVEC.
CALLING SEQUENCE:
HEADING:
"PROCEDURE" DUPVEC(L, U, SHIFT, A, B); "VALUE" L,U,SHIFT;
"INTEGER" L,U,SHIFT; "ARRAY" A,B;
"CODE" 31030;
FORMAL PARAMETERS:
L,U: <ARITHMETIC EXPRESSION>;
LOWER AND UPPER VECTOR-INDEX, RESPECTIVELY;
SHIFT: <ARITHMETIC EXPRESSION>;
INDEX-SHIFTING PARAMETER;
A,B: <ARRAY IDENTIFIER>;
"ARRAY" A[L : U], B[L + SHIFT : U + SHIFT], B IS COPIED
INTO A.
LANGUAGE: COMPASS.
1SECTION : 1.1.2 (DECEMBER 1979) PAGE 2
SUBSECTION: DUPVECROW.
CALLING SEQUENCE:
HEADING:
"PROCEDURE" DUPVECROW(L, U, I, A, B); "VALUE" L,U,I;
"INTEGER" L,U,I; "ARRAY" A,B;
"CODE" 31031;
FORMAL PARAMETERS:
L,U: <ARITHMETIC EXPRESSION>;
LOWER AND UPPER VECTOR ( COLUMN )-INDEX, RESPECTIVELY;
I: <ARITHMETIC EXPRESSION>;
ROW-INDEX OF THE ROW VECTOR B;
A,B: <ARRAY IDENTIFIER>;
"ARRAY" A[L : U], B[I : I, L : U], B IS COPIED INTO A.
LANGUAGE: COMPASS.
SUBSECTION: DUPROWVEC.
CALLING SEQUENCE:
HEADING:
"PROCEDURE" DUPROWVEC(L, U, I, A, B); "VALUE" L,U,I;
"INTEGER" L,U,I; "ARRAY" A,B;
"CODE" 31032;
FORMAL PARAMETERS:
L,U: <ARITHMETIC EXPRESSION>;
LOWER AND UPPER VECTOR ( COLUMN )-INDEX, RESPECTIVELY;
I: <ARITHMETIC EXPRESSION>;
ROW-INDEX OF THE ROW VECTOR A;
A,B: <ARRAY IDENTIFIER>;
"ARRAY" A[I : I, L : U], B[L : U], B IS COPIED INTO A.
LANGUAGE: COMPASS.
1SECTION : 1.1.2 (DECEMBER 1979) PAGE 3
SUBSECTION: DUPVECCOL.
CALLING SEQUENCE:
HEADING:
"PROCEDURE" DUPVECCOL(L, U, J, A, B); "VALUE" L,U,J;
"INTEGER" L,U,J; "ARRAY" A,B;
"CODE" 31033;
FORMAL PARAMETERS:
L,U: <ARITHMETIC EXPRESSION>;
LOWER AND UPPER VECTOR ( ROW )-INDEX, RESPECTIVELY;
J: <ARITHMETIC EXPRESSION>;
COLUMN-INDEX OF THE COLUMN VECTOR B;
A,B: <ARRAY IDENTIFIER>;
"ARRAY" A[L : U], B[L : U, I : I], B IS COPIED INTO A.
LANGUAGE: COMPASS.
SUBSECTION: DUPCOLVEC.
CALLING SEQUENCE:
HEADING:
"PROCEDURE" DUPCOLVEC(L, U, J, A, B); "VALUE" L,U,J;
"INTEGER" L,U,J; "ARRAY" A,B;
"CODE" 31034;
FORMAL PARAMETERS:
L,U: <ARITHMETIC EXPRESSION>;
LOWER AND UPPER VECTOR ( ROW )-INDEX, RESPECTIVELY;
J: <ARITHMETIC EXPRESSION>;
COLUMN-INDEX OF THE COLUMN VECTOR A;
A,B: <ARRAY IDENTIFIER>;
"ARRAY" A[L : U, I : I], B[L : U], B IS COPIED INTO A.
LANGUAGE: COMPASS.
1SECTION : 1.1.2 (DECEMBER 1979) PAGE 4
SUBSECTION: DUPMAT.
CALLING SEQUENCE:
HEADING:
"PROCEDURE" DUPMAT(L, U, I, J, A, B); "VALUE" L,U,I,J;
"INTEGER" L,U,I,J; "ARRAY" A,B;
"CODE" 31035;
FORMAL PARAMETERS:
L,U: <ARITHMETIC EXPRESSION>;
LOWER AND UPPER ROW-INDEX, RESPECTIVELY;
I,J: <ARITHMETIC EXPRESSION>;
LOWER AND UPPER COLUMN-INDEX, RESPECTIVELY;
A,B: <ARRAY IDENTIFIER>;
"ARRAY" A[L : U, I : J], B[L : U, I : J], B IS COPIED INTO
A.
LANGUAGE: COMPASS.
1SECTION : 1.1.2 (DECEMBER 1979) PAGE 5
SOURCE TEXT(S):
THE FOLLOWING PROCEDURES ARE WRITTEN IN COMPASS, AN EQUIVALENT ALGOL 60
TEXT OF THESE COMPASS ROUTINES IS GIVEN.
"CODE" 31030;
"PROCEDURE" DUPVEC(L, U, SHIFT, A, B); "VALUE" L,U,SHIFT;
"INTEGER" L,U,SHIFT; "ARRAY" A,B;
"FOR" L:= L "STEP" 1 "UNTIL" U "DO" A[L]:= B[L+SHIFT];
"EOP"
"CODE" 31031;
"PROCEDURE" DUPVECROW(L, U, I, A, B); "VALUE" L,U,I;
"INTEGER" L,U,I; "ARRAY" A,B;
"FOR" L:= L "STEP" 1 "UNTIL" U "DO" A[L]:= B[I,L];
"EOP"
"CODE" 31032;
"PROCEDURE" DUPROWVEC(L, U, I, A, B); "VALUE" L,U,I;
"INTEGER" L,U,I; "ARRAY" A,B;
"FOR" L:= L "STEP" 1 "UNTIL" U "DO" A[I,L]:= B[L];
"EOP"
"CODE" 31033;
"PROCEDURE" DUPVECCOL(L, U, J, A, B); "VALUE" L,U,J;
"INTEGER" L,U,J; "ARRAY" A,B;
"FOR" L:= L "STEP" 1 "UNTIL" U "DO" A[L]:= B[L,J];
"EOP"
"CODE" 31034;
"PROCEDURE" DUPCOLVEC(L, U, J, A, B); "VALUE" L,U,J;
"INTEGER" L,U,J; "ARRAY" A,B;
"FOR" L:= L "STEP" 1 "UNTIL" U "DO" A[L,J]:= B[L];
"EOP"
"CODE" 31035;
"PROCEDURE" DUPMAT(L, U, I, J, A, B); "VALUE" L,U,I,J;
"INTEGER" L,U,I,J; "ARRAY" A,B;
"BEGIN" "INTEGER" K;
"FOR" L:= L "STEP" 1 "UNTIL" U "DO"
"FOR" K:= I "STEP" 1 "UNTIL" J "DO" A[L,K]:= B[L,K]
"END" DUPMAT;
"EOP"
1SECTION : 1.1.3 (DECEMBER 1979) PAGE 1
AUTHORS: P.A.BEENTJES, C.G. VAN DER LAAN.
INSTITUTE: MATHEMATICAL CENTRE.
RECEIVED: 730715.
BRIEF DESCRIPTION:
THIS SECTION CONTAINS FIVE PROCEDURES.
MULVEC STORES X TIMES THE VECTOR GIVEN IN ARRAY B[L+SHIFT:U+SHIFT]
INTO THE VECTOR GIVEN IN ARRAY A[L:U].
MULROW STORES X TIMES THE ROW VECTOR GIVEN IN ARRAY B[J:J,L:U] INTO
THE ROW VECTOR GIVEN IN ARRAY A[I:I,L:U].
MULCOL STORES X TIMES THE COLUMN VECTOR GIVEN IN ARRAY B[L:U,J:J]
INTO THE COLUMN VECTOR GIVEN IN ARRAY A[L:U,I:I].
COLCST MULTIPLIES THE COLUMN VECTOR GIVEN IN ARRAY A[L:U,J:J] BY X.
ROWCST MULTIPLIES THE ROW VECTOR GIVEN IN ARRAY A[I:I,L:U] BY X.
KEYWORDS:
ELEMENTARY PROCEDURE,
VECTOR OPERATIONS,
MULTIPLICATIONS.
SUBSECTION: MULVEC.
CALLING SEQUENCE:
HEADING:
"PROCEDURE" MULVEC(L, U, SHIFT, A, B, X); "VALUE" L,U,SHIFT,X;
"INTEGER" L,U,SHIFT; "REAL" X; "ARRAY" A,B;
"CODE" 31020;
FORMAL PARAMETERS:
L,U: <ARITMETIC EXPRESSION>;
LOWER AND UPPER VECTOR-INDEX, RESPECTIVELY;
SHIFT: <ARITHMETIC EXPRESSION>;
SUBSCRIPT-SHIFTING PARAMETER;
A,B: <ARRAY IDENTIFIER>;
"ARRAY" A[L : U], B[L + SHIFT : U + SHIFT], THE PRODUCT OF
THE CONTENTS OF B ARE STORED IN A.
X: <ARITHMETIC EXPRESSION>;
MULTIPLICATION FACTOR.
LANGUAGE: COMPASS.
1SECTION : 1.1.3 (DECEMBER 1979) PAGE 2
SUBSECTION: MULROW.
CALLING SEQUENCE:
HEADING:
"PROCEDURE" MULROW(L, U, I, J, A, B, X); "VALUE" L,U,I,J,X;
"INTEGER" L,U,I,J; "REAL" X; "ARRAY" A,B;
"CODE" 31021;
FORMAL PARAMETERS:
L,U: <ARITMETIC EXPRESSION>;
LOWER AND UPPER COLUMN-INDEX, RESPECTIVELY;
I,J: <ARITHMETIC EXPRESSION>;
ROW-INDICES OF THE ROW VECTORS A AND B;
A,B: <ARRAY IDENTIFIER>;
"ARRAY" A[I : I, L : U], B[J : J, L : U], THE CONTENTS OF B
MULTIPLIED BY X ARE STORED INTO A.
X: <ARITHMETIC EXPRESSION>;
MULTIPLICATION FACTOR.
LANGUAGE: COMPASS.
SUBSECTION: MULCOL.
CALLING SEQUENCE:
HEADING:
"PROCEDURE" MULCOL(L, U, I, J, A, B, X); "VALUE" L,U,I,J,X;
"INTEGER" L,U,I,J; "REAL" X; "ARRAY" A,B;
"CODE" 31022;
FORMAL PARAMETERS:
L,U: <ARITMETIC EXPRESSION>;
LOWER AND UPPER ROW-INDEX, RESPECTIVELY;
I,J: <ARITHMETIC EXPRESSION>;
COLUMN-INDICES OF THE COLUMN VECTORS A AND B;
A,B: <ARRAY IDENTIFIER>;
"ARRAY" A[L : U, I : I], B[L : U, J : J], THE CONTENTS OF B
MULTIPLIED BY X ARE STORED INTO A;
X: <ARITHMETIC EXPRESSION>;
MULTIPLICATION FACTOR.
LANGUAGE: COMPASS.
1SECTION : 1.1.3 (DECEMBER 1979) PAGE 3
SUBSECTION: COLCST.
CALLING SEQUENCE:
HEADING:
"PROCEDURE" COLCST(L, U, J, A, X); "VALUE" L,U,J,X;
"INTEGER" L,U,J; "REAL" X; "ARRAY" A;
"CODE" 31131;
FORMAL PARAMETERS:
L,U: <ARITHMETIC EXPRESSION>;
LOWER AND UPPER ROW-INDEX, RESPECTIVELY;
J: <ARITHMETIC EXPRESSION>;
COLUMN-INDEX;
A: <ARRAY IDENTIFIER>;
"ARRAY" A[L : U, J : J];
X: <ARITHMETIC EXPRESSION>;
MULTIPLICATION FACTOR.
LANGUAGE: COMPASS.
SUBSECTION: ROWCST.
CALLING SEQUENCE:
HEADING:
"PROCEDURE" ROWCST(L, U, I, A, X); "VALUE" L,U,I,X;
"INTEGER" L,U,I; "REAL" X; "ARRAY" A;
"CODE" 31132;
FORMAL PARAMETERS:
L,U: <ARITHMETIC EXPRESSION>;
LOWER AND UPPER COLUMN-INDEX, RESPECTIVELY;
I: <ARITHMETIC EXPRESSION>;
ROW-INDEX;
A: <ARRAY IDENTIFIER>;
"ARRAY" A[I : I, L : U];
X: <ARITHMETIC EXPRESSION>;
MULTIPLICATION FACTOR.
LANGUAGE: COMPASS.
1SECTION : 1.1.3 (DECEMBER 1979) PAGE 4
SOURCE TEXT(S):
THE FOLLOWING PROCEDURES ARE WRITTEN IN COMPASS, AN EQUIVALENT ALGOL 60
TEXT OF THESE COMPASS ROUTINES IS GIVEN.
"CODE" 31020;
"PROCEDURE" MULVEC(L, U, SHIFT, A, B, X); "VALUE" L,U,SHIFT,X;
"INTEGER" L,U,SHIFT; "REAL" X; "ARRAY" A,B;
"FOR" L:= L "STEP" 1 "UNTIL" U "DO" A[L]:= B[L+SHIFT]*X;
"EOP"
"CODE" 31021;
"PROCEDURE" MULROW(L, U, I, J, A, B, X); "VALUE" L,U,I,J,X;
"INTEGER" L,U,I,J; "REAL" X; "ARRAY" A,B;
"FOR" L:= L "STEP" 1 "UNTIL" U "DO" A[I,L]:= B[J,L]*X;
"EOP"
"CODE" 31022;
"PROCEDURE" MULCOL(L, U, I, J, A, B, X); "VALUE" L,U,I,J,X;
"INTEGER" L,U,I,J; "REAL" X; "ARRAY" A,B;
"FOR" L:= L "STEP" 1 "UNTIL" U "DO" A[L,I]:= B[L,J]*X;
"EOP"
"CODE" 31131;
"PROCEDURE" COLCST(L, U, J, A, X); "VALUE" L,U,J,X;
"INTEGER" L,U,J; "REAL" X; "ARRAY" A;
"FOR" L:= L "STEP" 1 "UNTIL" U "DO" A[L,J]:= A[L,J] * X;
"EOP"
"CODE" 31132;
"PROCEDURE" ROWCST(L, U, I, A, X); "VALUE" L,U,I,X;
"INTEGER" L,U,I; "REAL" X; "ARRAY" A;
"FOR" L:= L "STEP" 1 "UNTIL" U "DO" A[I,L]:= A[I,L] * X;
"EOP"
1SECTION : 1.1.4.1 (DECEMBER 1975) PAGE 1
AUTHORS: T.J.DEKKER, J.C.P.BUS, J.WOLLESWINKEL.
CONTRIBUTORS: P.A.BEENTJES, J.C.P.BUS.
INSTITUTE: MATHEMATICAL CENTRE.
RECEIVED: 741215.
BRIEF DESCRIPTION:
THIS SECTION CONTAINS NINE PROCEDURES.
VECVEC:= SCALAR PRODUCT OF THE VECTOR GIVEN IN ARRAY A[L:U] AND
ARRAY B[SHIFT + L : SHIFT + U].
MATVEC:= SCALAR PRODUCT OF THE ROW VECTOR GIVEN IN ARRAY A[I:I,L:U]
AND THE VECTOR GIVEN IN ARRAY B[L:U].
TAMVEC:= SCALAR PRODUCT OF THE COLUMN VECTOR GIVEN IN ARRAY
A[L:U, I:I] AND THE VECTOR GIVEN IN ARRAY B[L:U].
MATMAT:= SCALAR PRODUCT OF THE ROW VECTOR GIVEN IN ARRAY A[I:I,L:U]
AND THE COLUMN VECTOR IN ARRAY B[L:U, J:J].
TAMMAT:= SCALAR PRODUCT OF THE COLUMN VECTORS GIVEN IN ARRAY
A[L:U, I:I] AND ARRAY B[L:U, J:J].
MATTAM := SCALAR PRODUCT OF THE ROW VECTORS GIVEN IN ARRAY
A[I:I,L:U] AND ARRAY B[J:J, L:U].
SEQVEC := SCALAR PRODUCT OF THE VECTORS GIVEN IN ARRAY
A[IL : IL + (U+L-1)*(U-L)//2] AND ARRAY B[SHIFT + L : SHIFT + U],
WHERE THE ELEMENTS OF THE FIRST VECTOR ARE A[IL+(J+L-1)*(J-L)//2]
FOR J = L, ..., U.
SCAPRD1:= SCALAR PRODUCT OF THE VECTORS GIVEN IN ARRAY
A[MIN(LA, LA + (N - 1) * SA) : MAX(LA,LA + (N - 1) * SA)] AND ARRAY
B[MIN(LB, LB + (N - 1) * SB) : MAX(LB,LB + (N - 1) * SB)] WHERE THE
ELEMENTS OF THE VECTORS ARE A[LA+(J-1)*SA] AND B[LB+(J-1)*SB]
FOR J = 1, ..., N.
SYMMATVEC := THE SCALARPRODUCT OF ( A PART OF ) A VECTOR AND
( A PART OF ) A ROW OF A SYMMETRIC MATRIX , WHOSE UPPERTRIANGLE IS
GIVEN COLUMNWISE IN AN ONE-DIMENSIONAL ARRAY.
KEYWORDS:
ELEMENTARY PROCEDURE,
VECTOR OPERATIONS,
SCALAR PRODUCTS.
1SECTION : 1.1.4.1 (DECEMBER 1979) PAGE 2
SUBSECTION: VECVEC.
CALLING SEQUENCE:
HEADING:
"REAL" "PROCEDURE" VECVEC(L, U, SHIFT, A, B); "VALUE" L,U,SHIFT;
"INTEGER" L,U,SHIFT; "ARRAY" A,B;
"CODE" 34010;
FORMAL PARAMETERS:
L,U: <ARITHMETIC EXPRESSION>;
LOWER AND UPPER BOUND OF THE RUNNING SUBSCRIPT;
SHIFT: <ARITHMETIC EXPRESSION>;
INDEX-SHIFTING PARAMETER OF THE VECTOR B;
A,B: <ARRAY IDENTIFIER>;
"ARRAY" A[L : U], B[L + SHIFT : U + SHIFT].
LANGUAGE: COMPASS.
SUBSECTION: MATVEC.
CALLING SEQUENCE:
HEADING:
"REAL" "PROCEDURE" MATVEC(L, U, I, A, B); "VALUE" L,U,I;
"INTEGER" L,U,I; "ARRAY" A,B;
"CODE" 34011;
FORMAL PARAMETERS:
L,U: <ARITHMETIC EXPRESSION>;
LOWER AND UPPER BOUND OF THE RUNNING SUBSCRIPT;
I: <ARITHMETIC EXPRESSION>;
ROW-INDEX OF THE ROW VECTOR A;
A,B: <ARRAY IDENTIFIER>;
"ARRAY" A[I : I, L : U], B[L : U].
LANGUAGE: COMPASS.
1SECTION : 1.1.4.1 (DECEMBER 1979) PAGE 3
SUBSECTION: TAMVEC.
CALLING SEQUENCE:
HEADING:
"REAL" "PROCEDURE" TAMVEC(L, U, I, A, B); "VALUE" L,U,I;
"INTEGER" L,U,I; "ARRAY" A,B;
"CODE" 34012;
FORMAL PARAMETERS:
L,U: <ARITHMETIC EXPRESSION>;
LOWER AND UPPER BOUND OF THE RUNNING SUBSCRIPT;
I: <ARITHMETIC EXPRESSION>;
COLUMN-INDEX OF THE COLUMN VECTOR A;
A,B: <ARRAY IDENTIFIER>;
"ARRAY" A[L : U, I : I], B[L : U].
LANGUAGE: COMPASS.
SUBSECTION: MATMAT.
CALLING SEQUENCE:
HEADING:
"REAL" "PROCEDURE" MATMAT(L, U, I, J, A, B); "VALUE" L,U,I,J;
"INTEGER" L,U,I,J; "ARRAY" A,B;
"CODE" 34013;
FORMAL PARAMETERS:
L,U: <ARITHMETIC EXPRESSION>;
LOWER AND UPPER BOUND OF THE RUNNING SUBSCRIPT;
I,J: <ARITHMETIC EXPRESSION>;
ROW-INDEX OF THE ROW VECTOR A AND COLUMN-INDEX OF THE
COLUMN VECTOR B;
A,B: <ARRAY IDENTIFIER>;
"ARRAY" A[I : I, L : U], B[L : U, J : J].
LANGUAGE: COMPASS.
1SECTION : 1.1.4.1 (DECEMBER 1979) PAGE 4
SUBSECTION: TAMMAT.
CALLING SEQUENCE:
HEADING:
"REAL" "PROCEDURE" TAMMAT(L, U, I, J, A, B); "VALUE" L,U,I,J;
"INTEGER" L,U,I,J; "ARRAY" A,B;
"CODE" 34014;
FORMAL PARAMETERS:
L,U: <ARITHMETIC EXPRESSION>;
LOWER AND UPPER BOUND OF THE RUNNING SUBSCRIPT;
I,J: <ARITHMETIC EXPRESSION>;
COLUMN-INDICES OF THE COLUMN VECTORS A AND B, RESPECTIVELY;
A,B: <ARRAY IDENTIFIER>;
"ARRAY" A[L : U, I : I], B[L : U, J : J].
LANGUAGE: COMPASS.
SUBSECTION: MATTAM.
CALLING SEQUENCE:
HEADING:
"REAL" "PROCEDURE" MATTAM(L, U, I, J, A, B); "VALUE" L,U,I,J;
"INTEGER" L,U,I,J; "ARRAY" A,B;
"CODE" 34015;
FORMAL PARAMETERS:
L,U: <ARITHMETIC EXPRESSION>;
LOWER AND UPPER BOUND OF THE RUNNING SUBSCRIPT;
I,J: <ARITHMETIC EXPRESSION>;
ROW-INDICES OF THE ROW VECTORS A AND B, RESPECTIVELY;
A,B: <ARRAY IDENTIFIER>;
"ARRAY" A[I : I, L : U], B[J : J, L : U].
LANGUAGE: COMPASS.
1SECTION : 1.1.4.1 (DECEMBER 1979) PAGE 5
SUBSECTION: SEQVEC.
CALLING SEQUENCE:
HEADING:
"REAL" "PROCEDURE" SEQVEC(L, U, IL, SHIFT, A, B);
"VALUE" L, U, IL, SHIFT; "INTEGER" L, U, IL, SHIFT; "ARRAY" A, B;
"CODE" 34016;
FORMAL PARAMETERS:
L,U: <ARITHMETIC EXPRESSION>;
LOWER AND UPPER BOUND OF THE RUNNING SUBSCRIPT;
IL: <ARITHMETIC EXPRESSION>;
LOWER BOUND OF THE VECTOR A;
SHIFT: <ARITHMETIC EXPRESSION>;
INDEX-SHIFTING PARAMETER OF THE VECTOR B;
A,B: <ARRAY IDENTIFIER>;
"ARRAY" A[P : Q], B[L + SHIFT, U + SHIFT];
THE VALUES OF P AND Q SHOULD SATISFY P <= IL AND Q >=
IL+(U+L-1)*(U-L)//2).
LANGUAGE: COMPASS.
SUBSECTION: SCAPRD1.
CALLING SEQUENCE:
HEADING:
"REAL" "PROCEDURE" SCAPRD1(LA, SA, LB, SB, N, A, B);
"VALUE" LA,SA,LB,SB,N; "INTEGER" LA,SA,LB,SB,N; "ARRAY" A,B;
"CODE" 34017;
FORMAL PARAMETERS:
N: <ARITHMETIC EXPRESSION>;
UPPER BOUND OF THE RUNNING SUBSCRIPT;
LA,LB: <ARITHMETIC EXPRESSION>;
LOWER BOUNDS OF THE VECTORS A AND B, RESPECTIVELY;
SA,SB: <ARITHMETIC EXPRESSION>;
INDEX-SHIFTING PARAMETERS OF THE VECTORS A AND B,
RESPECTIVELY;
A,B: <ARRAY IDENTIFIER>;
"ARRAY" A[P : Q], B[R : S];
THE SUBSCRIPTS ABOVE AND THE VALUES OF LA( +(J-1)*SA ) AND
LB( +(J-1)*SB ),J = 1(1)N SHOULD NOT CONTRADICT EACH OTHER.
LANGUAGE: COMPASS.
1SECTION : 1.1.4.1 (MARCH 1977) PAGE 6
SUBSECTION: SYMMATVEC.
CALLING SEQUENCE:
THE HEADING OF THE PROCEDURE READS:
"REAL" "PROCEDURE" SYMMATVEC(L, U, I, A, B); "VALUE" L,U,I;
"INTEGER" L,U,I; "ARRAY" A,B;
"CODE" 34018;
SYMMATVEC:= THE VALUE OF THE SCALAR PRODUCT OF THE VECTORS GIVEN
IN ARRAY A[P:Q] AND ARRAY B[L:U] , WHERE THE ELEMENTS
OF THE FIRST VECTOR ARE: IF L<I THEN A[(I-1)*I//2 + J],
J=L,..., MIN(U, I-1) AND A[(J-1)*J//2 + I], J=I,..., U,
RESPECTIVELY , OTHERWISE A[(J-1)*J//2 + I], J=L,..., U.
THE MEANING OF THE FORMAL PARAMETERS IS:
L,U: <ARITHMETIC EXPRESSION>;
LOWER AND UPPER BOUND OF THE VECTOR B, RESPECTIVELY; L >=1;
I: <ARITHMETIC EXPRESSION>;
ROW INDEX OF THE MATRIX A; I >= 1;
A: <ARRAY IDENTIFIER>;
A ONE-DIMENSIONAL ARRAY A[P : Q] WITH: IF I > L THEN
P=(I-1)*I//2 + L ELSE P=(L-1)*L//2 + I AND IF I > U THEN
Q=(I-1)*I//2 + U ELSE Q=(U-1)*U//2 + I;
B: <ARRAY IDENTIFIER>;
A ONE-DIMENSIONAL ARRAY B[L:U];
PROCEDURES USED:
VECVEC = CP34010,
SEQVEC = CP34016.
LANGUAGE: ALGOL 60.
METHOD AND PERFORMANCE:
SEE REFERENCE [2].
REFERENCES :
[1] T.J.DEKKER.
ALGOL 60 PROCEDURES IN NUMERICAL ALGEBRA,PART 1,
MATHEMATICAL CENTRE TRACT 22,AMSTERDAM (1970)
[2] J.C.P.BUS.
MINIMALISERING VAN FUNCTIES VAN MEERDERE VARIABELEN,
MATHEMATICAL CENTRE, NR 29/72,AMSTERDAM (1972)
1SECTION : 1.1.4.1 (DECEMBER 1979) PAGE 7
SOURCE TEXT(S):
THE FOLLOWING PROCEDURES, EXCEPT FOR SYMMATVEC ARE WRITTEN IN COMPASS,
AN EQUIVALENT ALGOL 60 TEXT OF THESE COMPASS ROUTINES IS GIVEN.
0"CODE" 34010;
"REAL" "PROCEDURE" VECVEC(L, U, SHIFT, A, B); "VALUE" L,U,SHIFT;
"INTEGER" L,U,SHIFT; "ARRAY" A,B;
"BEGIN" "INTEGER" K; "REAL" S;
S:= 0;
"FOR" K:=L "STEP" 1 "UNTIL" U "DO" S:= A[K] * B[SHIFT + K] + S;
VECVEC:= S
"END" VECVEC;
"EOP"
0"CODE" 34011;
"REAL" "PROCEDURE" MATVEC(L, U, I, A, B); "VALUE" L,U,I;
"INTEGER" L,U,I; "ARRAY" A,B;
"BEGIN" "INTEGER" K; "REAL" S;
S:= 0;
"FOR" K:=L "STEP" 1 "UNTIL" U "DO" S:= A[I,K] * B[K] + S;
MATVEC:= S
"END" MATVEC;
"EOP"
0"CODE" 34012;
"REAL" "PROCEDURE" TAMVEC(L, U, I, A, B); "VALUE" L,U,I;
"INTEGER" L,U,I; "ARRAY" A,B;
"BEGIN" "INTEGER" K; "REAL" S;
S:= 0;
"FOR" K:=L "STEP" 1 "UNTIL" U "DO" S:= A[K,I] * B[K] + S;
TAMVEC:= S
"END" TAMVEC;
"EOP"
0"CODE" 34013;
"REAL" "PROCEDURE" MATMAT(L, U, I, J, A, B); "VALUE" L,U,I,J;
"INTEGER" L,U,I,J; "ARRAY" A,B;
"BEGIN" "INTEGER" K; "REAL" S;
S:= 0;
"FOR" K:=L "STEP" 1 "UNTIL" U "DO" S:= A[I,K] * B[K,J] + S;
MATMAT:= S
"END" MATMAT
1SECTION : 1.1.4.1 (DECEMBER 1975) PAGE 8
;
"EOP"
0"CODE" 34014;
"REAL" "PROCEDURE" TAMMAT(L, U, I, J, A, B); "VALUE" L,U,I,J;
"INTEGER" L,U,I,J; "ARRAY" A,B;
"BEGIN" "INTEGER" K; "REAL" S;
S:= 0;