ProteoWizard
|
Provides static methods for writing and reading matrices to/from files. More...
#include <MatrixIO.hpp>
Static Public Member Functions | |
static void | GetWriteStream (std::ofstream &out, const std::string &filename) |
Factory method for generating output streams with fixed properties set for writing matrices. | |
static void | WriteBinary (std::ofstream &out, boost::shared_ptr< DemuxTypes::MatrixType > matrix) |
Writes a matrix to filestream including header information about the number of rows and columns. Matrices are written in row-major format. | |
static void | WriteBinary (const std::string &filename, boost::shared_ptr< DemuxTypes::MatrixType > matrix) |
Convience function for writing a single matrix to file. | |
static void | GetReadStream (std::ifstream &in, const std::string &filename) |
Factory method for generating input streams with fixed properties set for reading matrices. | |
static void | ReadBinary (std::ifstream &in, boost::shared_ptr< DemuxTypes::MatrixType > matrix) |
Convenience function for reading a single matrix from a file. | |
static void | ReadBinary (const std::string &filename, boost::shared_ptr< DemuxTypes::MatrixType > matrix) |
Reads a matrix from filestream. Matrices are written in row-major format. | |
Provides static methods for writing and reading matrices to/from files.
An example file format used is as follows:
byte | type | description |
---|---|---|
0 | int64 | num_rows |
8 | int64 | num_cols |
16 | double | element_0 |
24 | double | element_1 |
32 | double | element_2 |
... | double(s) | ... |
(num_elements - 1) * 8 + 16 | double | element_n |
Note that the type of the index (shown as int64) is subject to change and is dependent on the type of Matrix::Index. Similarly, the type of each element is dependent on the type of the Scalar type of the Matrix. However, in the current (as of 8/30/2016) implementation of DemuxTypes::MatrixType the types shown above are accurate.
Definition at line 45 of file MatrixIO.hpp.
|
static |
Factory method for generating output streams with fixed properties set for writing matrices.
Referenced by MatrixIOTest::MultiReadWrite().
|
static |
Writes a matrix to filestream including header information about the number of rows and columns. Matrices are written in row-major format.
Referenced by MatrixIOTest::MultiReadWrite(), and MatrixIOTest::SingleReadWrite().
|
static |
Convience function for writing a single matrix to file.
|
static |
Factory method for generating input streams with fixed properties set for reading matrices.
Referenced by MatrixIOTest::MultiReadWrite().
|
static |
Convenience function for reading a single matrix from a file.
Referenced by MatrixIOTest::MultiReadWrite(), and MatrixIOTest::SingleReadWrite().
|
static |
Reads a matrix from filestream. Matrices are written in row-major format.