MATRIX_VECTOR_OPERATION
This procedure implements elementwise matrix-vector operations.
Usage
The MATRIX_VECTOR_OPERATION stored procedure has the following syntax:
- MATRIX_VECTR_OPERATION(matrixIn,matrixOut,vector,operator,orientation)
- Parameters
- matrixIn
- The name of the input matrix.
- matrixOut
- The name of the output matrix.
- vector
- The name of the vector matrix.
- operator
- The operator to use. Must be one of the following: + = * / % ^ & |
- orientation
- The orientation of the operation, that is, whether it should be applied to
Details
The procedure implements elementwise matrix-vector operations. Depending on the specified orientation, each row, column or the diagonal Xis transformed in the form X_new:=X [operator] 'vector'.
Examples
CALL nzm..SHAPE('1,2,3,4,5,6,7,8,9', 3, 3, 'A');
CALL nzm..REDUCE_TO_VECT('A','V','AVG',null,'r');
CALL nzm..MATRIX_VECTOR_OPERATION('A', 'B', 'V', '-','r');
CALL nzm..PRINT('A');
CALL nzm..PRINT('V');
CALL nzm..PRINT('B');
CALL nzm..DELETE_MATRIX('A');
CALL nzm..DELETE_MATRIX('B');
CALL nzm..DELETE_MATRIX('V');
SHAPE
-------
t
(1 row)
REDUCE_TO_VECT
----------------
t
(1 row)
MATRIX_VECTOR_OPERATION
-------------------------
t
(1 row)
PRINT
-----------------------------------------
-- matrix: A --
1, 2, 3
4, 5, 6
7, 8, 9
(1 row)
PRINT
-------------------------
-- matrix: V --
4, 5, 6
(1 row)
PRINT
--------------------------------------------
-- matrix: B --
3, -3, -3
0, 0, 0
3, 3, 3
(1 row)
DELETE_MATRIX
---------------
t
(1 row)
DELETE_MATRIX
---------------
t
(1 row)
DELETE_MATRIX
---------------
t
(1 row)