'Helper function to avoid code duplication between self._errors_svd
and self._values_svd.'

def _errors_and_values_svd_helper(self, alpha, y, v, U, UT_y):

    constant_column = (np.var(U, 0) < 1e-12)
    w = (((v + alpha) ** (-1)) - (alpha ** (-1)))
    w[constant_column] = (- (alpha ** (-1)))
    c = (np.dot(U, self._diag_dot(w, UT_y)) + ((alpha ** (-1)) * y))
    G_diag = (self._decomp_diag(w, U) + (alpha ** (-1)))
    if (len(y.shape) != 1):
        G_diag = G_diag[:, np.newaxis]
    return (G_diag, c)
