NE - elementwise not equal
This procedure implements an elementwise computation of the C := A <> B comparison, where A, B, and C are matrices.
Usage
The NE stored procedure has the following syntax:
- NE(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 dimensions, that is, the same number of rows and columns. Matrix C is given the same shape. Matrix C must not exist prior to the operation. Matrix C contains only 0 and 1, 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..ne('A','B','C');
CALL nzm..print('A');
CALL nzm..print('B');
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)
NE
----
t
(1 row)
PRINT
-----------------------------------------
-- matrix: A --
1, 2, 3
4, 5, 0
6, 7, 8
(1 row)
PRINT
-------------------------------------------
-- matrix: B --
1, 15, 5
7, 1, 15
5, 7, 1
(1 row)
PRINT
-----------------------------------------
-- matrix: C --
0, 1, 1
1, 1, 1
1, 0, 1
(1row)
DELETE_MATRIX
---------------
t
(1 row)
DELETE_MATRIX
---------------
t
(1 row)
DELETE_MATRIX
---------------
t
(1 row)