Matrix Market provides Fortran subroutines for three basic Matrix Market file I/O functions: mminfo, mmread, and mmwrite. All subroutines are contained in the file mmio.f. A sample driver program is provided in testio.f.
These routines were updated to apply bug fixes and incorporate additional input validation. Please try the new verion of mmio.f and report any problems via email to Matrix Market.
(Thanks to G.P.Leendetse and H.Oudshoom for their review of the initial version and suggested fixes.)
Calling sequence:  subroutine mminfo(iunit,rep,field,symm,rows,cols,entries)  

Description:  Queries the contents of the Matrix Market file connected to the
unit iunit to extract size and storage information.
In the case of coordinate matrices, entries refers to the number of coordinate entries stored in the file. In the case of array matrices, entries is the product rows*cols for nonsymmetric matrices, and ((rows*cols  rows)/2 + rows if symmetry was used to store the matrix efficiently. entries can be used to determine storage requirements in the calling program. The unit iunit must be open, and the file will be rewound on return. Arguments:

Calling sequence: 
subroutine mmread(iunit,rep,field,symm,rows,cols,entries,nnzmax, indx, jndx, rval, cval) 


Description:  Reads the contents of the Matrix Market file connected to the
unit iunit into the storage arrays provided.
In the case of coordinate matrices, entries refers to the number of coordinate entries stored in the file. In the case of array matrices, entries is the product rows*cols for nonsymmetric matrices, and ((rows*cols  rows)/2 + rows if symmetry was used to store the matrix efficiently. nnzmax is used ensure that the storage arrays are large enough to hold the required data. nnzmax should therefore reflect the actual dimension of the storage arrays as declared. The unit iunit must be open, and the file will be rewound on return. Arguments:

Calling sequence: 
subroutine mmwrite(ounit,rep,field,symm,rows,cols,entries, indx, jndx, rval, cval) 


Description:  Writes matrix data to a Matrix Market formatted file connected to the
unit ounit.
In the case of coordinate matrices, entries number of nonzero values to be stored. In the case of array matrices, entries is the product rows*cols for nonsymmetric matrices, and ((rows*cols  rows)/2 + rows if symmetry was used to store the matrix efficiently. The unit ounit must be open, and the file will be rewound on return. Arguments:

30Oct96  Bug fixes in mmio.f:

