ConverterNICEToMatlab.h 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. /**
  2. * @file ConverterNICEToMatlab.h
  3. * @author Alexander Freytag
  4. * @brief Several methods for converting NICE containers into Matlab data (Interface)
  5. * @date 15-01-2014 ( dd-mm-yyyy)
  6. */
  7. #ifndef _NICE_CONVERTERNICETOMATLABINCLUDE
  8. #define _NICE_CONVERTERNICETOMATLABINCLUDE
  9. // STL includes
  10. #include "mex.h"
  11. // NICE-core includes
  12. #include <core/vector/MatrixT.h>
  13. #include <core/vector/SparseVectorT.h>
  14. #include <core/vector/VectorT.h>
  15. namespace NICE {
  16. /**
  17. * @class ConverterNICEToMatlab
  18. * @author Alexander Freytag
  19. * @brief Several methods for converting Matlab data into NICE containers
  20. */
  21. class ConverterNICEToMatlab
  22. {
  23. protected:
  24. public:
  25. /**
  26. * @brief Default constructor
  27. **/
  28. ConverterNICEToMatlab();
  29. /**
  30. *@brief Default destructor
  31. **/
  32. ~ConverterNICEToMatlab();
  33. /**
  34. * @brief Convert a SparseVector into a Matlab 1xD sparse matrix
  35. * @author Alexander Freytag
  36. * @date 15-01-2014 ( dd-mm-yyyy)
  37. *
  38. * @param niceSvec a NIC::SparseVector
  39. * @param b_adaptIndexCtoM if true, dim k will be inserted as k, not as k+1 (which would be the default for C->M) Defaults to false.
  40. * @return mxArray*
  41. **/
  42. mxArray* convertSparseVectorFromNice( const NICE::SparseVector & niceSvec, const bool & b_adaptIndexCtoM = false ) const;
  43. /**
  44. * @brief Convert a NICE::Matrix into a full Matlab MxD matrix
  45. * @author Alexander Freytag
  46. * @date 15-01-2014 ( dd-mm-yyyy)
  47. *
  48. * @param niceMatrix a NICE::Matrix
  49. * @return mxArray*
  50. **/
  51. mxArray* convertMatrixFromNice( const NICE::Matrix & niceMatrix ) const;
  52. /**
  53. * @brief Convert a NICE::Vector into a full Matlab 1xD matrix
  54. * @author Alexander Freytag
  55. * @date 15-01-2014 ( dd-mm-yyyy)
  56. *
  57. * @param niceVector a NICE::Vector
  58. * @return mxArray*
  59. **/
  60. mxArray* convertVectorFromNice( const NICE::Vector & niceVector ) const;
  61. };
  62. }
  63. #endif