[Trilinos-Users] problems with transpose, inverse and products with Epetra_CRSMatrix

Heroux, Mike MHeroux at CSBSJU.EDU
Wed Sep 10 15:17:47 MDT 2014


In addition to the pointers that Alicia provided, you can compute the
matrix-transpose times vector product using the specific Epetra_CrsMatrix
method called Multiply().  This method has a bool input argument that
indicates whether or not to apply the matrix-transpose operation:

http://trilinos.org/docs/dev/packages/epetra/doc/html/classEpetra__CrsMatri
x.html#ae97a6c65b11aa29b3bb25d9788c56b3a

In general, it is unusual (but not necessarily wrong) to explicitly form
the transpose of a matrix.  In many situations, just being able to apply
the action of the matrix transpose is sufficient.

Following up on Alicia¹s comments on inverses, it is almost never best to
explicitly compute the inverse of a sparse matrix, unless it is small or
has very special structure.

Perhaps if you describe the algorithms you are trying to implement we can
suggest some other options.

Mike

On 9/10/14, 8:10 AM, "Alicia Marie Klinvex" <aklinvex at purdue.edu> wrote:

>Hello Antonella and Deepak,
>
>The matrix multiplication is in the EpetraExt package:
>http://trilinos.org/docs/dev/packages/epetraext/doc/html/classEpetraExt_1_
>1MatrixMatrix.html
>
>I believe the transpose function you seek is also in EpetraExt:
>http://trilinos.org/docs/dev/packages/epetraext/doc/html/classEpetraExt_1_
>1RowMatrix__Transpose.html
>(I could be wrong about that one; I've never used that particular
>function before.)
>
>The matrix vector multiplication is in Epetra (called Apply):
>http://trilinos.org/docs/dev/packages/epetra/doc/html/classEpetra__CrsMatr
>ix.html#a77c4232f1b3d32ff76504ed314df5f76
>
>Do you absolutely need to compute the inverse of your matrix, or do you
>just want to apply the inverse to a vector?  I'm afraid I don't know
>whether Trilinos even has a function to invert a sparse matrix, but if
>you were only interested in solving linear systems, it certainly has
>functions for that.
>
>Best wishes,
>Alicia Klinvex
>
>
>
>----- Original Message -----
>From: "Antonella Longo" <longo at pi.ingv.it>
>To: trilinos-users at software.sandia.gov
>Cc: "Deepak Garg" <deepak.garg at pi.ingv.it>
>Sent: Wednesday, September 10, 2014 9:10:46 AM
>Subject: [Trilinos-Users] problems with transpose,	inverse and products
>with Epetra_CRSMatrix
>
>We are making computations with Epetra_CRSMatrices,
>but we could not find any mathematical functions for
>these matrices.
>In particular we need to compute the transpose and
>the inverse of an Epetra_CRSMatrix, to calculate
>the product of two Epetra_CRSMatrices, and the
>product of an Epetra_CRSMatrix with an Epetra_Vector.
>Does there exist any standard functions for these operations?
>We checked the functions of the above mentioned classes but we found
>nothing. 
>
>Thanks for your kind attention.
>
>Antonella Longo and Deepak Garg
>
>
>
>-----------------------------------------------
>Antonella Longo
>Istituto Nazionale di Geofisica e Vulcanologia
>Sezione di Pisa
>Via Uguccione della Faggiola, 32
>Pisa, Italy
>Tel. office: 050 8311939
>Cell.: 339 7532089
>
>_______________________________________________
>Trilinos-Users mailing list
>Trilinos-Users at software.sandia.gov
>https://software.sandia.gov/mailman/listinfo/trilinos-users
>_______________________________________________
>Trilinos-Users mailing list
>Trilinos-Users at software.sandia.gov
>https://software.sandia.gov/mailman/listinfo/trilinos-users



More information about the Trilinos-Users mailing list