An SMF stream contains two types of records, a size record and an element record. The size record contains the row and column sizes of the matrix and the element record contains the indices and value for one element. The stream can contain multiple input matrices where each matrix is defined by a size record followed by its element records. The size record is optional for the first matrix.
A size record has two white-space delimited integer fields. The first field holds the number of rows in the matrix and the second holds the number of columns. The size record if present must precede the element records for a matrix.
An element record has four white-space delimited fields. The first two are integer and hold the row and column index respectively. The third field holds the real part of the element. The fourth field is optional and holds the imaginary part of the element.
A any line with a leading '#' is taken as a comment and ignored.
Here is an example SMF input stream:
# ---------------------------------
# The first matrix - dense 2x2
# ---------------------------------
2 2
0 0 2.3
0 1 4.5 0.5
1 0 5.8
1 1 0.0 6.7
# -------------------------------------------
# The second matrix - sparse 100x100
# -------------------------------------------
100 100
0 1 34.6 7.6
55 45 49.0 3.4
99 99 32.4
18 92 32.8