Matrix add

Description

Adding two matrixs

Source: PROLOG str. 201 Wydawnictwo PLJ Warszawa 1991 ISBN 83-85190-63-5

Download

Program source code: matrix_add.pl

Listing

dodm([L1|O1], [L2|O2], [L3|O3]) :- dod1(L1, L2, L3), dodm(O1, O2, O3).
dodm([], [], []).
dod1([L1|O1], [L2|O2], [L3|O3]) :- L3 is L1 + L2, dod1(O1, O2, O3).
dod1([], [], []).
 
test :- dodm([[1, 3], [4, 5]], [[6, 3], [6, 8]], M).

Comments

pl/prolog/pllib/matrix_add.txt · ostatnio zmienione: 2017/07/17 08:08 (edycja zewnętrzna)
www.chimeric.de Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0