def row_subtract(self, H, i):
    """
    Zeros first nonzero element of row i+1 of H by subtracting appropriate
    multiple of row i; represents matrix product by matrix 5.10. Returns
    factor g for storage.
    """
    g = H[i+1, i]/H[i,i]
    H[i+1, i:] -= g*H[i, i:]
    return g