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

Ali Berk Kahraman aliberkkahraman at yahoo.com
Wed Sep 27 01:39:17 CDT 2017


Well, this is embarrasing. Yes, it is. I do not know how I did not see 
that. I guess the sum sign distracted me.

Problem is solved.

Thank you for the answer.


Ali


On 27-09-2017 01:58, Jed Brown wrote:
> 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