'Make sure that warm starting Gurobi behaves as expected
Note: This only checks output, not whether or not Gurobi is warm starting internally'

def test_gurobi_warm_start(self):

    if (GUROBI in installed_solvers()):
        import numpy as np
        A = Parameter(2, 2)
        b = Parameter(2)
        h = Parameter(2)
        c = Parameter(2)
        A.value = np.matrix([[1, 0], [0, 0]])
        b.value = np.array([1, 0])
        h.value = np.array([2, 2])
        c.value = np.array([1, 1])
        objective = Maximize(((c[0] * self.x[0]) + (c[1] * self.x[1])))
        constraints = [(self.x[0] <= h[0]), (self.x[1] <= h[1]), ((A * self.x) == b)]
        prob = Problem(objective, constraints)
        result = prob.solve(solver=GUROBI, warm_start=True)
        self.assertEqual(result, 3)
        self.assertItemsAlmostEqual(self.x.value, [1, 2])
        orig_objective = result
        orig_x = self.x.value
        A.value = np.matrix([[0, 0], [0, 1]])
        b.value = np.array([0, 1])
        h.value = np.array([2, 2])
        c.value = np.array([1, 1])
        result = prob.solve(solver=GUROBI, warm_start=True)
        self.assertEqual(result, 3)
        self.assertItemsAlmostEqual(self.x.value, [2, 1])
        A.value = np.matrix([[1, 0], [0, 0]])
        b.value = np.array([1, 0])
        h.value = np.array([1, 1])
        c.value = np.array([1, 1])
        result = prob.solve(solver=GUROBI, warm_start=True)
        self.assertEqual(result, 2)
        self.assertItemsAlmostEqual(self.x.value, [1, 1])
        A.value = np.matrix([[1, 0], [0, 0]])
        b.value = np.array([1, 0])
        h.value = np.array([2, 2])
        c.value = np.array([2, 1])
        result = prob.solve(solver=GUROBI, warm_start=True)
        self.assertEqual(result, 4)
        self.assertItemsAlmostEqual(self.x.value, [1, 2])
    else:
        with self.assertRaises(Exception) as cm:
            prob = Problem(Minimize(norm(self.x, 1)), [(self.x == 0)])
            prob.solve(solver=GUROBI, warm_start=True)
        self.assertEqual(str(cm.exception), ('The    solver    %s    is    not    installed.' % GUROBI))
