Repository: scipy/scipy

Issue:
optimize.linprog failures for test_bug_8174_2
I have seen these `linprog` failures a couple of times now. They're all the same, all `test_bug_8174_2`. Will investigate what the root cause is.

Conda-installed Python 3.7, 64-bit linux, conda gcc compilers, numpy 1.17.0-dev

```
=================================== FAILURES ===================================
__________________ TestLinprogSimplexDefault.test_bug_8174_2 ___________________

self = <scipy.optimize.tests.test_linprog.TestLinprogSimplexDefault object at 0x7ff38de1c7b8>

    def test_bug_8174_2(self):
        # Test supplementary example from issue 8174.
        # https://github.com/scipy/scipy/issues/8174
        # https://stackoverflow.com/questions/47717012/linprog-in-scipy-optimize-checking-solution
        c = np.array([1, 0, 0, 0, 0, 0, 0])
        A_ub = -np.identity(7)
        b_ub = np.array([[-2], [-2], [-2], [-2], [-2], [-2], [-2]])
        A_eq = np.array([
            [1, 1, 1, 1, 1, 1, 0],
            [0.3, 1.3, 0.9, 0, 0, 0, -1],
            [0.3, 0, 0, 0, 0, 0, -2/3],
            [0, 0.65, 0, 0, 0, 0, -1/15],
            [0, 0, 0.3, 0, 0, 0, -1/15]
        ])
        b_eq = np.array([[100], [0], [0], [0], [0]])
    
        with suppress_warnings() as sup:
            sup.filter(OptimizeWarning, "A_eq does not appear...")
            res = linprog(c, A_ub, b_ub, A_eq, b_eq, bounds,
                          method=self.method, options=self.options)
>       _assert_success(res, desired_fun=43.3333333331385)

A_eq       = array([[ 1.        ,  1.        ,  1.        ,  1.        ,  1.        ,
         1.        ,  0.        ],
       [ 0...06666667],
       [ 0.        ,  0.        ,  0.3       ,  0.        ,  0.        ,
         0.        , -0.06666667]])
A_ub       = array([[-1., -0., -0., -0., -0., -0., -0.],
       [-0., -1., -0., -0., -0., -0., -0.],
       [-0., -0., -1., -0., -0...-0., -0., -0., -1., -0., -0.],
       [-0., -0., -0., -0., -0., -1., -0.],
       [-0., -0., -0., -0., -0., -0., -1.]])
b_eq       = array([[100],
       [  0],
       [  0],
       [  0],
       [  0]])
b_ub       = array([[-2],
       [-2],
       [-2],
       [-2],
       [-2],
       [-2],
       [-2]])
c          = array([1, 0, 0, 0, 0, 0, 0])
res        =      con: array([100.,   0.,   0.,   0.,   0.])
     fun: 0.0
 message: 'There is a linear combination of rows of A_eq...k: array([-2., -2., -2., -2., -2., -2., -2.])
  status: 2
 success: False
       x: array([0., 0., 0., 0., 0., 0., 0.])
self       = <scipy.optimize.tests.test_linprog.TestLinprogSimplexDefault object at 0x7ff38de1c7b8>
sup        = <numpy.testing._private.utils.suppress_warnings object at 0x7ff38de1c940>

../scipy/scipy/optimize/tests/test_linprog.py:1172: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

res =      con: array([100.,   0.,   0.,   0.,   0.])
     fun: 0.0
 message: 'There is a linear combination of rows of A_eq...k: array([-2., -2., -2., -2., -2., -2., -2.])
  status: 2
 success: False
       x: array([0., 0., 0., 0., 0., 0., 0.])
desired_fun = 43.3333333331385, desired_x = None, rtol = 1e-08, atol = 1e-08

    def _assert_success(res, desired_fun=None, desired_x=None,
                        rtol=1e-8, atol=1e-8):
        # res: linprog result object
        # desired_fun: desired objective function value or None
        # desired_x: desired solution or None
        if not res.success:
            msg = "linprog status {0}, message: {1}".format(res.status,
                                                            res.message)
>           raise AssertionError(msg)
E           AssertionError: linprog status 2, message: There is a linear combination of rows of A_eq that results in zero, suggesting a redundant constraint. However the same linear combination of b_eq is nonzero, suggesting that the constraints conflict and the problem is infeasible.

atol       = 1e-08
desired_fun = 43.3333333331385
desired_x  = None
msg        = 'linprog status 2, message: There is a linear combination of rows of A_eq that results in zero, suggesting a redundant...he same linear combination of b_eq is nonzero, suggesting that the constraints conflict and the problem is infeasible.'
res        =      con: array([100.,   0.,   0.,   0.,   0.])
     fun: 0.0
 message: 'There is a linear combination of rows of A_eq...k: array([-2., -2., -2., -2., -2., -2., -2.])
  status: 2
 success: False
       x: array([0., 0., 0., 0., 0., 0., 0.])
rtol       = 1e-08

../scipy/scipy/optimize/tests/test_linprog.py:50: AssertionError
___________________ TestLinprogSimplexBland.test_bug_8174_2 ____________________

self = <scipy.optimize.tests.test_linprog.TestLinprogSimplexBland object at 0x7ff38dc41630>

    def test_bug_8174_2(self):
        # Test supplementary example from issue 8174.
        # https://github.com/scipy/scipy/issues/8174
        # https://stackoverflow.com/questions/47717012/linprog-in-scipy-optimize-checking-solution
        c = np.array([1, 0, 0, 0, 0, 0, 0])
        A_ub = -np.identity(7)
        b_ub = np.array([[-2], [-2], [-2], [-2], [-2], [-2], [-2]])
        A_eq = np.array([
            [1, 1, 1, 1, 1, 1, 0],
            [0.3, 1.3, 0.9, 0, 0, 0, -1],
            [0.3, 0, 0, 0, 0, 0, -2/3],
            [0, 0.65, 0, 0, 0, 0, -1/15],
            [0, 0, 0.3, 0, 0, 0, -1/15]
        ])
        b_eq = np.array([[100], [0], [0], [0], [0]])
    
        with suppress_warnings() as sup:
            sup.filter(OptimizeWarning, "A_eq does not appear...")
            res = linprog(c, A_ub, b_ub, A_eq, b_eq, bounds,
                          method=self.method, options=self.options)
>       _assert_success(res, desired_fun=43.3333333331385)

A_eq       = array([[ 1.        ,  1.        ,  1.        ,  1.        ,  1.        ,
         1.        ,  0.        ],
       [ 0...06666667],
       [ 0.        ,  0.        ,  0.3       ,  0.        ,  0.        ,
         0.        , -0.06666667]])
A_ub       = array([[-1., -0., -0., -0., -0., -0., -0.],
       [-0., -1., -0., -0., -0., -0., -0.],
       [-0., -0., -1., -0., -0...-0., -0., -0., -1., -0., -0.],
       [-0., -0., -0., -0., -0., -1., -0.],
       [-0., -0., -0., -0., -0., -0., -1.]])
b_eq       = array([[100],
       [  0],
       [  0],
       [  0],
       [  0]])
b_ub       = array([[-2],
       [-2],
       [-2],
       [-2],
       [-2],
       [-2],
       [-2]])
c          = array([1, 0, 0, 0, 0, 0, 0])
res        =      con: array([100.,   0.,   0.,   0.,   0.])
     fun: 0.0
 message: 'There is a linear combination of rows of A_eq...k: array([-2., -2., -2., -2., -2., -2., -2.])
  status: 2
 success: False
       x: array([0., 0., 0., 0., 0., 0., 0.])
self       = <scipy.optimize.tests.test_linprog.TestLinprogSimplexBland object at 0x7ff38dc41630>
sup        = <numpy.testing._private.utils.suppress_warnings object at 0x7ff38dc41898>

../scipy/scipy/optimize/tests/test_linprog.py:1172: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

res =      con: array([100.,   0.,   0.,   0.,   0.])
     fun: 0.0
 message: 'There is a linear combination of rows of A_eq...k: array([-2., -2., -2., -2., -2., -2., -2.])
  status: 2
 success: False
       x: array([0., 0., 0., 0., 0., 0., 0.])
desired_fun = 43.3333333331385, desired_x = None, rtol = 1e-08, atol = 1e-08

    def _assert_success(res, desired_fun=None, desired_x=None,
                        rtol=1e-8, atol=1e-8):
        # res: linprog result object
        # desired_fun: desired objective function value or None
        # desired_x: desired solution or None
        if not res.success:
            msg = "linprog status {0}, message: {1}".format(res.status,
                                                            res.message)
>           raise AssertionError(msg)
E           AssertionError: linprog status 2, message: There is a linear combination of rows of A_eq that results in zero, suggesting a redundant constraint. However the same linear combination of b_eq is nonzero, suggesting that the constraints conflict and the problem is infeasible.

atol       = 1e-08
desired_fun = 43.3333333331385
desired_x  = None
msg        = 'linprog status 2, message: There is a linear combination of rows of A_eq that results in zero, suggesting a redundant...he same linear combination of b_eq is nonzero, suggesting that the constraints conflict and the problem is infeasible.'
res        =      con: array([100.,   0.,   0.,   0.,   0.])
     fun: 0.0
 message: 'There is a linear combination of rows of A_eq...k: array([-2., -2., -2., -2., -2., -2., -2.])
  status: 2
 success: False
       x: array([0., 0., 0., 0., 0., 0., 0.])
rtol       = 1e-08

../scipy/scipy/optimize/tests/test_linprog.py:50: AssertionError
______________________ TestLinprogIPDense.test_bug_8174_2 ______________________

self = <scipy.optimize.tests.test_linprog.TestLinprogIPDense object at 0x7ff38dc24390>

    def test_bug_8174_2(self):
        # Test supplementary example from issue 8174.
        # https://github.com/scipy/scipy/issues/8174
        # https://stackoverflow.com/questions/47717012/linprog-in-scipy-optimize-checking-solution
        c = np.array([1, 0, 0, 0, 0, 0, 0])
        A_ub = -np.identity(7)
        b_ub = np.array([[-2], [-2], [-2], [-2], [-2], [-2], [-2]])
        A_eq = np.array([
            [1, 1, 1, 1, 1, 1, 0],
            [0.3, 1.3, 0.9, 0, 0, 0, -1],
            [0.3, 0, 0, 0, 0, 0, -2/3],
            [0, 0.65, 0, 0, 0, 0, -1/15],
            [0, 0, 0.3, 0, 0, 0, -1/15]
        ])
        b_eq = np.array([[100], [0], [0], [0], [0]])
    
        with suppress_warnings() as sup:
            sup.filter(OptimizeWarning, "A_eq does not appear...")
            res = linprog(c, A_ub, b_ub, A_eq, b_eq, bounds,
                          method=self.method, options=self.options)
>       _assert_success(res, desired_fun=43.3333333331385)

A_eq       = array([[ 1.        ,  1.        ,  1.        ,  1.        ,  1.        ,
         1.        ,  0.        ],
       [ 0...06666667],
       [ 0.        ,  0.        ,  0.3       ,  0.        ,  0.        ,
         0.        , -0.06666667]])
A_ub       = array([[-1., -0., -0., -0., -0., -0., -0.],
       [-0., -1., -0., -0., -0., -0., -0.],
       [-0., -0., -1., -0., -0...-0., -0., -0., -1., -0., -0.],
       [-0., -0., -0., -0., -0., -1., -0.],
       [-0., -0., -0., -0., -0., -0., -1.]])
b_eq       = array([[100],
       [  0],
       [  0],
       [  0],
       [  0]])
b_ub       = array([[-2],
       [-2],
       [-2],
       [-2],
       [-2],
       [-2],
       [-2]])
c          = array([1, 0, 0, 0, 0, 0, 0])
res        =      con: array([100.,   0.,   0.,   0.,   0.])
     fun: 0.0
 message: 'There is a linear combination of rows of A_eq...k: array([-2., -2., -2., -2., -2., -2., -2.])
  status: 2
 success: False
       x: array([0., 0., 0., 0., 0., 0., 0.])
self       = <scipy.optimize.tests.test_linprog.TestLinprogIPDense object at 0x7ff38dc24390>
sup        = <numpy.testing._private.utils.suppress_warnings object at 0x7ff38dc24710>

../scipy/scipy/optimize/tests/test_linprog.py:1172: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

res =      con: array([100.,   0.,   0.,   0.,   0.])
     fun: 0.0
 message: 'There is a linear combination of rows of A_eq...k: array([-2., -2., -2., -2., -2., -2., -2.])
  status: 2
 success: False
       x: array([0., 0., 0., 0., 0., 0., 0.])
desired_fun = 43.3333333331385, desired_x = None, rtol = 1e-08, atol = 1e-08

    def _assert_success(res, desired_fun=None, desired_x=None,
                        rtol=1e-8, atol=1e-8):
        # res: linprog result object
        # desired_fun: desired objective function value or None
        # desired_x: desired solution or None
        if not res.success:
            msg = "linprog status {0}, message: {1}".format(res.status,
                                                            res.message)
>           raise AssertionError(msg)
E           AssertionError: linprog status 2, message: There is a linear combination of rows of A_eq that results in zero, suggesting a redundant constraint. However the same linear combination of b_eq is nonzero, suggesting that the constraints conflict and the problem is infeasible.

atol       = 1e-08
desired_fun = 43.3333333331385
desired_x  = None
msg        = 'linprog status 2, message: There is a linear combination of rows of A_eq that results in zero, suggesting a redundant...he same linear combination of b_eq is nonzero, suggesting that the constraints conflict and the problem is infeasible.'
res        =      con: array([100.,   0.,   0.,   0.,   0.])
     fun: 0.0
 message: 'There is a linear combination of rows of A_eq...k: array([-2., -2., -2., -2., -2., -2., -2.])
  status: 2
 success: False
       x: array([0., 0., 0., 0., 0., 0., 0.])
rtol       = 1e-08

../scipy/scipy/optimize/tests/test_linprog.py:50: AssertionError
_____________________ TestLinprogIPSparse.test_bug_8174_2 ______________________

self = <scipy.optimize.tests.test_linprog.TestLinprogIPSparse object at 0x7ff38dddc5c0>

    def test_bug_8174_2(self):
        # Test supplementary example from issue 8174.
        # https://github.com/scipy/scipy/issues/8174
        # https://stackoverflow.com/questions/47717012/linprog-in-scipy-optimize-checking-solution
        c = np.array([1, 0, 0, 0, 0, 0, 0])
        A_ub = -np.identity(7)
        b_ub = np.array([[-2], [-2], [-2], [-2], [-2], [-2], [-2]])
        A_eq = np.array([
            [1, 1, 1, 1, 1, 1, 0],
            [0.3, 1.3, 0.9, 0, 0, 0, -1],
            [0.3, 0, 0, 0, 0, 0, -2/3],
            [0, 0.65, 0, 0, 0, 0, -1/15],
            [0, 0, 0.3, 0, 0, 0, -1/15]
        ])
        b_eq = np.array([[100], [0], [0], [0], [0]])
    
        with suppress_warnings() as sup:
            sup.filter(OptimizeWarning, "A_eq does not appear...")
            res = linprog(c, A_ub, b_ub, A_eq, b_eq, bounds,
                          method=self.method, options=self.options)
>       _assert_success(res, desired_fun=43.3333333331385)

A_eq       = array([[ 1.        ,  1.        ,  1.        ,  1.        ,  1.        ,
         1.        ,  0.        ],
       [ 0...06666667],
       [ 0.        ,  0.        ,  0.3       ,  0.        ,  0.        ,
         0.        , -0.06666667]])
A_ub       = array([[-1., -0., -0., -0., -0., -0., -0.],
       [-0., -1., -0., -0., -0., -0., -0.],
       [-0., -0., -1., -0., -0...-0., -0., -0., -1., -0., -0.],
       [-0., -0., -0., -0., -0., -1., -0.],
       [-0., -0., -0., -0., -0., -0., -1.]])
b_eq       = array([[100],
       [  0],
       [  0],
       [  0],
       [  0]])
b_ub       = array([[-2],
       [-2],
       [-2],
       [-2],
       [-2],
       [-2],
       [-2]])
c          = array([1, 0, 0, 0, 0, 0, 0])
res        =      con: array([100.,   0.,   0.,   0.,   0.])
     fun: 0.0
 message: 'There is a linear combination of rows of A_eq...k: array([-2., -2., -2., -2., -2., -2., -2.])
  status: 2
 success: False
       x: array([0., 0., 0., 0., 0., 0., 0.])
self       = <scipy.optimize.tests.test_linprog.TestLinprogIPSparse object at 0x7ff38dddc5c0>
sup        = <numpy.testing._private.utils.suppress_warnings object at 0x7ff38dddc828>

../scipy/scipy/optimize/tests/test_linprog.py:1172: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

res =      con: array([100.,   0.,   0.,   0.,   0.])
     fun: 0.0
 message: 'There is a linear combination of rows of A_eq...k: array([-2., -2., -2., -2., -2., -2., -2.])
  status: 2
 success: False
       x: array([0., 0., 0., 0., 0., 0., 0.])
desired_fun = 43.3333333331385, desired_x = None, rtol = 1e-08, atol = 1e-08

    def _assert_success(res, desired_fun=None, desired_x=None,
                        rtol=1e-8, atol=1e-8):
        # res: linprog result object
        # desired_fun: desired objective function value or None
        # desired_x: desired solution or None
        if not res.success:
            msg = "linprog status {0}, message: {1}".format(res.status,
                                                            res.message)
>           raise AssertionError(msg)
E           AssertionError: linprog status 2, message: There is a linear combination of rows of A_eq that results in zero, suggesting a redundant constraint. However the same linear combination of b_eq is nonzero, suggesting that the constraints conflict and the problem is infeasible.

atol       = 1e-08
desired_fun = 43.3333333331385
desired_x  = None
msg        = 'linprog status 2, message: There is a linear combination of rows of A_eq that results in zero, suggesting a redundant...he same linear combination of b_eq is nonzero, suggesting that the constraints conflict and the problem is infeasible.'
res        =      con: array([100.,   0.,   0.,   0.,   0.])
     fun: 0.0
 message: 'There is a linear combination of rows of A_eq...k: array([-2., -2., -2., -2., -2., -2., -2.])
  status: 2
 success: False
       x: array([0., 0., 0., 0., 0., 0., 0.])
rtol       = 1e-08

../scipy/scipy/optimize/tests/test_linprog.py:50: AssertionError
_____________________ TestLinprogRSCommon.test_bug_8174_2 ______________________

self = <scipy.optimize.tests.test_linprog.TestLinprogRSCommon object at 0x7ff38db99400>

    def test_bug_8174_2(self):
        # Test supplementary example from issue 8174.
        # https://github.com/scipy/scipy/issues/8174
        # https://stackoverflow.com/questions/47717012/linprog-in-scipy-optimize-checking-solution
        c = np.array([1, 0, 0, 0, 0, 0, 0])
        A_ub = -np.identity(7)
        b_ub = np.array([[-2], [-2], [-2], [-2], [-2], [-2], [-2]])
        A_eq = np.array([
            [1, 1, 1, 1, 1, 1, 0],
            [0.3, 1.3, 0.9, 0, 0, 0, -1],
            [0.3, 0, 0, 0, 0, 0, -2/3],
            [0, 0.65, 0, 0, 0, 0, -1/15],
            [0, 0, 0.3, 0, 0, 0, -1/15]
        ])
        b_eq = np.array([[100], [0], [0], [0], [0]])
    
        with suppress_warnings() as sup:
            sup.filter(OptimizeWarning, "A_eq does not appear...")
            res = linprog(c, A_ub, b_ub, A_eq, b_eq, bounds,
                          method=self.method, options=self.options)
>       _assert_success(res, desired_fun=43.3333333331385)

A_eq       = array([[ 1.        ,  1.        ,  1.        ,  1.        ,  1.        ,
         1.        ,  0.        ],
       [ 0...06666667],
       [ 0.        ,  0.        ,  0.3       ,  0.        ,  0.        ,
         0.        , -0.06666667]])
A_ub       = array([[-1., -0., -0., -0., -0., -0., -0.],
       [-0., -1., -0., -0., -0., -0., -0.],
       [-0., -0., -1., -0., -0...-0., -0., -0., -1., -0., -0.],
       [-0., -0., -0., -0., -0., -1., -0.],
       [-0., -0., -0., -0., -0., -0., -1.]])
b_eq       = array([[100],
       [  0],
       [  0],
       [  0],
       [  0]])
b_ub       = array([[-2],
       [-2],
       [-2],
       [-2],
       [-2],
       [-2],
       [-2]])
c          = array([1, 0, 0, 0, 0, 0, 0])
res        =      con: array([100.,   0.,   0.,   0.,   0.])
     fun: 0.0
 message: 'There is a linear combination of rows of A_eq...k: array([-2., -2., -2., -2., -2., -2., -2.])
  status: 2
 success: False
       x: array([0., 0., 0., 0., 0., 0., 0.])
self       = <scipy.optimize.tests.test_linprog.TestLinprogRSCommon object at 0x7ff38db99400>
sup        = <numpy.testing._private.utils.suppress_warnings object at 0x7ff38dbdd080>

../scipy/scipy/optimize/tests/test_linprog.py:1172: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

res =      con: array([100.,   0.,   0.,   0.,   0.])
     fun: 0.0
 message: 'There is a linear combination of rows of A_eq...k: array([-2., -2., -2., -2., -2., -2., -2.])
  status: 2
 success: False
       x: array([0., 0., 0., 0., 0., 0., 0.])
desired_fun = 43.3333333331385, desired_x = None, rtol = 1e-08, atol = 1e-08

    def _assert_success(res, desired_fun=None, desired_x=None,
                        rtol=1e-8, atol=1e-8):
        # res: linprog result object
        # desired_fun: desired objective function value or None
        # desired_x: desired solution or None
        if not res.success:
            msg = "linprog status {0}, message: {1}".format(res.status,
                                                            res.message)
>           raise AssertionError(msg)
E           AssertionError: linprog status 2, message: There is a linear combination of rows of A_eq that results in zero, suggesting a redundant constraint. However the same linear combination of b_eq is nonzero, suggesting that the constraints conflict and the problem is infeasible.

atol       = 1e-08
desired_fun = 43.3333333331385
desired_x  = None
msg        = 'linprog status 2, message: There is a linear combination of rows of A_eq that results in zero, suggesting a redundant...he same linear combination of b_eq is nonzero, suggesting that the constraints conflict and the problem is infeasible.'
res        =      con: array([100.,   0.,   0.,   0.,   0.])
     fun: 0.0
 message: 'There is a linear combination of rows of A_eq...k: array([-2., -2., -2., -2., -2., -2., -2.])
  status: 2
 success: False
       x: array([0., 0., 0., 0., 0., 0., 0.])
rtol       = 1e-08

../scipy/scipy/optimize/tests/test_linprog.py:50: AssertionError
______________________ TestLinprogRSBland.test_bug_8174_2 ______________________

self = <scipy.optimize.tests.test_linprog.TestLinprogRSBland object at 0x7ff38db3e320>

    def test_bug_8174_2(self):
        # Test supplementary example from issue 8174.
        # https://github.com/scipy/scipy/issues/8174
        # https://stackoverflow.com/questions/47717012/linprog-in-scipy-optimize-checking-solution
        c = np.array([1, 0, 0, 0, 0, 0, 0])
        A_ub = -np.identity(7)
        b_ub = np.array([[-2], [-2], [-2], [-2], [-2], [-2], [-2]])
        A_eq = np.array([
            [1, 1, 1, 1, 1, 1, 0],
            [0.3, 1.3, 0.9, 0, 0, 0, -1],
            [0.3, 0, 0, 0, 0, 0, -2/3],
            [0, 0.65, 0, 0, 0, 0, -1/15],
            [0, 0, 0.3, 0, 0, 0, -1/15]
        ])
        b_eq = np.array([[100], [0], [0], [0], [0]])
    
        with suppress_warnings() as sup:
            sup.filter(OptimizeWarning, "A_eq does not appear...")
            res = linprog(c, A_ub, b_ub, A_eq, b_eq, bounds,
                          method=self.method, options=self.options)
>       _assert_success(res, desired_fun=43.3333333331385)

A_eq       = array([[ 1.        ,  1.        ,  1.        ,  1.        ,  1.        ,
         1.        ,  0.        ],
       [ 0...06666667],
       [ 0.        ,  0.        ,  0.3       ,  0.        ,  0.        ,
         0.        , -0.06666667]])
A_ub       = array([[-1., -0., -0., -0., -0., -0., -0.],
       [-0., -1., -0., -0., -0., -0., -0.],
       [-0., -0., -1., -0., -0...-0., -0., -0., -1., -0., -0.],
       [-0., -0., -0., -0., -0., -1., -0.],
       [-0., -0., -0., -0., -0., -0., -1.]])
b_eq       = array([[100],
       [  0],
       [  0],
       [  0],
       [  0]])
b_ub       = array([[-2],
       [-2],
       [-2],
       [-2],
       [-2],
       [-2],
       [-2]])
c          = array([1, 0, 0, 0, 0, 0, 0])
res        =      con: array([100.,   0.,   0.,   0.,   0.])
     fun: 0.0
 message: 'There is a linear combination of rows of A_eq...k: array([-2., -2., -2., -2., -2., -2., -2.])
  status: 2
 success: False
       x: array([0., 0., 0., 0., 0., 0., 0.])
self       = <scipy.optimize.tests.test_linprog.TestLinprogRSBland object at 0x7ff38db3e320>
sup        = <numpy.testing._private.utils.suppress_warnings object at 0x7ff38db3ef60>

../scipy/scipy/optimize/tests/test_linprog.py:1172: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

res =      con: array([100.,   0.,   0.,   0.,   0.])
     fun: 0.0
 message: 'There is a linear combination of rows of A_eq...k: array([-2., -2., -2., -2., -2., -2., -2.])
  status: 2
 success: False
       x: array([0., 0., 0., 0., 0., 0., 0.])
desired_fun = 43.3333333331385, desired_x = None, rtol = 1e-08, atol = 1e-08

    def _assert_success(res, desired_fun=None, desired_x=None,
                        rtol=1e-8, atol=1e-8):
        # res: linprog result object
        # desired_fun: desired objective function value or None
        # desired_x: desired solution or None
        if not res.success:
            msg = "linprog status {0}, message: {1}".format(res.status,
                                                            res.message)
>           raise AssertionError(msg)
E           AssertionError: linprog status 2, message: There is a linear combination of rows of A_eq that results in zero, suggesting a redundant constraint. However the same linear combination of b_eq is nonzero, suggesting that the constraints conflict and the problem is infeasible.

atol       = 1e-08
desired_fun = 43.3333333331385
desired_x  = None
msg        = 'linprog status 2, message: There is a linear combination of rows of A_eq that results in zero, suggesting a redundant...he same linear combination of b_eq is nonzero, suggesting that the constraints conflict and the problem is infeasible.'
res        =      con: array([100.,   0.,   0.,   0.,   0.])
     fun: 0.0
 message: 'There is a linear combination of rows of A_eq...k: array([-2., -2., -2., -2., -2., -2., -2.])
  status: 2
 success: False
       x: array([0., 0., 0., 0., 0., 0., 0.])
rtol       = 1e-08

../scipy/scipy/optimize/tests/test_linprog.py:50: AssertionError
= 6 failed, 15540 passed, 1263 skipped, 124 xfailed, 8 xpassed in 690.12 seconds =

   Normal return from subroutine COBYLA

   NFVALS =   50   F = 2.485185E+01    MAXCV = 1.999965E-10
   X = 4.955358E+00   6.666553E-01

 NNLS quitting on iteration count.
```


