PsiLAB Help Manual Page

Section: Basic Matrix functions

Name: =<+.>

Add the elements of the the matrix a and a constant b.
The result is stored in an already allocated matrix c.
c.{i,j,k,...} <- a.{i,j,k,...} + b

Both matrices a and b must have the same size and dimension. The resulting matrix c is of the same size, type and dimension.
Supported types: [ int,float,complex ]
[ c:('a, 'b, 'c) Matrix.t ] =<+>
a:('a, 'b, 'c) Matrix.t *
b:'a

Example:
[] let i = imatrix ~dim:[50;40] ~rand:[1000] () ;; 
val i : (int, '_a, '_b) Matrix.t = <abstr> 
[] let c = imatrix ~dim:[50;40] () ;; 
val i : (int, '_a, '_b) Matrix.t = <abstr> 
[] c =<+> (i,10) ;; 
- unit 

With the operator =<.+> , the matrix and constant are interchanged.
Printed by PsiLAB