← Back to team overview

dolfin team mailing list archive

Re: io interface for MatrixMarket

 

The Matrix Market format has been added. I removed some of the
functions that were not used and it would be great if you could submit
another patch to clean up the implementation and remove some more
code, in particular all the defines and macros in MTXFile.h. And I
don't really like the use of malloc/free.

I know you didn't write the code so I don't blame you for all the
mess... :-) The code you wrote looks ok.

Please submit any patch to the mailing list as an uncompressed patch
file named according to

    dolfin-hetzel-yyyy-mm-dd.patch

See manual for instructions.

/Anders

On Mon, Oct 24, 2005 at 05:51:57PM +0200, hetzel.devel@xxxxxx wrote:
> 
> I have changed the output of info and warnings to dolfin "standard"
> I included the functions of mmio.cpp and mmio.h into the MTXFile.cpp and MTXFile.h.
> 
> - dolfin  src/kernel/io/mmio.cpp
> + dolfin  src/kernel/io/MTXFile.cpp
>   dolfin  src/kernel/io/File.cpp
>   dolfin  src/kernel/io/Makefile.am
>   dolfin  src/kernel/io/Makefile.in
> - dolfin  src/kernel/io/dolfin/mmio.h
> + dolfin  src/kernel/io/dolfin/MTXFile.h
>   dolfin  src/kernel/io/dolfin/File.h
>   dolfin  src/kernel/io/dolfin/Makefile.am
>   dolfin  src/kernel/io/dolfin/Makefile.in
> 
> /Haiko
> 
> Discussion of DOLFIN development <dolfin-dev@xxxxxxxxxx> schrieb am 24.10.05 01:27:29:
> > 
> > I have added the matrix market format, but it would be good if you
> > could take the functionality that you actually use from mmio.cpp and
> > implement as private (and possibly static) members of MTXFile, and
> > make sure to use dolfin_info() instead of printf() and dolfin_error()
> > instead of printf()/exit().
> > 
> > /Anders
> > 
> > On Tue, Oct 18, 2005 at 01:01:06PM +0200, hetzel.devel@xxxxxx wrote:
> > > 
> > > 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
> > > 
> > > 
> > > _______________________________________________
> > > 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
> 


> _______________________________________________
> DOLFIN-dev mailing list
> DOLFIN-dev@xxxxxxxxxx
> http://www.fenics.org/cgi-bin/mailman/listinfo/dolfin-dev


-- 
Anders Logg
Research Assistant Professor
Toyota Technological Institute at Chicago
http://www.tti-c.org/logg/



References