def Akmaev_adjustment(theta, q, beta, n_k, theta_k, s_k, t_k):
    """Single column only."""
    L = q.size
    k = 1
    n_k[k - 1] = 1
    theta_k[k - 1] = theta[k - 1]
    l = 2
    while True:
        n = 1
        thistheta = theta[l - 1]
        while True:
            if theta_k[k - 1] <= thistheta:
                k += 1
                break
            else:
                if n <= 1:
                    s = q[l - 1]
                    t = s * thistheta
                if n_k[k - 1] <= 1:
                    s_k[k - 1] = q[l - n - 1]
                    t_k[k - 1] = s_k[k - 1] * theta_k[k - 1]
                n += n_k[k - 1]
                s += s_k[k - 1]
                t += t_k[k - 1]
                s_k[k - 1] = s
                t_k[k - 1] = t
                thistheta = t / s
                if k == 1:
                    break
                k -= 1
        if l == L:
            break
        l += 1
        n_k[k - 1] = n
        theta_k[k - 1] = thistheta
    while True:
        while True:
            if n == 1:
                break
            while True:
                theta[l - 1] = thistheta
                if n == 1:
                    break
                l -= 1
                n -= 1
        if k == 1:
            break
        k -= 1
        l -= 1
        n = n_k[k - 1]
        thistheta = theta_k[k - 1]
    return theta
