HDF5Serie |
Project Page |
Serie of matrices. More...
#include <matrixserie.h>
Public Member Functions | |
| MatrixSerie () | |
| A stub constructor. | |
| MatrixSerie (const MatrixSerie< T > &dataset) | |
| Copy constructor. | |
| MatrixSerie (const CommonFG &parent, const std::string &name) | |
| Constructor for opening a dataset. | |
| MatrixSerie (const CommonFG &parent, const std::string &name, const int rows, const int cols, int compression=FileSerie::getDefaultCompression(), int chunkSize=FileSerie::getDefaultChunkSize()) | |
| Dataset creating constructor. | |
| void | create (const CommonFG &parent, const std::string &name, const int rows, const int cols, int compression=FileSerie::getDefaultCompression(), int chunksize=FileSerie::getDefaultChunkSize()) |
| Creating a dataset. | |
| void | open (const CommonFG &parent, const std::string &name) |
| Open a dataset. | |
| void | setDescription (const std::string &desc) |
| Sets a description for the dataset. | |
| void | append (const std::vector< std::vector< T > > &matrix) |
| Append a matrix. | |
| unsigned int | getNumberOfMatrices () |
| Returns the number of matrices in the dataset. | |
| unsigned int | getRows () |
| Returns the number of rows of the matrix. | |
| unsigned int | getColumns () |
| Returns the number of columns of the matrix. | |
| std::vector< std::vector< T > > | getMatrix (const int number) |
| Returns the matrix at position number. | |
| std::string | getDescription () |
| Return the description for the dataset. | |
| void | extend (const hsize_t *size) |
Serie of matrices.
A HDF5 dataset for reading and writing a serie of data matrices. The type of the elements of the matrix (template type T) can be of:
The data is stored as a 3D array in the HDF5 file. The first dimension is the serie.
A Note when using a vector-matrix-library: It is likly that the data in calculated by using a vector-matrix-library. If so, and the vector object (of type T) of the library (e.g. fmatvec from http://code.google.com/p/fmatvec/) has a cast-operator to std::vector<T> and a constructor with a single parameter of type std::vector<T>, then you can use the vector-object wherever a object of type std::vector<T> is needed. The same applies to a matrix-object for std::vector<std::vector<T> >.
| H5::MatrixSerie< T >::MatrixSerie | ( | ) |
A stub constructor.
Creates a empty object.
| H5::MatrixSerie< T >::MatrixSerie | ( | const CommonFG & | parent, |
| const std::string & | name | ||
| ) |
Constructor for opening a dataset.
see open()
| H5::MatrixSerie< T >::MatrixSerie | ( | const CommonFG & | parent, |
| const std::string & | name, | ||
| const int | rows, | ||
| const int | cols, | ||
| int | compression = FileSerie::getDefaultCompression(), |
||
| int | chunkSize = FileSerie::getDefaultChunkSize() |
||
| ) |
| void H5::MatrixSerie< T >::append | ( | const std::vector< std::vector< T > > & | matrix | ) |
Append a matrix.
Appends the matrix data at the end of the dataset. The fist dimension of the HDF5 array will be incremented by this operation.
| void H5::MatrixSerie< T >::create | ( | const CommonFG & | parent, |
| const std::string & | name, | ||
| const int | rows, | ||
| const int | cols, | ||
| int | compression = FileSerie::getDefaultCompression(), |
||
| int | chunksize = FileSerie::getDefaultChunkSize() |
||
| ) |
Creating a dataset.
Creates a dataset named name as a child of position parent. By default the dataset is compressed using deflate (gzip) with compression level FileSerie::defaultCompression. Use compression to adjuste the compression level [1-9] or 0 to disable compression.
| string H5::MatrixSerie< T >::getDescription | ( | ) |
Return the description for the dataset.
Returns the value of the string attribute named Description of the dataset.
| vector< vector< T > > H5::MatrixSerie< T >::getMatrix | ( | const int | number | ) |
Returns the matrix at position number.
The first number is 0. The last avaliable number/position is getNumberOfMatrices()-1.
| void H5::MatrixSerie< T >::open | ( | const CommonFG & | parent, |
| const std::string & | name | ||
| ) |
Open a dataset.
Opens the dataset named name as a child of position parent.
| void H5::MatrixSerie< T >::setDescription | ( | const std::string & | desc | ) |
Sets a description for the dataset.
The value of desc is stored as an string attribute named Description in the dataset.
1.8.0