[Trilinos-Users] EpetraExt MatrixMatrix

John G. Lewis jglewis at cray.com
Wed Jun 2 12:13:15 MDT 2010


As a point of information -- the same requirement occurs in symmetric indefinite linear equation solvers (both dense and sparse) and in some symmetric eigensolvers.  Please also note that B^T D B is obviously a symmetric matrix; none of the proposed solutions exploit symmetry.

John

-----Original Message-----
From: trilinos-users-bounces at software.sandia.gov [mailto:trilinos-users-bounces at software.sandia.gov] On Behalf Of Erik Boman
Sent: Wednesday, June 02, 2010 8:36 AM
To: Kevin Long
Cc: Victoria Howle; trilinos-users at software.sandia.gov
Subject: Re: [Trilinos-Users] EpetraExt MatrixMatrix

Kevin and Vicki,

I've done this before to form a Schur complement explicitly.
I used the LeftScale method in Epetra to form C1=D*B. This helps, but is
not a great solution since I then needed to store the scaled copy of B.
I don't know if anybody has implemented a more efficient solution.

Erik


On Tue, 2010-06-01 at 17:23 -0600, Kevin Long wrote:
> Hi,
> 
> Vicki Howle and I have encountered a problem for which we want to compute 
> explicitly (as an Epetra_CrsMatrix) the product B^T D B, where D is a 
> diagonal matrix. We have B as an Epetra_CrsMatrix and diag(D) as an 
> Epetra_Vector. 
> 
> We can do this easily enough by making an Epetra_CrsMatrix representation of 
> D, then calling EpetraExt::MatrixMatrix::Multiply() twice, first to form 
> C1=D*B, then again to form C= B^T C1.  The second call can use 
> transposeA=true so we don't need to form B^T. 
> 
> Alternatively, I could form C1=sqrt(D) B, then do C1^T C1. Again, not hard to 
> write. 
> 
> However, neither approach takes advantage of the fact that D is diagonal, 
> which means (a) I need to construct a whole Epetra_CrsMatrix for something 
> that can really just be stored as a vector, and (b) inside 
> MatrixMatrix::Multiply(), I'm doing needless work to find the graph of the 
> product D B when I already know that D B and B will have the same graph. 
> 
> The operation B^T D B is a fairly common; any chance that someone will extend 
> MatrixMatrix to provide an optimized multiply for that case? Or better yet, 
> has anyone already written such code?  
> 
> Thanks,
> 
> Kevin
> 
> 
> 
> 
> 

_______________________________________________
Trilinos-Users mailing list
Trilinos-Users at software.sandia.gov
http://software.sandia.gov/mailman/listinfo/trilinos-users





More information about the Trilinos-Users mailing list