[petsc-users] T^t*K*T for SEQSBAIJ matrix type

Jose E. Roman jroman at dsic.upv.es
Mon Jun 7 08:55:03 CDT 2010


On 07/06/2010, Martin Rädel wrote:

> Dear All,
> 
> I try to multiply matrices in the following way:
> 
> K_=T^t*K*T
> 
> where K is symmetric and positive definite and has the type SEQSBAIJ and T is 
> nonsymmetric and has the type SEQAIJ.
> I searched the manual for possibilities to compute this task but I just found  
> MatMatMultTranspose which is only applicable for matrices of type SEQAIJ and 
> MatPtAP which only works for AIJ-type matrices.
> 
> Is there a way to calculate T^t*K*T for the used matrix types (K=SEQSBAIJ) ?
> 
> Thank you very much,
> 
> Martin
> 
> Btw, I am currently using PETSc 3.0 since I work with SLEPc as well.
> 
> -- 
> Martin Rädel

I would suggest giving up the SEQSBAIJ and using MatPtAP.

Depending on the situation, an alternative could be to use a shell matrix instead of forming T^t*K*T explicitly. If for instance this matrix is the eigenproblem matrix in EPS, you can consider using SLEPc's ex3.c as a basis and define the MatMult operation to perform the sequence MatMult(T), MatMult(K), MatMultTranspose(T).

Best,
Jose E. Roman



More information about the petsc-users mailing list