TensorMarket

This is a repository for sparse tensor file storage.

Currently supporting the following formats:

  • .ttx through ttread() and ttwrite().

    • The .ttx format is a straightforward generalization of .mtx to support arbitrarily many indices. The file should specify tensor instead of matrix, but otherwise is the same. The .ttx format is also supported by the TACO sparse tensor compiler.
  • .tns through tnsread() and tnswrite()

    • The .tns format is the format used by the FROSTT tensor collection.
TensorMarket.tnsreadMethod
tnsread(filename)

Read the contents of the FROSTT .tns file 'filename' into a sparse coordinate list.

Coordinate lists are returned as a tuple of arrays (analogous to findnz()) ((row_coordinates, column_coordinates, ...), values)`

This format assumes the size of the tensor equals its maximum coordinate in each dimension.

See also: tnswrite

source
TensorMarket.tnswriteMethod
tnswrite(filename, (I_1, I_2, ...), V)

Write sparse tensor coordinates to file 'filename' in FROSTT .tns format.

Coordinate lists are specified as a tuple of arrays (analogous to findnz()) (I, V) = (row_coordinates, column_coordinates, ...), values)`

This format assumes the size of the tensor equals its maximum coordinate in each dimension.

See also: tnsread

source
TensorMarket.ttreadFunction
ttread(filename, infoonly::Bool=false, retcoord::Bool=false)

Read the contents of the Tensor Market file 'filename' into a sparse coordinate list or dense array, depending on the Tensor Market format indicated by 'coordinate' (coordinate sparse storage), or 'array' (dense array storage).

Coordinate lists are returned as a tuple of arrays (analogous to findnz()) ((row_coordinates, column_coordinates, ...), values, size)`

If infoonly is true (default: false), only information on the size and structure is returned from reading the header. The actual data for the matrix elements are not parsed.

If retcoord is true (default: false), the coordinate and value vectors are returned, if it is a sparse matrix, along with the header information.

See also: ttwrite

source
TensorMarket.ttwriteMethod
ttwrite(filename, (I_1, I_2, ...), V, size)

Write sparse tensor coordinates to file 'filename' in TensorMarket format.

Coordinate lists are specified as a tuple of arrays (analogous to findnz()) (I, V) = (row_coordinates, column_coordinates, ...), values)`

See also: ttread

source