← Back to team overview

dolfin team mailing list archive

Re: io interface for MatrixMarket

 

Hi Andres,
I attached a tar file for a first matrixmarket interface. It uses the files mmio.c (renamed to mmio.cpp) and mmio.h which you can get from the MatrixMarket homepage.
It was neccessary to make some small adjustments to these files.
File.cpp and File.h needed to be updated to incorporate the extentions ".mtx" and ".mat"
MTXFile.cpp and MTXFile.h include the in and out routine for "normal" matrices and vectors.
I tested the line with some simple files.
The mail with the files will be send directly to you, to avoid sending them through the mailing list.

/Haiko

Discussion of DOLFIN development <dolfin-dev@xxxxxxxxxx> schrieb am 17.10.05 17:03:02:
> 
> On Mon, Oct 17, 2005 at 04:47:13PM +0200, hetzel.devel@xxxxxx wrote:
> > 
> > Hi, I'm currently implementing some stuff with dolfin and so I
> > rewrote the C-interface to read and write my MatrixMarket
> > matrices(http://math.nist.gov/MatrixMarket/) for dolfin.  The
> > interface is quite simple and does not support the whole
> > functionality of the MatrixMarket syntax, but I think this would be
> > a good think to incorporate to dolfin.  So my question is: How can I
> > help? Who is responsible for the io-stuff?
> > 
> > /Haiko
> 
> It would be good with support for the MatrixMarket format in DOLFIN.
> 
> I suggest you look at the files in the directory src/kernel/io. You
> need to write a new class MTXFile as a subclass of GenericFile and
> modify the class File so that files with extension .mtx or .mtx.gz are
> coupled to the MTX format. Then matrices (and vectors?) can be written
> to file in MatrixMarket format as follows:
> 
>     Matrix A;
>     ...
>     File file("matrix.mtx");
>     file << A;
> 
> and read from file as follows:
> 
>     Matrix A;
>     File file("matrix.mtx");
>     file >> A;
> 
> We could add a new constructor to Matrix that allows us to do
> 
>     Matrix A("matrix.mtx");
> 
> and the implementation would just be
> 
>     File file(filename);
>     file >> *this;
> 
> You will probably need to make MTXFile a friend of Matrix so you can
> modify the matrix from within MTXFile at read.
> 
> /Anders
> 
> _______________________________________________
> DOLFIN-dev mailing list
> DOLFIN-dev@xxxxxxxxxx
> http://www.fenics.org/cgi-bin/mailman/listinfo/dolfin-dev


______________________________________________________________
Verschicken Sie romantische, coole und witzige Bilder per SMS!
Jetzt bei WEB.DE FreeMail: http://f.web.de/?mc=021193




Follow ups