Hi all,

I want to solve this system of linear equations Ax=B where B is a matrix itself. A is sparse positive definite matrix with very high dimensions. I am using conjugate gradient to solve it. However, pcg function in matlab accepts only a column vector in place of B. How can I do it for a matrix. Is there any available softwares to do the job?

asked Jan 24 '14 at 23:16

Jason%20Tyler's gravatar image

Jason Tyler
16131315


One Answer:

When you say A X = B and B is a matrix you're really solving i systems of equations like A x_i = b_i, where x_i and b_i are the i-th columns of X and B. So just give all these systems independently to your solver and it should work.

answered Jan 25 '14 at 11:57

Alexandre%20Passos's gravatar image

Alexandre Passos ♦
2554154278421

@Alexandre. Yes it will work, but that will be slow. I am solving system of linear equations independently. Is there a better way to do it?

(Jan 25 '14 at 22:51) Jason Tyler

Most modern linear system solving methods work by factorizing A in a lower-diagonal form (which expensive-ish) and then backsolving from b to find x. Most systems (matlab included) also let you efficiently solve many linear systems at once by caching the factorization of A. I'm not sure what is the syntax for that though.

(Jan 26 '14 at 16:04) Alexandre Passos ♦
Your answer
toggle preview

powered by OSQA

User submitted content is under Creative Commons: Attribution - Share Alike; Other things copyright (C) 2010, MetaOptimize LLC.