'Test portfolio problem that caused dcp_attr errors.'

def test_portfolio_problem(self):

    import numpy as np
    import scipy.sparse as sp
    np.random.seed(5)
    n = 100
    m = 10
    pbar = ((np.ones((n, 1)) * 0.03) + (np.matrix(np.append(np.random.rand((n - 1), 1), 0)).T * 0.12))
    F = sp.rand(m, n, density=0.01)
    F.data = np.ones(len(F.data))
    D = sp.eye(n).tocoo()
    D.data = (np.random.randn(len(D.data)) ** 2)
    Z = np.random.randn(m, 1)
    Z = Z.dot(Z.T)
    x = Variable(n)
    y = x.__rmul__(F)
    mu = 1
    ret = (pbar.T * x)
    risk = (square(norm(x.__rmul__(D))) + square((Z * y)))
