PsiLAB Help Manual
Page
Section:
High level matrix functions
Name:
=<-*|>
Matrix row versa column multiplication.
This function multiply each row from the argument matrix a with each column of the argument matrix b and stores each sum value of this multiplication in the already allocated matrix c .
[ c:('a, 'b, 'c) Matrix.t ] =<-*|>
a:('a, 'b, 'c) Matrix.t *
b:('a, 'b, 'c) Matrix.t
Only applicable to 2 dimensional matrixes. Special case: matrix * vector. The new matrix has the size:
size[a]:(m,n) size[b]:(n,u) size[c]:(m,u)
Example:
[] let a = fmatrix ~dim:[5;3] ~rand:[1.0] () ;;
val a : (float, '_a, '_b) Matrix.t = <abstr>
[] let b = fmatrix ~dim:[3;2] ~rand:[1.0] () ;;
val b : (float, '_a, '_b) Matrix.t = <abstr>
[] let c = fmatrix ~dim:[5;2] () ;;
[] c =<-*|> (a,b) ;;
val c : (float, '_a, '_b) Matrix.t = <abstr>
[] print_fmat c ;;
| 0.8906 0.9435 |
| 1.059 1.058 |
| 1.064 0.838 |
| 0.6765 0.3218 |
| 1.449 1.161 |
Printed by PsiLAB