Asked by Jonathan
on 27 Oct 2015

I have a sparse, banded matrix, A, for which I am solving the linear system Ax=b using A\b in Matlab.

The documentation for mldivide shows a flow chart that explains which solver it will use. However, I would like to automate the process of determining the best algorithm. Therefore, I would really just like to know which algorithm mldivide chooses for different inputs. Is there a way to get this information out?

Answer by Grzegorz Knor
on 19 Apr 2017

spparms('spumoni',2)

sparse(rand(3))\rand(3,1)

On my computer it produces:

sp\: bandwidth = 2+1+2.

sp\: is A diagonal? no.

sp\: is band density (1) > bandden (0.5) to try banded solver? yes.

sp\: is LAPACK's banded solver successful? yes.

Sign in to comment.

Answer by Jan
on 27 Oct 2015

Edited by Jan
on 27 Oct 2015

I'm not sure if I understand your question. You explain:

The documentation for mldivide shows a flow chart that explains which solver it will use.

Is this not a valid answer of your question already? Or are you looking for the name of the library function instead of the name of the solver? Matlab does not offer the source code for mldivide.

Jonathan
on 27 Oct 2015

No, I want to automate the process. In other words, I give mldivide a matrix A, and it tells me which algorithm it will use.

Sorry, its not good for the job security of computer scientists, but its what I need to do...

Jan
on 30 Oct 2015

Steven Lord
on 30 Oct 2015

Even if it DID tell you, for what purpose would you use that information?

Perhaps you would be better served by the LINSOLVE function, which allows you to specify various properties of the coefficient matrix for the system you're trying to solve. This can avoid some of the testing for those matrix properties (which for large matrices could be expensive.)

Sign in to comment.

Opportunities for recent engineering grads.

Apply Today
## 0 Comments

Sign in to comment.