code: public VectorIterator nonZeroIteratorOfRow(int i) {
          final int ii = i;
          return new VectorIterator(columns) {
              private int j = -1;
  
              @Override
              public int index() {
                  return j;
              }
  
              @Override
              public double get() {
                  return SparseMatrix.this.get(ii, j);
              }
  
              @Override
              public void set(double value) {
                  SparseMatrix.this.set(ii, j, value);
              }
  
              @Override
              public boolean hasNext() {
                  while (j + 1 < columns && SparseMatrix.this.isZeroAt(ii, j + 1)) {
                      j++;
                  }
  
                  return j + 1 < columns;
              }
  
              @Override
              public Double next() {
                  if(!hasNext()) {
                      throw new NoSuchElementException();
                  }
                  j++;
                  return get();
              }
          };
      }
docs: Returns a non-zero vector iterator of the given row {@code i}.
  
  @return a non-zero vector iterator