parse_rhs.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. // This file is part of libigl, a simple c++ geometry processing library.
  2. //
  3. // Copyright (C) 2015 Alec Jacobson <[email protected]>
  4. //
  5. // This Source Code Form is subject to the terms of the Mozilla Public License
  6. // v. 2.0. If a copy of the MPL was not distributed with this file, You can
  7. // obtain one at http://mozilla.org/MPL/2.0/.
  8. #ifndef IGL_MATLAB_PARSE_RHS_H
  9. #define IGL_MATLAB_PARSE_RHS_H
  10. #include "../igl_inline.h"
  11. #include <mex.h>
  12. #include <Eigen/Dense>
  13. #include <Eigen/Sparse>
  14. namespace igl
  15. {
  16. namespace matlab
  17. {
  18. /// Reads in a matrix as a double
  19. ///
  20. /// @param[in] prhs points to rhs argument
  21. /// @param[out] V M by N matrix
  22. template <typename DerivedV>
  23. IGL_INLINE void parse_rhs_double(
  24. const mxArray *prhs[],
  25. Eigen::PlainObjectBase<DerivedV> & V);
  26. /// \overload
  27. template <typename VType>
  28. IGL_INLINE void parse_rhs(
  29. const mxArray *prhs[],
  30. Eigen::SparseMatrix<VType> & M);
  31. /// Reads in a matrix and subtracts 1
  32. ///
  33. /// @param[in] prhs points to rhs argument
  34. /// @param[out] V M by N matrix
  35. template <typename DerivedV>
  36. IGL_INLINE void parse_rhs_index(
  37. const mxArray *prhs[],
  38. Eigen::PlainObjectBase<DerivedV> & V);
  39. }
  40. };
  41. #ifndef IGL_STATIC_LIBRARY
  42. # include "parse_rhs.cpp"
  43. #endif
  44. #endif