'Test that it is faster to solve a parameterized
problem after the first solve.'

def test_param_timings(self):

    N = 1000
    x = cvx.Variable(N)
    total = 0
    constraints = []
    for i in range(N):
        total += x[i]
        constraints += [(x[i] == i)]
    prob = cvx.Problem(cvx.Minimize(total), constraints)
    time0 = time.time()
    result = prob.solve()
    time1 = (time.time() - time0)
    self.assertAlmostEqual(result, ((N * (N - 1)) / 2.0), places=4)
    time0 = time.time()
    result = prob.solve()
    time2 = (time.time() - time0)
    self.assertAlmostEqual(result, ((N * (N - 1)) / 2.0), places=4)
    assert (time2 < time1)
