mathnet-numerics
mathnet-numerics copied to clipboard
SparseMatrix is not thread safe
Hi there,
Because SparseMatrix is not thread safe it cannot be used in any solver trying to do any modification in parallel (when the amount of columns is over 200).
As for example for var x = A.QR().Solve(y); where A is a SparseMatrix.
Cheers, Ruslan
I am observing the same issue.
My experience with sparse matrices is that you never try to QR factorize them, as this defies the very essence of sparsity of the matrix. The resultant factors (Q and R) are not guaranteed to be sparse.
I have primarily worked with sparse matrices in the compressed row storage or coordinate formats, and these cannot be easily parallelized.
The thing is though that this is usually the go to approach, see e.g. MATLAB's l_2-solver implementations (Algorithm for Sparse Inputs).
I can close the issue - not inserted in resolution any more - compare to rust performance for solving about 5K rows of linear equitation's this library looks like a toy.
I seriously tried to solve the issue even backported solver from C++ but it doesn't cut. Fit for purpose but not for me.