Shouldn’t the following two results be identical?
/The documentation says LeastSquares works on both Array and SparseArray objects/
Could this be a bug in the function?
…or am I not using it properly?
The difference in the solution vectors could be due to differences in the methods used for dense input matrices and sparse input matrices. From ref/LeastSquares:
A Method option can also be given. Settings for arbitrary-precision numerical matrices include “Direct” and “IterativeRefinement”, and for sparse arrays “Direct” and “Krylov”. The default setting of Automatic switches between these methods, depending on the matrix given.