Solving AX=B with Preconditioned Conjugate Gradient Algorithm

  • Thread starter Thread starter callingearth
  • Start date Start date
Click For Summary
To solve the equation AX=B for a sparse matrix using the preconditioned Conjugate Gradient algorithm, one can treat X as a collection of column vectors, allowing the matrix equation to be broken down into multiple matrix-vector equations. Specifically, if X consists of nrhs column vectors, the problem can be reformulated to solve AX = B as NRHS separate instances of Ax = b. This approach simplifies the implementation on a GPU, as each instance can be processed independently. The key takeaway is that solving AX=B can be effectively managed by addressing each column of X individually through the established matrix-vector relationship. This method streamlines the computational process while leveraging the properties of sparse matrices.
callingearth
Messages
2
Reaction score
0
Hi all,
I required some help in a linear algebra problem. I've been told to build a sparse matrix solver which solves AX=B where dim(A) = n *n , dim(X) = n*nrhs and hence dim(B) = n*nrhs. This I have to implement on a GPU (I know this is offbeat but needed the math help :) I have an implementation which solved Ax=b wherein dim(A) = n*n and x is a vector i.e. dim(x) = n*1. This is solved using a preconditioned Conjugate Gradient algorithm. (If really interested could read this - http://alice.loria.fr/publications/papers/2008/CNC/Buatois_et_al_CNC.pdf ). I would like to know how I can map the AX=B problem to Ax=b problem (if possible)?

Thanks,
Vandhan Ramesh
 
Physics news on Phys.org
Hi Vandhan,

If X = [x_1 x_2 ... x_{nrhs}] where x_i's are the columns (which are nx1 vectors), and similarly B = [b_1 b_2 ... b_{nrhs}], then we can write AX = B as A[x_1 x_2 ... x_{nrhs}] = [b_1 b_2 ... b_{nrhs}], i.e., [Ax_1 Ax_2 ... Ax_{nrhs}] = [b_1 b_2 ... b_{nrhs}]. In this way the matrix*matrix=matrix equation becomes a system of matrix*vector=vector equations.
 
Thanks a lot. So now if I have a data of AX=B, i.e. B's dataset of dimension N * NRHS, all I need to do is solve NRHS times Ax=b, right?

Vandhan
 

Similar threads

  • · Replies 5 ·
Replies
5
Views
2K
  • · Replies 9 ·
Replies
9
Views
2K
  • · Replies 3 ·
Replies
3
Views
5K
  • · Replies 13 ·
Replies
13
Views
3K
  • · Replies 1 ·
Replies
1
Views
3K
Replies
5
Views
2K
Replies
3
Views
2K
  • · Replies 8 ·
Replies
8
Views
11K
  • · Replies 8 ·
Replies
8
Views
1K
  • · Replies 2 ·
Replies
2
Views
1K