123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143 |
- #ifndef MATFILEIOH_INCLUDE
- #define MATFILEIOH_INCLUDE
- #include <cstdlib>
- #include <stdlib.h>
- #include <stdarg.h>
- #include <stdio.h>
- #include <string.h>
- #include <math.h>
- #include <vector>
- #include <core/basics/Exception.h>
- #include <core/vector/VectorT.h>
- #ifndef NICE_USELIB_MATIO
- #pragma message NICE_WARNING("We need the MATIO Library for accessing MATLAB structures. Otherwise this is not compiling.")
- #else
- #include <matio.h>
- #ifndef sparse_t
- #define sparse_t mat_sparse_t
- #endif
- namespace NICE {
-
- class MatFileIO {
-
- protected:
-
- mat_t *mat;
-
- public:
-
-
-
-
- MatFileIO();
-
-
- MatFileIO(std::string _filename, const mat_acc mode);
-
-
- ~MatFileIO();
-
-
-
-
-
-
- enum feature_matrix_order {
- NxD = 1,
- DxN = 2
- };
-
-
-
-
-
-
- int getNumberOfVariables();
-
-
-
-
-
-
-
- matvar_t * getVariableViaName(std::string _name);
-
-
-
- void getSparseVariableViaName(sparse_t & sparseVariable, std::string _name);
-
-
-
- void getFeatureMatrixViaName(std::vector<std::vector<double> > & features, std::string _name, const feature_matrix_order order = NxD);
-
-
-
- void getVectorViaName(NICE::Vector & vec, std::string _name);
-
- };
-
- }
- #endif
- #endif
|