langs a-z
This commit is contained in:
parent
db842d013d
commit
d066446780
11389 changed files with 98361 additions and 1020 deletions
|
|
@ -0,0 +1,3 @@
|
|||
/* The short method: */
|
||||
declare A(m, n) float, B (n,m) float defined (A(2sub, 1sub));
|
||||
/* Any reference to B gives the transpose of matrix A. */
|
||||
15
Task/Matrix-transposition/PL-I/matrix-transposition-2.pli
Normal file
15
Task/Matrix-transposition/PL-I/matrix-transposition-2.pli
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
/* Transpose matrix A, result at B. */
|
||||
transpose: procedure (a, b);
|
||||
declare (a, b) (*,*) float controlled;
|
||||
declare (m, n) fixed binary;
|
||||
|
||||
if allocation(b) > 0 then free b;
|
||||
|
||||
m = hbound(a,1); n = hbound(a,2);
|
||||
|
||||
allocate b(n,m);
|
||||
|
||||
do i = 1 to m;
|
||||
b(*,i) = a(i,*);
|
||||
end;
|
||||
end transpose;
|
||||
Loading…
Add table
Add a link
Reference in a new issue