PsiLAB Help Manual
Page
Section:
High level matrix functions
Name:
vecprod
Calculate the scalar product of two vectors.
Special case of matrix row by column multiplication:
a * b T
[ c:'a ] = vecprod
a:('a, 'b, 'c) Matrix.t
b:('a, 'd, 'e) Matrix.t
Examples:
[] let a = imatrix ~const:[1;2;3] ();;
val a : (int, '_a, '_b) Matrix.t = <abstr>
[] let b = imatrix ~const:[-1;2;-3] ();;
val b : (int, '_a, '_b) Matrix.t = <abstr>
[] let v = vecprod a b ;;
val v : int = -6
[] let v = a <.*.> b ;; (* shortcut *)
val v : int = -6
Printed by PsiLAB