<div dir="ltr">Thanks a lot!<br>I have changed the code but I still have strange behaviour.<br>I scaled the identity matrix and enlarged the BB matrix :<br><br>==================================================================================<br>
A before MatMatSolve<br>row 0: (0, 1e-06)<br>row 1: (1, 1e-06)<br> BB before MatMatSolve<br>0.0000000000000000e+00 0.0000000000000000e+00 1.0000000000000000e+03 0.0000000000000000e+00<br>0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 1.0000000000000000e+03<br>
XX before MatMatSolve<br>0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00<br>0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00<br> XX after MatMatSolve<br>
0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00<br>0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00<br>==================================================================================<br>
<br>Nicolas<br><br><br><div class="gmail_quote">2008/9/10 Barry Smith <span dir="ltr"><<a href="mailto:bsmith@mcs.anl.gov">bsmith@mcs.anl.gov</a>></span><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>
For the MatMatSolve_SeqAIJ() to work both B and X must be dense matrices,<br>
since you passed in a sparse SeqAIJ matrix (the default) for B you get garbage out.<br>
I will add an error check telling you the B matrix is not dense so no one will fall for this<br>
again.<br>
<br>
Barry<div><div></div><div class="Wj3C7c"><br>
<br>
<br>
On Sep 10, 2008, at 3:39 PM, Nicolas Tardieu wrote:<br>
<br>
</div></div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><div><div></div><div class="Wj3C7c">
Dear PETSc users,<br>
<br>
The attached file is a naive test of MatMatSolve : I create a matrix,say A, I duplicate it, say BB, and I would like to compute A^{-1}*BB.<br>
Since A is the identity matrix, I would like to get the identity matrix. But I don't!<br>
Here is what I obtain by doing "./niko1f -n 3" :<br>
<br>
===========================================================================<br>
A before MatMatSolve<br>
row 0: (0, 1)<br>
row 1: (1, 1)<br>
row 2: (2, 1)<br>
BB before MatMatSolve<br>
row 0: (0, 1)<br>
row 1: (1, 1)<br>
row 2: (2, 1)<br>
XX before MatMatSolve<br>
0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00<br>
0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00<br>
0.0000000000000000e+00 0.0000000000000000e+00 0.0000000000000000e+00<br>
XX after MatMatSolve<br>
1.0000000000000000e+00 1.9966503766457982e-314 7.9050503334599447e-323<br>
1.0000000000000000e+00 0.0000000000000000e+00 6.4996731077266291e-311<br>
1.0000000000000000e+00 2.6136072665001942e-321 9.6616869034104132e-317<br>
===========================================================================<br>
<br>
<br>
Can you tell me what I am doing wrong?<br>
<br>
Thanks,<br>
<br>
Nicolas<br>
<br></div></div>
<niko1f.F><br>
</blockquote>
<br>
</blockquote></div><br></div>