def div_by_row(self, vec, target=None):
    """
    Divide vector vec into every row of the matrix. If a target is
    provided, it is used to store the result instead of self.
    """

    if not target:
      target = self

    err_code = _eigenmat.div_by_row_vec(self.p_mat, vec.p_mat, target.p_mat)
    if err_code:
      raise generate_exception(err_code)

    return target

    Divide vector vec into every row of the matrix. If a target is
    provided, it is used to store the result instead of self.
    
eigenmat/eigenmat.py