(e)
return e
Convert a zero matrix to the scalar zero.
Convert a zero matrix to the scalar zero.
Convert a zero matrix to the scalar zero .
def matrix_to_zero(e):
    """Convert a zero matrix to the scalar zero."""
    if isinstance(e, Matrix):
        if zeros(*e.shape) == e:
            e = Integer(0)
    elif isinstance(e, numpy_ndarray):
        e = _numpy_matrix_to_zero(e)
    elif isinstance(e, scipy_sparse_matrix):
        e = _scipy_sparse_matrix_to_zero(e)
    return e
def matrix_to_zero ( e ) : if isinstance ( e , Matrix ) : if zeros ( * e . shape ) == e : e = Integer ( 0 ) elif isinstance ( e , numpy_ndarray ) : e = _numpy_matrix_to_zero ( e ) elif isinstance ( e , scipy_sparse_matrix ) : e = _scipy_sparse_matrix_to_zero ( e ) return e