EQ - elementwise equal
This procedure implements an element wise computation of the C := A == B comparison, where A, B, and C are matrices.
Usage
The EQ stored procedure has the following syntax:
- EQ(matrixAname,matrixBname,matrixCname)
- Parameters
- matrixAname
- The name of input matrix A.
- matrixBname
- The name of input matrix B.
- matrixCname
- The name of output matrix C.
Details
Matrices A and B must have the same number of dimensions,that is, the same number of rows and columns. The output matrix C is given the same shape. Matrix C must not exist prior to the operation. Matrix C contains only zeros and ones, corresponding to FALSE and TRUE at respective positions.
Examples
CALL nzm..SHAPE('1,2,3,4,5,0,6,7,8', 3, 3, 'A');
CALL nzm..SHAPE('1,15,5,7', 3, 3, 'B');
CALL nzm..EQ('A', 'B', 'C');
CALL nzm..PRINT('C');
CALL nzm..DELETE_MATRIX('A');
CALL nzm..DELETE_MATRIX('B');
CALL nzm..DELETE_MATRIX('C');
SHAPE
-------
t
(1 row)
SHAPE
-------
t
(1 row)
EQ
----
t
(1 row)
PRINT
-----------------------------------------
-- matrix: C --
1, 0, 0
0, 0, 0
0, 1, 0
(1 row)
DELETE_MATRIX
---------------
t
(1 row)
DELETE_MATRIX
---------------
t
(1 row)
DELETE_MATRIX
---------------
t
(1 row)