Discussion:
I think it's a tolerance issue.
Is this intermittent, though?
Is this your own machine or CI?
Can I send you some code to run to help investigate?
Thanks @mdhaber. It's reproducible, but will depend on hardware and Python versions (this is 64-bit linux, python 3.7 from Anaconda, MKL, using gcc compilers). It doesn't show up in CI, just this machine.

Yes, some code to help investigate would be great.


@rgommers Two options:
1. Checkout my [`linprog_8174_2_debug`](https://github.com/mdhaber/scipy/tree/linprog_8174_2_debug) branch and run `8174_2_issue.py` in main scipy directory. Send back `data_8174_2.mat` or copy/paste contents of `alldata` (loaded from the `.mat` by `8174_2_issue.py`) here.

OR

2. Probably just as fast: insert at line 435 of `optimize/_remove_redundancy.py`:
```
print(np.abs(v.dot(b)))
print(tol)
```
then run 
```
import numpy as np
from scipy.optimize import linprog
import scipy.io

c = np.array([1, 0, 0, 0, 0, 0, 0])
A_ub = -np.identity(7)
b_ub = np.array([[-2], [-2], [-2], [-2], [-2], [-2], [-2]])
A_eq = np.array([
    [1, 1, 1, 1, 1, 1, 0],
    [0.3, 1.3, 0.9, 0, 0, 0, -1],
    [0.3, 0, 0, 0, 0, 0, -2/3],
    [0, 0.65, 0, 0, 0, 0, -1/15],
    [0, 0, 0.3, 0, 0, 0, -1/15]
])
b_eq = np.array([[100], [0], [0], [0], [0]])
bounds = None
res = linprog(c, A_ub, b_ub, A_eq, b_eq, bounds)
```
In the redundancy removal routine, `v` is in the nullspace of `A_eq.T`; it specifies a linear combination of rows of `A_eq` that results in a zero row.  So `v.dot(b)` needs to be zero, too, or there are inconsistent equality constraints. On my machine, `v.dot(b)` is quite close to `tol`, and the magnitudes are tiny, so I am not so surprised we're getting an issue. Easy fix is to bump up `tol` by, say, a factor of 10, since it is somewhat arbitrary.
I went with (1), here is the file: [data_8174_2.mat](https://drive.google.com/file/d/1UuUqbgNI5-lixDkoMS4fqJd4d1-tR_qu/view?usp=sharing) (1kb)

tolerance issue confirmed
Your `vdotb` is 5.98447787e-15 compared to `tol` of 4.34180158e-15.
My `vdotb` is 3.98965192e-15. Same `tol`.
I think I'll just bump up the tol by a factor of 10.

Resolving patch:
diff --git a/scipy/optimize/_remove_redundancy.py b/scipy/optimize/_remove_redundancy.py
--- a/scipy/optimize/_remove_redundancy.py
+++ b/scipy/optimize/_remove_redundancy.py
@@ -432,7 +432,7 @@ def _remove_redundancy(A, b):
                        "off redundancy removal, or try turning off presolve "
                        "altogether.")
             break
-        if np.any(np.abs(v.dot(b)) > tol):
+        if np.any(np.abs(v.dot(b)) > tol * 10):  # factor of 10 to fix 10038
             status = 2
             message = ("There is a linear combination of rows of A_eq that "
                        "results in zero, suggesting a redundant constraint. "


Test patch: