'Testing warmstart LASSO with SCS.'

def test_warmstart(self):

    import numpy
    n = 15
    m = 10
    numpy.random.seed(1)
    A = numpy.random.randn(n, m)
    b = numpy.random.randn(n, 1)
    gamma = Parameter(sign='positive')
    x = Variable(m)
    error = sum_squares(((A * x) - b))
    obj = Minimize((error + (gamma * norm(x, 1))))
    prob = Problem(obj)
    sq_penalty = []
    l1_penalty = []
    x_values = []
    gamma_vals = numpy.logspace((-4), 6, 10)
    start = time.time()
    for val in gamma_vals:
        gamma.value = val
        prob.solve(solver=SCS, warm_start=True, use_indirect=True)
        sq_penalty.append(error.value)
        l1_penalty.append(norm(x, 1).value)
        x_values.append(x.value)
    end = time.time()
    print('time    elapsed=', (end - start))
