def check_format(self, full_check=True):
<EOL>major_name,minor_name = self._swap(('<STR_LIT>','<STR_LIT>'))<EOL>major_dim,minor_dim = self._swap(self.shape)<EOL>if self.indptr.dtype.kind != '<STR_LIT:i>':<EOL><INDENT>warn("<STR_LIT>"<EOL>% self.indptr.dtype.name)<EOL><DEDENT>if self.indices.dtype.kind != '<STR_LIT:i>':<EOL><INDENT>warn("<STR_LIT>"<EOL>% self.indices.dtype.name)<EOL><DEDENT>idx_dtype = get_index_dtype((self.indptr, self.indices))<EOL>self.indptr = np.asarray(self.indptr, dtype=idx_dtype)<EOL>self.indices = np.asarray(self.indices, dtype=idx_dtype)<EOL>self.data = to_native(self.data)<EOL>if self.data.ndim != <NUM_LIT:1> or self.indices.ndim != <NUM_LIT:1> or self.indptr.ndim != <NUM_LIT:1>:<EOL><INDENT>raise ValueError('<STR_LIT>')<EOL><DEDENT>if (len(self.indptr) != major_dim + <NUM_LIT:1>):<EOL><INDENT>raise ValueError("<STR_LIT>" %<EOL>(len(self.indptr), major_dim + <NUM_LIT:1>))<EOL><DEDENT>if (self.indptr[<NUM_LIT:0>] != <NUM_LIT:0>):<EOL><INDENT>raise ValueError("<STR_LIT>")<EOL><DEDENT>if (len(self.indices) != len(self.data)):<EOL><INDENT>raise ValueError("<STR_LIT>")<EOL><DEDENT>if (self.indptr[-<NUM_LIT:1>] > len(self.indices)):<EOL><INDENT>raise ValueError("<STR_LIT>"<EOL>"<STR_LIT>")<EOL><DEDENT>self.prune()<EOL>if full_check:<EOL><INDENT>if self.nnz > <NUM_LIT:0>:<EOL><INDENT>if self.indices.max() >= minor_dim:<EOL><INDENT>raise ValueError("<STR_LIT>" %<EOL>(minor_name,minor_dim))<EOL><DEDENT>if self.indices.min() < <NUM_LIT:0>:<EOL><INDENT>raise ValueError("<STR_LIT>" %<EOL>minor_name)<EOL><DEDENT>if np.diff(self.indptr).min() < <NUM_LIT:0>:<EOL><INDENT>raise ValueError("<STR_LIT>"<EOL>"<STR_LIT>")<EOL><DEDENT><DEDENT><DEDENT>
check whether the matrix format is valid

        Parameters
        ==========

            - full_check : {bool}
                - True  - rigorous check, O(N) operations : default
                - False - basic check, O(1) operations