code: public static boolean isSameStructure(DMatrixSparseCSC a , DMatrixSparseCSC b) {
          if( a.numRows == b.numRows && a.numCols == b.numCols && a.nz_length == b.nz_length) {
              for (int i = 0; i <= a.numCols; i++) {
                  if( a.col_idx[i] != b.col_idx[i] )
                      return false;
              }
              for (int i = 0; i < a.nz_length; i++) {
                  if( a.nz_rows[i] != b.nz_rows[i] )
                      return false;
              }
              return true;
          }
          return false;
      }
docs: Checks to see if the two matrices have the same shape and same pattern of non-zero elements
  
  @param a Matrix
  @param b Matrix
  @return true if the structure is the same