def sum_duplicates(self):
if self.has_canonical_format or len(self.data) == <NUM_LIT:0>:<EOL><INDENT>return<EOL><DEDENT>order = np.lexsort((self.row,self.col))<EOL>self.row = self.row[order]<EOL>self.col = self.col[order]<EOL>self.data = self.data[order]<EOL>unique_mask = ((self.row[<NUM_LIT:1>:] != self.row[:-<NUM_LIT:1>]) |<EOL>(self.col[<NUM_LIT:1>:] != self.col[:-<NUM_LIT:1>]))<EOL>unique_mask = np.append(True, unique_mask)<EOL>self.row = self.row[unique_mask]<EOL>self.col = self.col[unique_mask]<EOL>unique_inds, = np.nonzero(unique_mask)<EOL>self.data = np.add.reduceat(self.data, unique_inds, dtype=self.dtype)<EOL>self.has_canonical_format = True<EOL>
Eliminate duplicate matrix entries by adding them together

        This is an *in place* operation