[Trilinos-Users] How to read a MatrixMarket File

Thornquist, Heidi K hkthorn at sandia.gov
Mon Mar 3 10:17:49 MST 2008

Hi Virginia,

The EpetraExt::MatrixMarketFileToBlockMap function is there to read in an Epetra_BlockMap that has been written out using Epetra::BlockMapToMatrixMarketFile.  It looks like you are trying to use the function to read in a regular matrix market file (bcsstk14.mtx), expecting that it will return an Epetra_BlockMap for that matrix (?).  Unfortunately that will not happen with this function.  If you are trying to read in a Matrix Market file from the collection it will, it would be better to use the EpetraExt::readEpetraLinearSystem function.  This function only expects you to provide a filename and Epetra_Comm object.  The Epetra_CrsMatrix, Epetra_Map, Epetra_Vectors defining the linear problem can be passed in as null Teuchos::RefCountPtrs.  These pointers will be assigned by the function, making it easier on the user to read in matrices like those from Matrix Market.  It will correctly read in files with the following extensions:  *.triU, *.triS, *.mtx, *.hb.

However, this is just a guess at what you are trying to accomplish with the code you have included.  If I have not provided you with an answer to your problem, maybe you could give us more information on what you are trying to accomplish by using a matrix market file to create a map that is then used to generate an Epetra_VbrMatrix.


On 3/3/08 9:44 AM, "Heroux, Michael A" <maherou at sandia.gov> wrote:

Hi Virginia,

To the best of my knowledge there is no supported functionality for this.  There is some chance that another user has done something.  I seem to recall that a student of Jonathan Hu did something like this.  Jonathan?


On 3/2/08 7:16 AM, "Virginia Costa" <virscosta at gmail.com> wrote:

Hi, everybody.
Does anybody know how to read a MatrixMarket file to a BlockMap?
I tried to do this:

int main(int argc, char *argv[])
    Epetra_SerialComm Comm;
    Epetra_BlockMap *BMap;
    EpetraExt::MatrixMarketFileToBlockMap("bcsstk14.mtx", Comm, BMap);
    Epetra_VbrMatrix A(Copy,*BMap,2);

But it's returns a segmentation fault.



-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://software.sandia.gov/mailman/private/trilinos-users/attachments/20080303/a54d5fe1/attachment.html

More information about the Trilinos-Users mailing list