def __compute_means__(v, M, C, i1, i2):
    """
    Computes the conditional means.

    :param v: The values conditioned on.
    :param M: Marginal means (vector).
    :param C: Covariance matrix.
    :param i1: Indices of unconditioned variables.
    :param i2: Indices of conditioned variables.
    :return: Conditional means.
    """
    return M[i1] + C.C12.dot(C.C22I).dot(v - M[i2])
