public MatrixEntry next() { entry.update(row, cursor); // Next position is in the same row if (cursor < rowPtr[row + 1] - 1) cursor++; // Next position is at the following (non-empty) row else { row++; nextNonEmptyRow(); } return entry; }
public void remove() { entry.set(0); }