validate_arg.h 1.2 KB

123456789101112131415161718192021222324252627282930313233343536
  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_VALIDATE_ARG_H
  9. #define IGL_VALIDATE_ARG_H
  10. #include "../igl_inline.h"
  11. #include <mex.h>
  12. namespace igl
  13. {
  14. namespace matlab
  15. {
  16. // Throw an error if arg i+1 is not a scalar
  17. //
  18. // Inputs:
  19. // i index of current arguement
  20. // nrhs total number of arguments
  21. // prhs pointer to arguements array
  22. // name name of current argument
  23. IGL_INLINE void validate_arg_scalar(
  24. const int i, const int nrhs, const mxArray * prhs[], const char * name);
  25. IGL_INLINE void validate_arg_logical(
  26. const int i, const int nrhs, const mxArray * prhs[], const char * name);
  27. IGL_INLINE void validate_arg_char(
  28. const int i, const int nrhs, const mxArray * prhs[], const char * name);
  29. IGL_INLINE void validate_arg_double(
  30. const int i, const int nrhs, const mxArray * prhs[], const char * name);
  31. }
  32. }
  33. #ifndef IGL_STATIC_LIBRARY
  34. # include "validate_arg.cpp"
  35. #endif
  36. #endif