[Trilinos-Users] Epetra - Dense Matrix-Vector multiply basics

Heroux, Michael A maherou at sandia.gov
Thu Apr 2 07:02:22 MDT 2015


Gyorgy,

Assuming your x, y and A are dense objects, you are using the correct function, Multiply().  Chances are that you have some detail incorrect.  First you should check for error codes that are being returned.  Multiply() will return integer error codes if it runs into issues:

Int ierr = y.Multiply(...)

If (ierr!=0) ...

Regarding your transpose operation, if I understand the situation correctly, x should also be transposed to be a row vector.  Multiply() is probably complaining about this.  There is no way in the Epetra framework to specify that the "this" argument is transposed.

I think it is best to perform the transpose operation as

x = A^T y

This expression keeps the dimensions correct.

Try this and see how it goes.

Mike

From: Gyorgy Matyasfalvi <matyasfalvi at gmail.com<mailto:matyasfalvi at gmail.com>>
Date: Wednesday, April 1, 2015 at 10:41 PM
To: "trilinos-users at software.sandia.gov<mailto:trilinos-users at software.sandia.gov>" <trilinos-users at software.sandia.gov<mailto:trilinos-users at software.sandia.gov>>
Subject: [EXTERNAL] [Trilinos-Users] Epetra - Dense Matrix-Vector multiply basics

Dear Developers/Users:

I have a question concerning matrix-vector multiplies:

1) Is there a document or example file that explains the basics of matrix-vector multiplies? Preferably isolated examples of mtx-vec mults. instead of being embedded in some algorithm.

If this doesn't exist. Then I'd be interested in finding out:

2) How to do dense matrix, dense vector multiplies?
I assume it's done via the Epetra_MultiVector class. However, the only operation that seems to have an effect is the following:

y = A x
using
y.Multiply('N', 'N', 1.0, A, x, 0.0)
(x was constructed using an Epetra_LocalMap
A, and y were constructed using the same Epetra_Map)

The problem is that if I want to compute for example:

x = y^T A
using
x.Multiply('T', 'N', 1.0, y, A, 0.0)

it seems the Multiply() operation doesn't do anything x remains unchanged.

What am I doing incorrectly here?
Thanks a lot! Best,
Gyorgy




-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://software.sandia.gov/pipermail/trilinos-users/attachments/20150402/33550e60/attachment.html>


More information about the Trilinos-Users mailing list