<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"></head><body><font class="Apple-style-span" size="5"><span class="Apple-style-span" style="font-size: 17px;">Hi,</span></font><div><font class="Apple-style-span" size="5"><span class="Apple-style-span" style="font-size: 17px;"><br></span></font></div><div><font class="Apple-style-span" size="5"><span class="Apple-style-span" style="font-size: 17px;">Thank you for your reply. But A1,A2 are not square(3x4). B1~B4 are 3x3 matrices. So A1*B1 is not impossible.</span></font></div><div><font class="Apple-style-span" size="5"><span class="Apple-style-span" style="font-size: 17px;"><br></span></font></div><div><font class="Apple-style-span" size="5"><span class="Apple-style-span" style="font-size: 17px;">Best regards,</span></font></div><div><font class="Apple-style-span" size="5"><span class="Apple-style-span" style="font-size: 17px;">Joon</span></font></div><div><font class="Apple-style-span" size="5"><span class="Apple-style-span" style="font-size: 17px;"><br></span></font></div><br><br><br>-------- Original message --------<br>Subject: Re: [petsc-users] Transpose of Block Matrix with aij type <br>From: Karl Rupp <rupp@mcs.anl.gov> <br>To: Choi240 <choi240@purdue.edu> <br>CC: petsc-users@mcs.anl.gov <br><br><br><div style="word-break:break-all;">Hi again,<br><br>if you have control over the structure of B, what about computing<br>[A1 A2] * [B1 B3; B2 B4]<br>instead?<br><br>Best regards,<br>Karli<br><br><br>On 04/23/2013 05:17 PM, Choi240 wrote:<br>> Hi,<br>><br>> I have to compute multiplication between two block matrices. It should<br>> be as follows:<br>><br>> B1 | B2 A1 B1A1+B2A2<br>> ---------- * --- = ---------------<br>> B3 | B4 A2 B3A1+B4A2<br>><br>> However, I just have A = [A1 A2]. So, I need to get A^T. Is there a way<br>> I can get the transpose of this block matrix with the MatTranspose()? Or<br>> do I have to use another function such as MatGetSubMatrices()?<br>><br>> Thank you,<br>> Joon<br>><br>><br>><br>> -------- Original message --------<br>> Subject: Re: [petsc-users] Transpose of Block Matrix with aij type<br>> From: Karl Rupp <rupp@mcs.anl.gov><br>> To: petsc-users@mcs.anl.gov<br>> CC: choi240@purdue.edu<br>><br>><br>> Hi,<br>><br>> why would you expect that the transpose of a 3x8 matrix is not a 8x3-matrix?<br>><br>> Best regards,<br>> Karli<br>><br>><br>> On 04/23/2013 03:27 PM, Joon hee Choi wrote:<br>> > Hello,<br>> ><br>> > I tried to get transpose of block matrix(just with aij type), but the<br>> result was not a block matrix. For example,<br>> ><br>> > A =<br>> > 1 2 3 4 | 4 3 2 1<br>> > 2 3 4 5 | 5 4 3 2<br>> > 3 4 5 6 | 6 5 4 3<br>> ><br>> ><br>> > AT(expected) =<br>> > 1 2 3 4<br>> > 2 3 4 5<br>> > 3 4 5 6<br>> > -------<br>> > 4 3 2 1<br>> > 5 4 3 2<br>> > 6 5 4 3<br>> ><br>> ><br>> > AT(result) =<br>> > 1 2 3<br>> > 2 3 4<br>> > 3 4 5<br>> > 4 5 6<br>> > 4 5 6<br>> > 3 4 5<br>> > 2 3 4<br>> > 1 2 3<br>> ><br>> > If someone knows about this problem, please let me know it.<br>> ><br>> > Thank you<br>> ><br>><br><br></div> </body>