Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
14
Task/Matrix-transposition/Pop11/matrix-transposition.pop11
Normal file
14
Task/Matrix-transposition/Pop11/matrix-transposition.pop11
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
define transpose(m) -> res;
|
||||
lvars bl = boundslist(m);
|
||||
if length(bl) /= 4 then
|
||||
throw([need_2d_array ^a])
|
||||
endif;
|
||||
lvars i, i0 = bl(1), i1 = bl(2);
|
||||
lvars j, j0 = bl(3), j1 = bl(4);
|
||||
newarray([^j0 ^j1 ^i0 ^i1], 0) -> res;
|
||||
for i from i0 to i1 do
|
||||
for j from j0 to j1 do
|
||||
m(i, j) -> res(j, i);
|
||||
endfor;
|
||||
endfor;
|
||||
enddefine;
|
||||
Loading…
Add table
Add a link
Reference in a new issue