[petsc-users] Getting access to matrix rows without and setting values simultaneously

Alexander Grayver agrayver at gfz-potsdam.de
Thu Jun 16 11:03:16 CDT 2011


On 16.06.2011 17:40, Jed Brown wrote:
> On Thu, Jun 16, 2011 at 17:34, Matthew Knepley <knepley at gmail.com 
> <mailto:knepley at gmail.com>> wrote:
>
>     Yes, you can do MF applications of A' A. You could just make a
>     MatShell that called MatMult and MatMultTranspose.
>
>
> MatShell is not necessary, just use MatCreateTranspose().
>
> http://www.mcs.anl.gov/petsc/petsc-as/snapshots/petsc-dev/docs/manualpages/Mat/MatCreateTranspose.html

That's not very clear to me. I understand what Matthew mean, but can I 
use MF without MatShell at all?
So far I imagine it like this:
1. I create matrix using MatCreateShell
2. I set MATOP_MULT and MATOP_MULTTRANSPOSE using MatShellSetOperation
3. Inside my operations I represent the product (A'*A)v as
w = Av -- using MatMult
f = A'w -- using MatMultTranspose

Where should I use MatCreateTranspose?

>
> But I think Alexander is clear on that part.
>
>     For modifying the matrix, MatGetRow() IF you are using an AIJ
>     matrix, return a pointer directly to the values.
>
>
> This is only for SeqAIJ.
>
>
> Alexander, could you clarify where in the Gauss-Newton procedure you 
> outlined is the dense matrix on which you need to do the nonlinear row 
> operation?

So if my system is:
(A'*A)v=A'r
then A everywhere is transformed.

There is possibility to compute transformed A directly instead of 
applying it afterward as Matthew suggested. It could be through the 
using C_tr instead of C in this formula:
A_i = C*F(m)^-1*v
Since I assemble C myself I can apply transformation per element. That 
is not as elegant as using chain rule, but still possible.

>
> Also, the matrix A'*A has a huge null space. What sort of 
> regularization are you using.

I use Tikhonov regularization. And there is variety of choices for 
regularization matrix you use.

Could you (Matthew and Jed) suggest any solver which is better for this 
kind of problem?

Thanks a lot for your help.
Regards,
Alexander

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20110616/03dcc3db/attachment-0001.htm>


More information about the petsc-users mailing list