class_docstr: base matrix class for compressed row and column oriented matrices
class_docstr_tok: ["base","matrix","class","for","compressed","row","and","column","oriented","matrices"]
docstr: check whether the matrix format is valid
  
  Parameters
  ----------
  full_check : bool, optional
      If `True`, rigorous check, O(N) operations. Otherwise
      basic check, O(1) operations (default True).
code: def check_format(self, full_check=True):
      """check whether the matrix format is valid
  
      Parameters
      ----------
      full_check : bool, optional
          If `True`, rigorous check, O(N) operations. Otherwise
          basic check, O(1) operations (default True).
      """
      # use _swap to determine proper bounds
      major_name, minor_name = self._swap(("row", "column"))
      major_dim, minor_dim = self._swap(self.shape)
  
      # index arrays should have integer data types
      if self.indptr.dtype.kind != "i":
          warn(
              "indptr array has non-integer dtype ({})"
              "".format(self.indptr.dtype.name),
              stacklevel=3,
          )
      if self.indices.dtype.kind != "i":
          warn(
              "indices array has non-integer dtype ({})"
              "".format(self.indices.dtype.name),
              stacklevel=3,
          )
  
      idx_dtype = get_index_dtype((self.indptr, self.indices))
      self.indptr = np.asarray(self.indptr, dtype=idx_dtype)
      self.indices = np.asarray(self.indices, dtype=idx_dtype)
      self.data = to_native(self.data)
  
      # check array shapes
      for x in [self.data.ndim, self.indices.ndim, self.indptr.ndim]:
          if x != 1:
              raise ValueError(
                  "data, indices, and indptr should be 1-D"
              )
  
      # check index pointer
      if len(self.indptr) != major_dim + 1:
          raise ValueError(
              "index pointer size ({}) should be ({})"
              "".format(len(self.indptr), major_dim + 1)
          )
      if self.indptr[0] != 0:
          raise ValueError("index pointer should start with 0")
  
      # check index and data arrays
      if len(self.indices) != len(self.data):
          raise ValueError("indices and data should have the same size")
      if self.indptr[-1] > len(self.indices):
          raise ValueError(
              "Last value of index pointer should be less than "
              "the size of index and data arrays"
          )
  
      self.prune()
  
      if full_check:
          # check format validity (more expensive)
          if self.nnz > 0:
              if self.indices.max() >= minor_dim:
                  raise ValueError(
                      "{} index values must be < {}"
                      "".format(minor_name, minor_dim)
                  )
              if self.indices.min() < 0:
                  raise ValueError(
                      "{} index values must be >= 0"
                      "".format(minor_name)
                  )
              if np.diff(self.indptr).min() < 0:
                  raise ValueError(
                      "index pointer values must form a "
                      "non-decreasing sequence"
                  )
  
imports: from __future__ import division, print_function, absolute_import
  from warnings import warn
  import operator
  import numpy
  from scipy._lib.six import zip
  from scipy._lib._util import _prune_array
  from .base import spmatrix, isspmatrix, SparseEfficiencyWarning
  from .data import _data_matrix, _minmax_mixin
  from .dia import dia_matrix
  from .None import _sparsetools
  from .sputils import upcast, upcast_char, to_native, isdense, isshape, getdtype, isscalarlike, IndexMixin, get_index_dtype, downcast_intp_index, get_sum_dtype, check_shape, matrix, asmatrix
label_desc: Use image node_id 4 for calling the _cs_matrix obj's underlying member method code with example usage: obj.check_format(full_check) without return types