ANY_NONZERO

This stored procedure determines if any values in a matrix are non-zero.

Usage

The ALL_NONZERO stored procedure has the following syntax:
ANY_NONZERO(matrixName)
Parameters
matrixName
A string representing the name of the matrix.
Type: NVARCHAR(ANY)
Returns
DOUBLE. Returns 1 if any value are non-zero; 0 otherwise.

Details

Note that this operation checks for exact zeros, and fails to recognize "approximated zeros." Therefore, if the input matrix is a result of some approximation operations that should produce zero, but instead deliver an approximation of zero, then the procedure returns 1, as it recognizes some values as non-zero.

Examples

CALL nzm..SHAPE('6,0,9, 4,6,0',2,3,'AA');
SELECT nzm..ANY_NONZERO('AA');
CALL nzm..DELETE_MATRIX('AA' );

 SHAPE
-------
 t
(1 row)

 ANY_NONZERO
-------------
           1
(1 row)

 DELETE_MATRIX
---------------
 t
(1 row)

CALL nzm..SHAPE('0',2,3,'BB');
SELECTnzm..ANY_NONZERO('BB');
CALL nzm..DELETE_MATRIX('BB' );

 SHAPE
-------
 t
(1 row)

 ANY_NONZERO
-------------
           0
(1 row)

 DELETE_MATRIX
---------------
 t
(1row)