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
