I need to find the product of the matrix A with its transpose A^t, so I should get a third matrix B=A*A^t.
Example: A=[[1,2],[3,4]]
(then A^t=[[1,3],[2,4]]
) so B=[[5,11],[11,25]]
(each sub list is a row of the matrix)
Firstly I think that this should be easier as the columns of A^t are the rows of A. So for the dot product of the row of A with the column of A^t I think I can use this:
sum([M|Ms],[N|Ns],Sum) :-
sum(Ms,Ns,S),
Sum is S+M*N.
sum([],[],0).
I also can't use clpfd or if-else.
I've been stuck and don't know what to do next.