<div dir="ltr">I am sorry that I should have explained it more clearly.<div>Actually I want to compute a recurrence.</div><div><br></div><div>Like, I want to firstly compute A*X1=B1, and then calculate A*B1=B2, A*B2=B3 and so on.</div><div>Finally I want to combine all these results into a bigger matrix C=[B1,B2 ...]</div><div><br></div><div>Is there any way to do this efficiently.</div><div><br></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Aug 4, 2015 at 5:45 PM, Patrick Sanan <span dir="ltr"><<a href="mailto:patrick.sanan@gmail.com" target="_blank">patrick.sanan@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On Tue, Aug 04, 2015 at 03:42:14PM +0900, Cong Li wrote:<br>
> Thanks for your reply.<br>
><br>
> I have an other question.<br>
> I want to do SPMM several times and combine result matrices into one bigger<br>
> matrix.<br>
> for example<br>
> I firstly calculate AX1=B1, AX2=B2 ...<br>
> then I want to combine B1, B2.. to get a C, where C=[B1,B2...]<br>
><br>
> Could you please suggest a way of how to do this.<br>
</span>This is just linear algebra, nothing to do with PETSc specifically.<br>
A * [X1, X2, ... ] = [AX1, AX2, ...]<br>
<div class="HOEnZb"><div class="h5">><br>
> Thanks<br>
><br>
> Cong Li<br>
><br>
> On Tue, Aug 4, 2015 at 3:27 PM, Jed Brown <<a href="mailto:jed@jedbrown.org">jed@jedbrown.org</a>> wrote:<br>
><br>
> > Cong Li <<a href="mailto:solvercorleone@gmail.com">solvercorleone@gmail.com</a>> writes:<br>
> ><br>
> > > Hello,<br>
> > ><br>
> > > I am a PhD student using PETsc for my research.<br>
> > > I am wondering if there is a way to implement SPMM (Sparse matrix-matrix<br>
> > > multiplication) by using PETSc.<br>
> ><br>
> ><br>
> > <a href="http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Mat/MatMatMult.html" rel="noreferrer" target="_blank">http://www.mcs.anl.gov/petsc/petsc-current/docs/manualpages/Mat/MatMatMult.html</a><br>
> ><br>
</div></div></blockquote></div><br></div>