<div dir="ltr"><br><br><div class="gmail_quote">---------- Forwarded message ----------<br>From: <b class="gmail_sendername">Cong Li</b> <span dir="ltr"><<a href="mailto:solvercorleone@gmail.com">solvercorleone@gmail.com</a>></span><br>
Date: Mon, Aug 19, 2013 at 12:19 AM<br>Subject: Re: [petsc-users] How can get the inverse matrix of P(transpose)AP<br>To: Jed Brown <<a href="mailto:jedbrown@mcs.anl.gov">jedbrown@mcs.anl.gov</a>><br><br><br><div dir="ltr">
<div>Thanks for the reply.</div><div> </div><div>The question I am asking here is closely related to the question I asked in "<span>How can I convert parall matrix to MATSEQDENSE</span>"</div>
<div> </div><div><div>Actuall I am trying to implement block cg (conjugate gradient) method for my research.</div><div>It is like this AX=B, X and B are mxk matrices, A is mxm large sparse marix.</div>
<div> </div><div>Given initial guess X0, R0=B-AX</div><div>P=R0</div><div>for i=1,2,...do</div><div> gamma(i)=inv(Pi(transpose)APi)Pi(transpose)Ri</div><div> X(i+1) = Xi +P(i) gamma(i)</div><div>.....</div><div>.....psi(i) = - inv(Pi(transpose)APi)PiA(transpose)R(i+1)</div>
<div>.....</div><div> </div><div>So I need to get the invese of Pi(transpose)APi.</div><span class="HOEnZb"><font color="#888888"><div> </div><div>Cong</div></font></span></div></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra">
<br><br><div class="gmail_quote">On Sun, Aug 18, 2013 at 10:15 PM, Jed Brown <span dir="ltr"><<a href="mailto:jedbrown@mcs.anl.gov" target="_blank">jedbrown@mcs.anl.gov</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;padding-left:1ex;border-left-color:rgb(204,204,204);border-left-width:1px;border-left-style:solid"><div>Cong Li <<a href="mailto:solvercorleone@gmail.com" target="_blank">solvercorleone@gmail.com</a>> writes:<br>
<br>
> Hi<br>
><br>
> I met a problem when trying to get a inverse matrix.<br>
><br>
> The problem is like this:<br>
> I have a matrix P (m x k matrix, and k<<m) and a matrix A (m x m matrix,<br>
> large SPD matrix). Now I want to get the inverse matrix of<br>
> P(transpose)*A*p.<br>
<br>
</div>Can you back up and explain at a high level what you're trying to accomplish?<br>
<div><div><br>
> Since P(transpose)*A*p is only a k x k matrix, and PETSc only supports<br>
> sequential direct solver, I want to store P(transpose)*A*p in MATSEQDENSE<br>
> type.<br>
> And the questions are<br>
> 1. given P and A are PETSc parallel matrix, for instance MATMPIAIJ, how can<br>
> I get sequential dense matrix P(transpose)*A*p?<br>
> 2. If I need to multiply P(transpose)*A*p with other parallel dense matrix,<br>
> how I can do it?<br>
><br>
> Thanks a lot.<br>
><br>
> Cong<br>
</div></div></blockquote></div><br></div>
</div></div></div><br></div>