'In-place operation on row ``i`` using two-arg functor whose args are
interpreted as ``(self[i, j], j)``.
Examples
>>> from sympy.matrices import SparseMatrix
>>> M = SparseMatrix.eye(3)*2
>>> M[0, 1] = -1
>>> M.row_op(1, lambda v, j: v + 2*M[0, j]); M
Matrix([
[2, -1, 0],
[4,  0, 0],
[0,  0, 2]])
See Also
row
zip_row_op
col_op'

def row_op(self, i, f):

    for j in range(self.cols):
        v = self._smat.get((i, j), S.Zero)
        fv = f(v, j)
        if fv:
            self._smat[(i, j)] = fv
        elif v:
            self._smat.pop((i, j))
