TensorMarket
This is a repository for sparse tensor file storage.
Currently supporting the following formats:
.tns
throughtnsread()
andtnswrite()
- The
.tns
format is the format used by the FROSTT tensor collection.
- The
TensorMarket.tnsread
— Methodtnsread(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
TensorMarket.tnswrite
— Methodtnswrite(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
TensorMarket.ttread
— Functionttread(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
TensorMarket.ttwrite
— Methodttwrite(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