def numba_array2d_nnz(ary, width, height):
    """
    Function will return the number of nonzero values of the full matrix.
    Inputs:
        ary     : input matrix
        width   : number of columns of the matrix
        height  : number of rows of the matrix
    Outputs:
        nnz     : number of nonzero values
    """
    nnz = 0
    for line in range(height):
        for col in range(width):
            if ary[line,col] != 0:
                nnz = nnz + 1
    return nnz