On Sat, Jan 29, 2011 at 7:27 AM, Gong Ding <span dir="ltr"><<a href="mailto:gdiso@ustc.edu">gdiso@ustc.edu</a>></span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
OK, I had gather all the pattern of A+A^T by my code.<br>
Can I call MatSeqAIJSetPreallocation again for enlarge preallocated memory?<br>
And then I can add 0 to some entry to make the matrix symmetrical.<br></blockquote><div><br></div><div>Matrices cannot be resized. You want to move that symmetrization code to</div><div>the point where you originally preallocate the matrix (you do not need values</div>
<div>to do this, so this is fine). Then insert the zeros along with the regular values.</div><div><br></div><div> Matt</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
> 2011/1/26 Gong Ding <<a href="mailto:gdiso@ustc.edu">gdiso@ustc.edu</a>><br>
><br>
>> I have unsymmetrical jacobian matrix in MPIAIJ format (it is nearlly<br>
>> symmetric, I guess). I'd like to pad it to symmetrical pattern by just add 0<br>
>> to corresponding matrix entry, which is required to some matrix partition<br>
>> step.<br>
><br>
><br>
> How are you obtaining the matrix? The best way is to preallocate those<br>
> extra zeros.<br>
><br>
> A traditional purely algebraic way is to add the transpose (zeroed in this<br>
> case), but transpose is a bad operation to perform in parallel so I would<br>
> try to avoid it.<br>
></blockquote></div><br><br clear="all"><br>-- <br>What most experimenters take for granted before they begin their experiments is infinitely more interesting than any results to which their experiments lead.<br>-- Norbert Wiener<br>