<< mmgetpath Matmark mmread >>

Matmark >> Matmark > mminfo

mminfo

Extracts size and storage information out of a Matrix Market file

Calling Sequence

[rows,cols,entries,rep,field,symm,comments] = mminfo(filename)

Parameters

filename

a 1-by-1 matrix of strings, path of the Matrix Market file, or logical unit associated to that file.

rows

a 1-by-1 real matrix, number of matrix rows.

cols

a 1-by-1 real matrix, number of matrix columns.

entries

a 1-by-1 real matrix, number of entries stored in the file (see below).

rep

a 1-by-1 matrix of strings, with values "coordinate" or "array".

field

a 1-by-1 matrix of strings, with values "real", "complex" or "pattern".

symm

a 1-by-1 matrix of strings, with values "general", "symmetric", "skew-symmetric", "hermitian".

comments

a 1-by-n matrix of strings, contains the comments present in the file header.

Description

mminfo Extracts size and storage information out of a Matrix Market file.

In the case of coordinate matrices, entries refers to the number of coordinate entries stored in the file. The number of non-zero entries in the final matrix cannot be determined until the data is read (and symmetrized, if necessary). In the case of array matrices, entries is the product rows*cols, regardless of whether symmetry was used to store the matrix efficiently.

If filename is a file path , mminfo(filename) opens the file, reads the information and then closes the file.

If filename is a logical unit (see mopen) , mminfo(filename) reads the information and and let the file pointer positionned at the beginning of the data in the file without left hand side arguments mminfo(filename) displays the file information.

Examples

In the following example, we extract the information from a 4-by-4 complex hermitian matrix.

filename = fullfile(mmgetpath(),"tests","unit_tests","A.mtx");
// Print in the console
mminfo(filename);
// Do not print in the console
[rows,cols,entries,rep,field,symm,comments] = mminfo(filename)

In the following example, we extract the information from a file descriptor, as the output of mopen.

fd = mopen(filename,"r");
[rows,cols,entries,rep,field,symm,comments] = mminfo(fd);
mclose(fd);

In the following example, we analyze a collection of files downloaded from http://math.nist.gov/MatrixMarket.

path = fullfile(mmgetpath (  ),"tests","unit_tests");
F=listfiles(fullfile(path,"*.mtx"));
for f=F'
  mminfo(f);
  A = mmread(f);
end

See Also

Authors

Copyright (C) 2009 - INRIA - Serge Steer

Copyright (C) 2011 - Benoit Goepfert

Copyright (C) 2011 - DIGITEO - Michael Baudin

Bibliography

http://math.nist.gov/MatrixMarket/formats.html

http://math.nist.gov/MatrixMarket/mmio/matlab/mminfo.m


<< mmgetpath Matmark mmread >>