PsiLAB Help Manual Page

Section: Basic Matrix functions

Name: matrix_copy

Copy all elements of a matrix to another matrix.
Both matrices must have the same sizes and dimension. In contrast to the copy argument from the [f,i,c]matrix functions, the target matrix must already allocated.

matrix_copy
a:('a, 'b, 'c) Matrix.t
b:('a, 'b, 'c) Matrix.t

The source matrix is a , and the target matrix is b .
Example:
[] let a = fmatrix ~dim:[5;3] ~rand:[1.0] () ;; 
val a : (float, '_a, '_b) Matrix.t = <abstr> 
[] let b = fmatrix ~dim:[5;3] ~fill:[0.0] () ;; 
val b : (float, '_a, '_b) Matrix.t = <abstr> 
[] matrix_copy a b ;; 
- : unit = () 

Printed by PsiLAB