- }
-
- if(search < smallCol){
- rowCells[i]->row = smallCol;
- rowCells[i]->column = search;
- }
- else{
- rowCells[i]->row = search;
- rowCells[i]->column = smallCol;
- }
-
- }
+ if (!deleted[i]) {
+ // Assign the cell to the new cluster
+ // remove the old cell from seqVec and add the cell
+ // with the new row and column assignment again
+ removeCell(rowCells[i], i , -1, false);
+ if (search < smallCol){
+ rowCells[i]->row = smallCol;
+ rowCells[i]->column = search;
+ } else {
+ rowCells[i]->row = search;
+ rowCells[i]->column = smallCol;
+ }
+ seqVec[rowCells[i]->row].push_back(rowCells[i]);
+ seqVec[rowCells[i]->column].push_back(rowCells[i]);
+ }
+ }
+ }