code: public static boolean checkDuplicateElements(DMatrixSparseCSC A ) {
          A = A.copy(); // create a copy so that it doesn't modify A
          A.sortIndices(null);
          return !checkSortedFlag(A);
      }
docs: Checks for duplicate elements. A is sorted
  @param A Matrix to be tested.
  @return true if duplicates or false if false duplicates