Input/output¶
We provide several functions for displaying data and handle file I/O.
Print¶
We provide print functions for Matrix
, SpMat
and Vector
. The function declaration is in algebra.h.
-
void
print
(SpMat &A)¶ Print a sparse matrix to cout.
Read¶
We support a variety of data formats. If you data format is not supported, you can either convert your data files to one of the following supported format, or you can add the corresponding data file loader to TMAC.
Matrix market format¶
We support the matrix market format for dense matrix, sparse matrix, and dense vector. You can find the details of matrix market format here.
-
void
loadMarket
(SpMat &A, const std::string &file_name)¶ Load data to a sparse matrix.
LIBSVM format¶
We will load the data in LIBSVM format to a sparse matrix for data samples, and a dense vector for labels.
Matlab format¶
Coming soon...
Write¶
Coming soon...