parameters: (self)
return_statement: return self._has_canonical_format
docstring: Determine whether the matrix has sorted indices and no duplicates
  
          Returns
              - True: if the above applies
              - False: otherwise
  
          has_canonical_format implies has_sorted_indices, so if the latter flag
          is False, so will the former be; if the former is found True, the
          latter flag is also set.
docstring_summary: Determine whether the matrix has sorted indices and no duplicates
docstring_tokens: Determine whether the matrix has sorted indices and no duplicates
function: def __get_has_canonical_format(self):
          """Determine whether the matrix has sorted indices and no duplicates
  
          Returns
              - True: if the above applies
              - False: otherwise
  
          has_canonical_format implies has_sorted_indices, so if the latter flag
          is False, so will the former be; if the former is found True, the
          latter flag is also set.
          """
  
          # first check to see if result was cached
          if not getattr(self, '_has_sorted_indices', True):
              # not sorted => not canonical
              self._has_canonical_format = False
          elif not hasattr(self, '_has_canonical_format'):
              self.has_canonical_format = _sparsetools.csr_has_canonical_format(
                  len(self.indptr) - 1, self.indptr, self.indices)
          return self._has_canonical_format
function_tokens: def __get_has_canonical_format ( self ) : # first check to see if result was cached if not getattr ( self , '_has_sorted_indices' , True ) : # not sorted => not canonical self . _has_canonical_format = False elif not hasattr ( self , '_has_canonical_format' ) : self . has_canonical_format = _sparsetools . csr_has_canonical_format ( len ( self . indptr ) - 1 , self . indptr , self . indices ) return self . _has_canonical_format