'Given a fixed policy F, with the interpretation :math:`u = -F x`, this
function computes the matrix :math:`P_F` and constant :math:`d_F`
associated with discounted cost :math:`J_F(x) = x\' P_F x + d_F`
Parameters
F : array_like(float, ndim=2)
The policy function, a k x n array
Returns
P_F : array_like(float, ndim=2)
Matrix for discounted cost
d_F : scalar(float)
Constant for discounted cost
K_F : array_like(float, ndim=2)
Worst case policy
O_F : array_like(float, ndim=2)
Matrix for discounted entropy
o_F : scalar(float)
Constant for discounted entropy'

def evaluate_F(self, F):

    (Q, R, A, B, C) = (self.Q, self.R, self.A, self.B, self.C)
    (beta, theta) = (self.beta, self.theta)
    (K_F, P_F) = self.F_to_K(F)
    I = np.identity(self.j)
    H = inv((I - (C.T.dot(P_F.dot(C)) / theta)))
    d_F = log(det(H))
    sig = ((-1.0) / theta)
    AO = (sqrt(beta) * ((A - dot(B, F)) + dot(C, K_F)))
    O_F = solve_discrete_lyapunov(AO.T, (beta * dot(K_F.T, K_F)))
    ho = ((trace((H - 1)) - d_F) / 2.0)
    tr = trace(dot(O_F, C.dot(H.dot(C.T))))
    o_F = ((ho + (beta * tr)) / (1 - beta))
    return (K_F, P_F, d_F, O_F, o_F)
