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

Heroux, Michael A maherou at sandia.gov
Thu Apr 2 23:24:27 MDT 2015


Gyorgy,

Please give me some details about your problem:  Algorithm, size of matrices, type of data distribution.  Just the basics to start.

Thanks.

Mike

On Apr 2, 2015, at 11:03 PM, Gyorgy Matyasfalvi <matyasfalvi at gmail.com<mailto:matyasfalvi at gmail.com>> wrote:

Dear Mike:

Thanks for your help. Indeed I got an error code of -2 and I suspect that, as you pointed out, the issue is that *this is not a row vector.

My other question then would be: Is it possible to define a "Domain Map" for Multivectors? i.e I want processors to own columns of the matrix instead of rows. So basically spread out the columns among different processors. I know think this is possible for sparse matrices.

Thanks! Best,
Gyorgy



On Thu, Apr 2, 2015 at 9:02 AM, Heroux, Michael A <maherou at sandia.gov<mailto:maherou at sandia.gov>> wrote:
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><mailto: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><mailto: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><mailto: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/20150403/91edc441/attachment.html>


More information about the Trilinos-Users mailing list