Question: What's the intended function of LinearSolve with inplace=true for a non square matrix? Also, how could I solve A.x=b efficiently for a mostly zero matrix?

I've read the spec online for LinearSolve but it's not clear on the function of inplace on nonsquare matrices. For example, consider the following:


This last line outputs <2;0>, which is also the value stored in B after the operation, whereas [2] would be the desired result. In the case of A being a row vector an error is encountered due to lack of storage. Does what happened above generalise for any matrix with more rows than columns: storing the result in B, but adding zeroes to the bottom unused parts of B, due to B being larger than the solution?

Also, does anyone have any advice on an efficient method for solving A.x=b, in the case where b is a vector, and A is a large but tall (varying size, but often 5x as many rows as columns, e.g. 10000x2000) integer matrix, where most of the entries in any particular column are zero (more than 90%)? I've found the option method='modular' helps quite a lot, but not enough, any ideas for quick fixes?

Please Wait...