transpose.pl

loading
details
attribute value
description
owner Johannes Waldmann
uploaded 2017-08-17 03:45:07.0
disk size 1.07 KB
downloadable true
type
attribute value
name no_type
processor id 1
description this is the default benchmark type for rejected benchmarks and benchmarks that are not associated with a type.
owning community none
loading contents
%query: transpose(i,o).
%TWTYPES :- type transpose(matrix,matrix).

transpose(A,B) :-
        transpose_aux(A,[],B).

%TWTYPES :- type transpose_aux(matrix,matrix,matrix).

transpose_aux([R|Rs],_,[C|Cs]) :-
    row2col(R,[C|Cs],Cols1,[],Accm),
    transpose_aux(Rs,Accm,Cols1).
transpose_aux([], X, X).

%TWTYPES :- type row2col(row,matrix,matrix,matrix,matrix).

row2col([X|Xs],[[X|Ys]|Cols],[Ys|Cols1],A,B) :-
    row2col(Xs,Cols,Cols1,[[]|A],B).
row2col([],[],[],A,A).







/*TWDESC

Transpose a matrix

*/


/*TWTYPES

row([X|Xs]) :-
	row(Xs).
row([]).

matrix([X|Xs]) :-
	row(X),
	matrix(Xs).
matrix([]).
*/



/*TWDEMO

selected_norms([row]).
*/
/*.

msg(norms,"Now we select the norm row which counts the number of elements in the matrix. In order to continue press tha Abstract Program Button.").

msg(settings,"I set all the parameters for you, just choose checking or inference !.").

msg(check1,"I even select a query for you !.").

msg(check2,"Any thing more ?.").

msg(inference,"Well, I inferred the terminating queries,
      I think it is more than enough. ciao ciao. !.").
*/

popout

content may be truncated. 'popout' for larger text window.

actions get anonymous link download benchmark