-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
Closed
Labels
defectA clear bug or issue that prevents SciPy from being installed or used as expectedA clear bug or issue that prevents SciPy from being installed or used as expectedscipy.optimizescipy.sparse
Milestone
Description
Describe your issue.
Hi,
I have a bug when using the highs linprog solver with the code below.
The script is killed by the OOM killer. The problem arises when calling csc_matrix, which itself builds a coo_matrix, which calls the nonzeros method which is supposed to return the indices of non zero (far too many in this dense case).
Is it necessary to call csc_matrix here? It seems very inefficient for dense matrices.
If such a transformation is necessary, it would be better that the code returns a python error to handle the problem correctly.
Reproducing Code Example
from scipy.optimize import linprog
import numpy as np
np.random.seed(0)
n_ctr = 500000
n_var = 500
c_ = np.ones(n_var)
A_ub = np.random.random((n_ctr, n_var))
b_ub = np.zeros((n_ctr, ))
res = linprog(c_, A_ub=A_ub, b_ub=b_ub, method='highs-ds', bounds=(0, None), options={'disp': True})
print('End')
Error message
150075 killed python highs.py
SciPy/NumPy/Python version information
scipy==1.7.3, numpy==1.22.2, python==3.8.10
Metadata
Metadata
Assignees
Labels
defectA clear bug or issue that prevents SciPy from being installed or used as expectedA clear bug or issue that prevents SciPy from being installed or used as expectedscipy.optimizescipy.sparse