[petsc-users] Creating a Matrix Using Inner Products of Columns and Rows of Two matrices

Jed Brown jed at jedbrown.org
Tue Sep 26 17:58:55 CDT 2017


Why is this not MatMatMult()?

Ali Berk Kahraman <aliberkkahraman at yahoo.com> writes:

> Hello all,
>
> I have to generate a matrix C such that 
> ,Ck,m=∑pAk,pDp,mC_{k,m}=\sum_{p}A_{k,p}D_{p,m} where A and D are two 
> square matrices of the same size. This is simply the inner products of 
> rows of A and columns of D. I do not want to use MatGetValues to get 
> values form the matrices, then create Vectors with those values and use 
> dot product function of petsc, because that would be super non-efficient.
>
> What do you think? How can it be done more efficiently?
>
>
> Best Regards,
>
>
> Ali Berk Kahraman
>
> CFD-FMS Research Group, Mech. Eng. Department
>
> Boğaziçi University, Istanbul, Turkey


More information about the petsc-users mailing list