Performance issue: scipy.linalg.solve_toeplitz is slow for T,x,b being matrices #8619
Labels
defect
A clear bug or issue that prevents SciPy from being installed or used as expected
scipy.linalg
I am trying to efficiently solve the following linear system in Python 3.6:
b = T x
where T is an N x N Toeplitz matrix and x, b are N x N matrices. It is much slower than both scipy.linalg.solve and numpy.linalg.solve (see the output from my test script for N=500).
A possible explanation is that scipy.linalg.solve_toeplitz uses a for-loop for matrix inputs to solve the individual linear systems with x, b being vectors (solving each column at a time). Unfortunately, i was unable to make the benchmark work from the original pull request adding this function.
Reproducing code example:
Test output:
Method: numpy.linalg.solve(T, b) - error: 5.996096106604476e-11
Method: scipy.linalg.solve(T, b) - error: 5.5520852583734864e-11
Method: scipy.linalg.solve_toeplitz((c, r), b) - error: 2.761917504645538e-08
Timings:
[0.008001089096069336, 0.44705653190612793, 0.2655336856842041]
Scipy/Numpy/Python version information:
The text was updated successfully, but these errors were encountered: