parse_rhs.h 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. // This file is part of libigl, a simple c++ geometry processing library.
  2. //
  3. // Copyright (C) 2015 Alec Jacobson <alecjacobson@gmail.com>
  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/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. // Inputs:
  21. // prhs points to rhs argument
  22. // Outputs:
  23. // V M by N matrix
  24. template <typename DerivedV>
  25. IGL_INLINE void parse_rhs_double(
  26. const mxArray *prhs[],
  27. Eigen::PlainObjectBase<DerivedV> & V);
  28. // Reads in a matrix and subtracts 1
  29. template <typename DerivedV>
  30. IGL_INLINE void parse_rhs_index(
  31. const mxArray *prhs[],
  32. Eigen::PlainObjectBase<DerivedV> & V);
  33. template <typename VType>
  34. IGL_INLINE void parse_rhs(
  35. const mxArray *prhs[],
  36. Eigen::SparseMatrix<VType> & M);
  37. }
  38. };
  39. #ifndef IGL_STATIC_LIBRARY
  40. # include "parse_rhs.cpp"
  41. #endif
  42. #endif