'Checks data structure for consistency'

def _check(self):

    if (self.row.dtype.kind != 'i'):
        warn(('row    index    array    has    non-integer    dtype    (%s)        ' % self.row.dtype.name))
    if (self.col.dtype.kind != 'i'):
        warn(('col    index    array    has    non-integer    dtype    (%s)    ' % self.col.dtype.name))
    idx_dtype = get_index_dtype(maxval=max(self.shape))
    self.row = np.asarray(self.row, dtype=idx_dtype)
    self.col = np.asarray(self.col, dtype=idx_dtype)
    self.data = to_native(self.data)
    if (self.nnz > 0):
        if (self.row.max() >= self.shape[0]):
            raise ValueError('row    index    exceeds    matrix    dimensions')
        if (self.col.max() >= self.shape[1]):
            raise ValueError('column    index    exceeds    matrix    dimensions')
        if (self.row.min() < 0):
            raise ValueError('negative    row    index    found')
        if (self.col.min() < 0):
            raise ValueError('negative    column    index    found')
