Jump to content

Matrix transposition: Difference between revisions

Line 1,111:
 
transpose(In, Out) :-
In = [H | _T],
lengthmaplist(initdl, H, LenL),
lengthwork(LT, Len)In, Out).
maplist(initdl, L),
work(L, In, Out).
 
% we use the difference list to make "quick" appends (one inference)
initdl(V, [V | X] - X).
 
work(Lst, [], Out) :-
Line 1,136 ⟶ 1,134:
dl2l(X-[], X).
</lang>
 
 
=={{header|PureBasic}}==
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.