[[
✎ pl:prolog:pllib:vectors_inner_product
]]
aiWiki
Pokaż stronę
Ostatnie zmiany
Indeks
Zaloguj
Ta strona jest tylko do odczytu. Możesz wyświetlić źródła tej strony ale nie możesz ich zmienić.
====== Vectors inner product ====== {{tag>math}} ===== Description ===== Computing inner products of vectors iteratively. **Source**: The Art of Prolog ===== Download ===== Program source code: {{vectors_inner_product.pl}} ===== Listing ===== <code prolog> /* inner_product(Xs,Ys,Value) :- Value is the inner product of the vectors represented by the lists of integers Xs and Ys. */ inner_product(Xs,Ys,IP) :- inner_product(Xs,Ys,0,IP). inner_product([X|Xs],[Y|Ys],Temp,IP) :- Temp1 is X*Y+Temp, inner_product(Xs,Ys,Temp1,IP). inner_product([],[],IP,IP). % Program 8.7b Computing inner products of vectors iteratively </code> ===== Comments =====
pl/prolog/pllib/vectors_inner_product.txt
· ostatnio zmienione: 2019/06/27 15:50 (edycja zewnętrzna)
Pokaż stronę
Poprzednie wersje
Menadżer multimediów
Do góry